r-lib / pkgdown

Generate static html documentation for an R package
https://pkgdown.r-lib.org/
Other
714 stars 334 forks source link

Examples rendering broken since 003d8ea #2654

Closed salim-b closed 3 months ago

salim-b commented 3 months ago

https://github.com/r-lib/pkgdown/pull/2629 introduced a regression resulting in failed rendering of the pkg reference. I narrowed the issue down to https://github.com/r-lib/pkgdown/commit/003d8ea72aa978ce0357a15c32edf4d84cf08f7e via bisecting.

Reproduce

  1. Install pkgdown@003d8ea via remotes::install_github("r-lib/pkgdown", ref = "003d8ea72aa978ce0357a15c32edf4d84cf08f7e")
  2. Render the current main branch's pkgdown site via pkgdown::build_site().

Error log

> pkgdown::build_site()
── Installing package pkgdown into temporary library ─────────────────────────────────────────
── Building pkgdown site for package pkgdown ───────────────────────────────────
Reading from: /home/salim/Code/other/R/pkgdown
Writing to: /home/salim/Code/other/R/pkgdown/docs/dev
── Sitrep ──────────────────────────────────────────────────────────────────────
✔ URLs ok.
✔ Favicons ok.
✔ Open graph metadata ok.
✔ Articles metadata ok.
✔ Reference metadata ok.
── Initialising site ───────────────────────────────────────────────────────────
── Building home ───────────────────────────────────────────────────────────────
Reading .github/CODE_OF_CONDUCT.md
Reading .github/CONTRIBUTING.md
Reading LICENSE.md
Reading README.md
── Building function reference ─────────────────────────────────────────────────
Reading man/as_pkgdown.Rd
Reading man/autolink_html.Rd
Error: 
! in callr subprocess.
Caused by error in `build_reference()`:
! Failed to parse Rd in autolink_html.Rd
Caused by error in `output_handler$source()`:
! argument "call" is missing, with no default
ℹ See `$stdout` and `$stderr` for standard output and error.
Type .Last.error to see the more details.

> .Last.error
<callr_error/rlib_error_3_0/rlib_error/error>
Error: 
! in callr subprocess.
Caused by error in `build_reference()`:
! Failed to parse Rd in autolink_html.Rd
Caused by error in `output_handler$source()`:
! argument "call" is missing, with no default
ℹ See `$stdout` and `$stderr` for standard output and error.
---
Backtrace:
1. pkgdown:::build_site()
2. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_dont_run, …
3. callr::r(function(..., cli_colors, hyperlinks, pkgdown_internet) { …
4. callr:::get_result(output = out, options)
5. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
---
Subprocess backtrace:
 1. pkgdown::build_site(...)
 2. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, …
 3. pkgdown::build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_dont_run, …
 4. pkgdown:::unwrap_purrr_error(purrr::map(topics, build_reference_topic, …
 5. base::withCallingHandlers(code, purrr_error_indexed = function(err) { …
 6. purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, …
 7. purrr:::map_("list", .x, .f, ..., .progress = .progress)
 8. purrr:::with_indexed_errors(i = i, names = names, error_call = .purrr_error_call, …
 9. base::withCallingHandlers(expr, error = function(cnd) { …
10. purrr:::call_with_cleanup(map_impl, environment(), .type, .progress, …
11. local .f(.x[[i]], ...)
12. base::withCallingHandlers(data_reference_topic(topic, pkg, examples_env = examples_env, …
13. pkgdown:::data_reference_topic(topic, pkg, examples_env = examples_env, …
14. pkgdown:::run_examples(tags$tag_examples[[1]], env = if (is.null(examples_env)) NULL else new.env(…
15. pkgdown:::highlight_examples(code, topic, env = env)
16. downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, …
17. evaluate::evaluate(code, child_env(env), new_device = TRUE, output_handler = output_hand…
18. evaluate:::evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, …
19. output_handler$source(source)
20. rlang::is_call(call, c("DONTSHOW", "TESTONLY"))
21. base::.handleSimpleError(function (err) …
22. local h(simpleError(msg, call))
23. cli::cli_abort("Failed to parse Rd in {.file {topic$file_in}}", …
24. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, …
25. | rlang:::signal_abort(cnd, .file)
26. | base::signalCondition(cnd)
27. (function (cnd) …
28. cli::cli_abort(message, location = i, name = name, parent = cnd, …
29. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, …
30. | rlang:::signal_abort(cnd, .file)
31. | base::signalCondition(cnd)
32. (function (err) …
33. rlang::cnd_signal(err$parent)
34. rlang:::signal_abort(cnd)
35. base::signalCondition(cnd)
36. global (function (e) …
hadley commented 3 months ago

Hmmm, it works for me. Do you have the latest evaluate?

salim-b commented 3 months ago

Do you have the latest evaluate?

Ah, that was the culprit!

I'm using the P3M CRAN mirror, and evaluate v0.24.0 has only become available there after the usual delay, so I was still on 0.23.0 when filing this issue. Updating resolved it, thanks!