-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use RSPM with (macOS) fallback to CRAN #1048
Comments
The main difference between
In other words, As a workaround, I believe you could set your repositories as e.g.
since The main reason why we consider the lockfile repositories directly in |
Thank you very much for the clear explanation @kevinushey! Helped a lot to better understand what's going on under the hood. And I can properly work around the issue now 😄
Do you plan on supporting such a notion? Most straight-forward, I guess, would be to add support for an optional "R": {
"Repositories": [
{
"Name": "CRAN",
"URL": "https://packagemanager.rstudio.com/cran/latest",
"platforms": ["Windows", "Linux"]
},
{
"Name": "CRAN",
"URL": "https://cloud.r-project.org",
"platforms": "Darwin"
}
]
} |
Something like this will be very helpful |
I think this is basically a duplicate of #1052 |
RStudio Public Package Manager (RSPM) is an awesome service to the community, no doubt. It's main drawback compared to CRAN: No binaries for macOS.
renv seems to have RSPM integration to some degree, which is great. But I can't figure out a sane way to use the RSPM CRAN mirror URL (
https://packagemanager.rstudio.com/cran/latest
) for Linux and Windows, and at the same time the regular CRAN URL (https://cloud.r-project.org
) for macOS (or the RSPM mirror only for Linux and regular CRAN also for Windows, doesn't really matter I guess).I'm using the explicit snapshot type for my project (with a
DESCRIPTION
file listing immediate dependencies) and tried various different configurations to achieve the above goal. The nearest I could get issetting regular CRAN, i.e.
in the
renv.lock
file;conditionally overwriting the
repos
option in the project's.Rprofile
after activating renv when on Linux, i.e.With the above config on Linux (Ubuntu 22.04 in my case), the weird thing is that when I e.g. do
Output
and then do
Output
the package sp is fetched from RSPM as can be seen in the output above (fine!).
But when I instead run
Output
after the purge, the package sp is still fetched from regular CRAN, as can again be seen in the output above (this sucks...).
The entry for package sp in the project's
renv.lock
file looks as follows:Is the differing behavior between
renv::repair()
andrenv::restore()
above the intended behaviour? If so, why? And would it still be possible to fetch packages from RSPM on some platforms and from CRAN on others within a single renv project?The text was updated successfully, but these errors were encountered: