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

Allow isolated projects to read from cache / copy into isolated library #556

Closed
kdkavanagh opened this issue Oct 14, 2020 · 3 comments
Closed

Comments

@kdkavanagh
Copy link

Related to #555

Would be helpful to have a way to override the project's settings.dcf at runtime, or provide use.cache as an argument to restore and eliminate any ambiguity. Since isolate() modifies the settings.dcf file, other processes activating the same project (but using differently library paths - HPC-style usecase) will not be able to use the cache. In other words, is there a way to make the cache setting a property of the library path rather than a property of the renv project?

Perhaps a way to say "Use the cache, but copy instead of symlink" during restore would be sufficient, effectively isolating w/o disabling the cache

@kevinushey
Copy link
Collaborator

It looks like renv does have a mechanism for setting project settings without persisting them. For example:

renv::settings$use.cache(FALSE, persist = FALSE)

Would that be sufficient for your case?

@kdkavanagh
Copy link
Author

Not quite - That certainly helps for manually disabling the cache for some invocation, however isolate() itself disables the cache and persists the change w/o giving the user that control. Additionally, I'd like the ability to restore from the cache, but actually copy the packages into the library instead of symlinking. In other words, isolate() but without disabling the cache in the project settings OR restore() forcing it to use the cache

@kevinushey
Copy link
Collaborator

Got it -- thanks for elaborating. I've added the ability to control whether renv uses symlinks in the development version of renv -- you can set:

options(renv.config.cache.symlinks = FALSE)

to instruct renv to copy, rather than link, from the cache when appropriate. (You can set this in the project .Rprofile, or renv/settings.R, if you'd like the option to be tied to that particular project)

In addition, renv::isolate() now only copies symlinked packages from the cache back into the project library; it does not also set the associated project setting.

@hadley hadley closed this as completed Apr 28, 2023
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

3 participants