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 install linking from cache only #1861

Open
pedriniedoardo opened this issue Mar 21, 2024 · 1 comment
Open

renv install linking from cache only #1861

pedriniedoardo opened this issue Mar 21, 2024 · 1 comment

Comments

@pedriniedoardo
Copy link

pedriniedoardo commented Mar 21, 2024

Hello,
I have a general question about the initialization of a new project using renv.

This is a sample case:
I create a new renv project with renv::init
I need to install tidyverse, I use renv::install("tidyvese") (Tidiverse was already installed before with all the dependencies at the time of installation, and is available in the cache).
renv repopulates the project folder with the requested packages and relative dependencies. Some packages are linked from the cache since they are already available. Some others might have changed over time; therefore, they are not linked from the cache but built from source or installed as binaries.

...
- Installing gplots ...                         OK [linked from cache]
- Installing ROCR ...                           OK [linked from cache]
- Installing Rtsne ...                          OK [built from source and cached in 23s]
- Installing scattermore ...                    OK [built from source and cached in 5.9s]
...

The question is:
Can I install only the version of the packages already available in the cache and avoid installing a newer version?
Is there a specific argument in renv::install() or a different renv:: command?
Should I just copy the renv folder from an old project and use that one in the new project?
Does it make sense to copy only from the cache to avoid installation of multiple newer versions of dependencies packages?
Should I install only the version of the packages already available in the cache and avoid installing a newer version?

@kevinushey
Copy link
Collaborator

Can I install only the version of the packages already available in the cache and avoid installing a newer version?

I don't think this is currently available, unfortunately.

Should I just copy the renv folder from an old project and use that one in the new project?

This is probably the most straightforward solution for now.

Does it make sense to copy only from the cache to avoid installation of multiple newer versions of dependencies packages?

I think it depends -- there's no guarantee that the combination of packages pulled from the cache would be compatible, hence why renv::init() normally prefers using the latest-available versions of packages. If you want to "freeze" the versions of packages being used, it's probably better to create a lockfile via renv::snapshot(), and then use renv::restore() to install those same package versions (which would then be discovered in the cache as appropriate).

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