Trouble installing cmstanr in a GitHub Actions workflow

I maintain the stantargets R package, and the GitHub Actions workflows are having trouble installing cmdstanr. The DESCRIPTION file has Remotes: stan-dev/cmdstanr, but the workflows are trying and failing to install it from From Update docs · ropensci/stantargets@4f53500 · GitHub

Error: Error: Failed to install 'cmdstanr' from GitHub:
  (converted from warning) unable to access index for repository
  cannot open URL ''

That’s weird, thanks for letting us know. I’m not entirely sure what’s going on but maybe it’s because this seems to be trying to install a version built with R 4.1

but I don’t think we’ve uploaded versions built with R 4.1 yet.

That said, even with R 4.1 it should be able to fall back on the version built with 4.0. For example, install.packages("cmdstanr", repos = c("", getOption("repos"))) has a warning about this but then proceeds to install the version built with R 4.0 just fine (see below). It also looks like github actions is trying to install a binary version but then doesn’t try to install from source if that fails. install.packages("cmdstanr", repos = c("", getOption("repos"))) also handles that correctly. So perhaps whatever happens when a package is listed in Remotes isn’t as robust as install.packages?

> install.packages("cmdstanr", repos = c("", getOption("repos")))
Warning in install.packages :
  unable to access index for repository
  cannot open URL ''
installing the source package ‘cmdstanr’

trying URL ''
Content type 'application/gzip' length 195914 bytes (191 KB)
downloaded 191 KB

* installing *source* package ‘cmdstanr’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (cmdstanr)

Thanks Jonah, your response had some clues, and I remembered I had R_REMOTES_NO_ERRORS_FROM_WARNINGS: false in my GHA workflow files. So wrapping install_deps() in suppressWarnings() solved the original problem.

Now I am wondering why remotes would install from The documentation of remotes says it should install from GitHub.

Now I am wondering why remotes would install from

Could it be because the cmdstanr DESCRIPTION file has this?


Related: package building: install rstan from third party url from DESCRIPTION remotes · Issue #615 · r-lib/remotes · GitHub

Ok great, glad that solved it.

Yeah I think that’s probably why, but I didn’t realize that would also affect remotes.