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

Result of renv::install(lock = TRUE) differs from renv::install(lock = FALSE); renv::snapshot() #1828

Closed
salim-b opened this issue Feb 21, 2024 · 2 comments

Comments

@salim-b
Copy link
Contributor

salim-b commented Feb 21, 2024

I'm using renv with its "explicit" snapshot type and just tested the new lock argument for renv::install() introduced in renv 1.0.4.

I noticed that when I install a new package1 using

renv::install("rsvg", lock = TRUE)

renv writes the following lines to my project's renv.lock:

    "rsvg": {
      "Package": "rsvg",
      "Version": "2.6.0",
      "OS_type": null,
      "NeedsCompilation": "yes",
      "Repository": "CRAN",
      "Source": "Repository",
      "Path": "/home/salim/.cache/R/renv/cache/v5/R-4.3/x86_64-pc-linux-gnu/rsvg/2.6.0/7aaf92c4adddc8a85696ae7f0123a725/rsvg"
    },

When installing the same package using

renv::install("rsvg", lock = FALSE)
renv::snapshot()

OTOH, renv writes these lines to the renv.lock:

    "rsvg": {
      "Package": "rsvg",
      "Version": "2.6.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Hash": "7aaf92c4adddc8a85696ae7f0123a725"
    },

I guess this isn't supposed to be the intended behaviour, no?

I was first delighted by the new lock argument since it'd give a better UX for renv's explicit snapshot type, but I really don't wanna write local filesystem paths to an renv project's lock file shared with others...

Footnotes

  1. For the sake of simplicity, I use rsvg here, a package without any further R package dependencies. In both cases, rsvg was added to the project's DESCRIPTION file before installing it.

@kevinushey
Copy link
Collaborator

🤦 Thanks for the bug report; I'll get this fixed up.

@kevinushey
Copy link
Collaborator

Should hopefully be fixed via 2efbbdd.

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