-
Notifications
You must be signed in to change notification settings - Fork 154
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
checkout()
breaks restoring if checking out older snapshots
#1966
Comments
renv::checkout()
breaks restoring if checking out older snapshotscheckout()
breaks restoring if checking out older snapshots
Thanks for the bug report! In this scenario, would you rather have |
Yer, after submitting the report I was pondering this and I'm not actually sure. My gut is saying that I think you'd want to retain the original repo for |
I would think that my expected behaviour would be to get "old" renv: I think checkout should ideally make my lock file reflect exactly a specific snapshot. That said, there is a little weirdness here; I could checkout a snapshot with an renv <1, which does not have the checkout function in it. I think this is still appropriate. |
@kevinushey - I saw that you went for the approach I mentioned of reverting renv itself. If I get some time later today / next week I'll try and do some tests but my immediate fear would be wether this has the potential to cause conflicts with having and old package with future versions of activate.R and the other support stuff. I am wondering if downgrading needs to be combined with re-init'ing ? Apologies if this is already a solved problem I am not too familiar with the internals of renv. |
You're right -- we'll definitely want to re-generate the activate script with the newly-installed version of |
When using
checkout(<repo>)
it sets the repository URL in the lockdown file to be the value of<repo>
without checking wether the current version of renv can be installed from it or not. This causes issues becausecheckout()
also doesn't appear to downgrade renv to a version that is available in<repo>
As an example:
checkout("https://packagemanager.posit.co/cran/2024-01-02")
to fix my packages to a historic dateIf you then inspect the lock file you will see:
However renv 1.0.7 isn't available from this repo but
checkout()
has leftrenv
untouched.This then means that if someone else clones the project and attempts to load R they are greeted with the following error message as renv is unable to bootstrap itself:
The use case of downgrade may appear counter intuitive but we see it happen at our company where quite often people may start a project with full CRAN only later to decide that they need to use "validated packages" and thus use
checkout()
to set their repo to be a "validated PPM" bucketThe text was updated successfully, but these errors were encountered: