Error: Error: Failed to install 'cmdstanr' from GitHub:
(converted from warning) unable to access index for repository https://mc-stan.org/r-packages/bin/macosx/contrib/4.1:
cannot open URL 'https://mc-stan.org/r-packages/bin/macosx/contrib/4.1/PACKAGES'
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("https://mc-stan.org/r-packages/", 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("https://mc-stan.org/r-packages/", 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("https://mc-stan.org/r-packages/", getOption("repos")))
Warning in install.packages :
unable to access index for repository https://mc-stan.org/r-packages/bin/macosx/contrib/4.1:
cannot open URL 'https://mc-stan.org/r-packages/bin/macosx/contrib/4.1/PACKAGES'
installing the source package ‘cmdstanr’
trying URL 'https://mc-stan.org/r-packages/src/contrib/cmdstanr_0.4.0.tar.gz'
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 mc-stan.org. The documentation of remotes says it should install from GitHub.