Continuing the discussion from Using rstan() in R package: Error with R CMD check:
I am running into similar issues as in the linked issue with an R package that has brms
, cmdstanr
, and rstan
in the Suggests
but I have not had success with the solution from that topic which involved specifying the R_LIBS
env variable in the check.Renviron file. I am opening a new topic because I think this is related to the new version of rstan
since R CMD check
(local and remote via github actions) were passing on Friday (9/8/2023) before the rstan
2.26 release.
Locally (Ubuntu 22.04) devtools::check
and R CMD check
work fine with one note about the size of the data and docs directories. When I run R CMD check
with github actions it passes on Mac and Windows (same single note as I get locally) but fails on Ubuntu (release and previous version). The error on Ubuntu is coming when I try to load rstan
.
Based on the release post I tried adding StanHeaders
to the Suggests
for the package but that did not change the errors. I am not very well versed in R package conventions and the environment that github actions uses so my apologies if there is an obvious solution I am missing.
I installed the new version of rstan
locally on Ubuntu 22.04 without issue:
> library(rstan)
Loading required package: StanHeaders
rstan version 2.26.23 (Stan version 2.26.1)
The last error message from github actions is:
** testing if installed package can be loaded
##[error]Error: package or namespace load failed for ‘rstan’:
.onLoad failed in loadNamespace() for 'rstan', details:
call: NULL
error: SyntaxError: Illegal break statement
##[error]Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/tmp/RtmpZ70aM8/pkg-lib13f523c9e348/rstan’
---
Backtrace:
1. pak::lockfile_install(".github/pkg.lock")
2. pak:::remote(function(...) { …
3. err$throw(res$error)
---
Subprocess backtrace:
1. base::withCallingHandlers(cli_message = function(msg) { …
2. get("lockfile_install_internal", asNamespace("pak"))(...)
3. plan$install()
4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, …
5. base::withCallingHandlers({ …
6. pkgdepends:::handle_events(state, events)
7. pkgdepends:::handle_event(state, i)
8. pkgdepends:::stop_task(state, worker)
9. pkgdepends:::stop_task_build(state, worker)
10. base::throw(new_pkg_build_error("Failed to build source package {pkg}", …
11. | base::signalCondition(cond)
12. global (function (e) …
Execution halted
##[error]Process completed with exit code 1.