pkgdown
pkgdown copied to clipboard
pkgdown suddenly started failing when calling `ragg::agg_png`
Hi all,
I currently have an issue with the pkgdown build on my Gitlab CI instance. I cannot reproduce this on my local machine which makes it even harder for me to see what's wrong.
The issue started around April, 24th. At this point I did not alter any related code, so it seems that issue must have been triggered by some package update.
The CI build container is an rocker/r-base based docker image where all the required R-packages are installed via devtools::install_dev_deps(). So actually the R-package versions should be exactly the same as on my local machine. (I disabled all the caches to be sure of that, but that didn't change anything).
The actual error I get is caused by reading a certain man/_.Rd file:
Standard output: == Building pkgdown site ======================================================= Reading from: '/builds/lschneiderbauer/scmqueries' Writing to: '/builds/lschneiderbauer/scmqueries/docs' -- Initialising site ----------------------------------------------------------- Copying '../../../usr/lib/R/site-library/pkgdown/BS5/assets/link.svg' to 'link.svg' Copying '../../../usr/lib/R/site-library/pkgdown/BS5/assets/pkgdown.js' to 'pkgdown.js' -- Building home --------------------------------------------------------------- Writing 'authors.html' Writing 'LICENSE-text.html' Copying 'man/figures/lifecycle-archived.svg' to 'reference/figures/lifecycle-archived.svg' Copying 'man/figures/lifecycle-defunct.svg' to 'reference/figures/lifecycle-defunct.svg' Copying 'man/figures/lifecycle-deprecated.svg' to 'reference/figures/lifecycle-deprecated.svg' Copying 'man/figures/lifecycle-experimental.svg' to 'reference/figures/lifecycle-experimental.svg' Copying 'man/figures/lifecycle-maturing.svg' to 'reference/figures/lifecycle-maturing.svg' Copying 'man/figures/lifecycle-questioning.svg' to 'reference/figures/lifecycle-questioning.svg' Copying 'man/figures/lifecycle-stable.svg' to 'reference/figures/lifecycle-stable.svg' Copying 'man/figures/lifecycle-superseded.svg' to 'reference/figures/lifecycle-superseded.svg' Writing '404.html' -- Building function reference ------------------------------------------------- Writing 'reference/index.html' Reading 'man/alloc.Rd' Writing 'reference/alloc.html' ... [a bunch of similar "Reading"/"Writing" lines removed for better readabilty] Reading 'man/get_sql.Rd' Writing 'reference/get_sql.html' Reading 'man/get_src_tbls.Rd'
Standard error:
Loading required package: dplyr
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Loading required package: dbplyr
Attaching package: ‘dbplyr’
The following objects are masked from ‘package:dplyr’:
ident, sql
Loading required package: stringr
Attaching package: ‘scmqueries’
The following object is masked from ‘package:base’:
t
---
Backtrace:
1. pkgdown::build_site()
2. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_don…
3. callr::r(function(..., cli_colors, 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_r…
3. pkgdown::build_reference(pkg, lazy = lazy, examples = examples, run_dont_run = run_…
4. purrr::map(topics, build_reference_topic, pkg = pkg, lazy = lazy, …
5. purrr:::map_("list", .x, .f, ..., .progress = .progress)
6. purrr:::with_indexed_errors(i = i, names = names, error_call = .purrr_error_call, …
7. base::withCallingHandlers(expr, error = function(cnd) { …
8. purrr:::call_with_cleanup(map_impl, environment(), .type, .progress, …
9. local .f(.x[[i]], ...)
10. base::withCallingHandlers(data_reference_topic(topic, pkg, examples_env = exampl…
11. pkgdown:::data_reference_topic(topic, pkg, examples_env = examples_env, …
12. pkgdown:::run_examples(tags$tag_examples[[1]], env = if (is.null(examples_env)) NULL…
13. pkgdown:::highlight_examples(code, topic, env = env)
14. downlit::evaluate_and_highlight(code, fig_save = fig_save_topic, …
15. evaluate::evaluate(code, child_env(env), new_device = TRUE, output_handler…
16. grDevices::dev.new()
17. base::do.call(dev, a)
18. (function (...) …
19. ragg::agg_png(..., bg = bg)
20. base::.handleSimpleError(function (err) …
21. local h(simpleError(msg, call))
22. rlang::abort(msg, parent = err)
23. | rlang:::signal_abort(cnd, .file)
24. | base::signalCondition(cnd)
25. (function (cnd) …
26. cli::cli_abort(message, location = i, name = name, parent = cnd, …
27. | rlang::abort(message, ..., call = call, use_cli_format = TRUE, …
28. | rlang:::signal_abort(cnd, .file)
29. | base::signalCondition(cnd)
30. global (function (e) …
Execution halted
The file man/get_src_tbls.Rd is really simple and nothing special really:
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scmquery.R
\name{get_src_tbls}
\alias{get_src_tbls}
\title{Get source table names used by query}
\usage{
get_src_tbls(query)
}
\arguments{
\item{query}{Lazy dbplyr query}
}
\value{
A vector of table names, used by the active source system.
}
\description{
Retrieves the source tables used by a given query.
}
\examples{
init_con("dummy")
get_src_tbls(t(MARA))
}
\concept{helper}
Any idea what might cause the error?
I don't know why it would try to call ragg::agg_png where no figures are involved at all, but I double checked and ragg is definitely installed on the CI container.
Thanks a lot!
That help file example calls t(MARA), with t() coming from your package, not from the base package. Is that intentional?
One other thing: Apr 24 is just after the release of R 4.3.0. Which version of R is running?
That help file example calls t(MARA), with t() coming from your package, not from the base package. Is that intentional?
Yes, that is intentional. Thanks for pointing that out.
One other thing: Apr 24 is just after the release of R 4.3.0. Which version of R is running?
Ah, nice catch. The CI version is
- using R version 4.3.0 (2023-04-21)
- using platform: x86_64-pc-linux-gnu (64-bit)
- R was compiled by gcc (Debian 12.2.0-14) 12.2.0 GNU Fortran (Debian 12.2.0-14) 12.2.0
while my local version is 4.2.1. Unfortunately, it will take a while until I can update my local machine to R-4.3.0 to confirm that this R version might be the root cause.
I just downgraded the CI R version to 4.2.3, and indeed, the error disappears. So it really is a problem with R-4.3.0.
I just ran into the same issue (and I thought I had once before, but must have been on a different machine). It is due to a somewhat suboptimal chain of events:
- R 4.3.0 brings with it a new 'Graphics Engine' constant (in R_ext/GraphicsEngine.h).
- The release notes for R 4.3.0 state that and dryly recommend that graphics packages should be rebuilt
- Neither R (when loading) nor the compiled package complain at load
- But as soon as a new graphics device is opened and the package in question call this (optional) check:
R_GE_checkVersionOrDie())it is over - So
Rscript -e 'install.packages(ragg)'is your fix here
And the simple fix is to rebuild / reinstall ragg which you may have had from a r-cran-ragg binary. We will add a versioned API tag to the r-base-core package in Debian for R 4.4.0 and later to catch this.
Looks like this is now resolved by the passage of time, so I'm going to close. But please let me know if there's anything obvious we can do in svglite or elsewhere to make this less painful in the future.