Skip to content
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

renv::restore() based on how packages were installed #1984

Open
shriv opened this issue Sep 17, 2024 · 1 comment
Open

renv::restore() based on how packages were installed #1984

shriv opened this issue Sep 17, 2024 · 1 comment

Comments

@shriv
Copy link

shriv commented Sep 17, 2024

Kia ora,
I have projects where I run R in a nix environment (on MacOS 14.6.1 AMD64) but manage my packages with renv. I only recently learned that not all R installations are equal and the one that I have via nix prevents binary installations. I followed the following hack to enable them again. Rebuilds are so much faster now thank you! :-)

When a colleague wants to restore the same library on their laptop with the same OS and arch, renv::restore() will install the binaries if available. Unfortunately, some packages like sf, KernSmooth, classInt and Rcpp need to be installed from source because they don't link correctly to the dylib libraries if installed from binaries (this is an nix issue / feature? that I will raise separately).

Currently, I need to exclude the above packages in the first restore, change pkgType to source, restore again and revert the pkgType option. Is there a simple of getting renv to record how a package was installed (in the snapshot) and then following that installation in the restore? Any suggestions / thoughts will be much appreciated :-)

R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin23.6.0
Running under: macOS Sonoma 14.6.1
@kevinushey
Copy link
Collaborator

Thanks -- this isn't currently available in renv, but we could evaluate supporting this in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants