I have a question about the best way to use {renv} and RSPM in a shared project. I want (a) all collaborators to use renv
to install packages, and also for installs to go fast using pre-built binaries. Some users/machines are on Ubuntu and others are on macOS. RSPM provides Linux binaries, but I don't believe macOS binaries, while CRAN provides macOS binaries.
I have a project-level .Rprofile
where I define package repositories like so:
options(
repos = c(RSPM = "https://packagemanager.rstudio.com/all/latest",
CRAN = "https://cran.rstudio.com/")
)
So my renv.lock
starts like this:
{
"R": {
"Version": "4.2.1",
"Repositories": [
{
"Name": "RSPM",
"URL": "https://packagemanager.rstudio.com/all/latest"
},
{
"Name": "CRAN",
"URL": "https://cran.rstudio.com"
}
]
},
"Packages": {
"BH": {
"Package": "BH",
"Version": "1.78.0-0",
"Source": "Repository",
"Repository": "CRAN",
"Hash": "4e348572ffcaa2fb1e610e7a941f6f3a",
"Requirements": []
},
...
Currently, I think this means that if packages come from RSPM, macOS users will end up installing from source , but if packages come from CRAN, Linux users will end up installing from source. Whether they are designated as RSPM or CRAN depends on whether those entries in renv.lock
are contributed by an Ubuntu or macOS user committing to the git repository. Is there any way to do this so that everyone installs everything possible from binaries?