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::status() displaying incomplete information about inconsistencies #1788

Closed
dvg-p4 opened this issue Jan 10, 2024 · 3 comments
Closed

renv::status() displaying incomplete information about inconsistencies #1788

dvg-p4 opened this issue Jan 10, 2024 · 3 comments
Labels
bug an unexpected problem or unintended behavior status 🔮
Milestone

Comments

@dvg-p4
Copy link

dvg-p4 commented Jan 10, 2024

When I have some packages that are installed but not recorded, and some other packages that are installed AND recorded but an inconsistent version, renv::status() is only showing me the former and not displaying the latter.

Reprex

Create a directory with script.R:

library(data.table) 
print(data.table(foo = 1:3, bar = 4:6))

In the directory, run:

% R
> renv::init()
- Linking packages into the project library ... Done!
The following package(s) will be updated in the lockfile:

# CRAN -----------------------------------------------------------------------
- data.table   [* -> 1.14.8]
- renv         [* -> 1.0.3]

The version of R recorded in the lockfile will be updated:
- R            [* -> 4.2.3]

- Lockfile written to "~/scratchpad/renv-masking-reprex/renv.lock".
- renv activated -- please restart the R session.
[ctrl-D]
% R
> renv::install("data.table@1.14.6")
[installs]
> renv::status()

As expected:

The following package(s) are out of sync [lockfile -> library]:
# CRAN -----------------------------------------------------------------------
- data.table   [1.14.8 -> 1.14.6]
See ?renv::status() for advice on resolving these issues.

Now, edit script.R:

library(data.table)
print(data.table(foo = 1:3, bar = 4:6))
library(ggplot2)
ggplot(mpg, aes(displ, hwy, colour = class)) + geom_point()
% R
> renv::status()
The following package(s) are missing:

 package installed recorded used
 ggplot2 n         n        y   

See ?renv::status() for advice on resolving these issues.

No information is given about data.table's discrepancy anymore.

This can lead to some unexpected behavior if you run renv::restore() or renv::snapshot() in a more realistic scenario, expecting it only to affect packages listed by renv::status(). (Thankfully, those functions will prompt you with the full list of things they're about to change, so a keen eye will reveal what's going on.)

@kevinushey
Copy link
Collaborator

@dvg-p4 let me know if you're still planning to take a look

@dvg-p4
Copy link
Author

dvg-p4 commented Jan 15, 2024

@kevinushey Updated with reprex

@kevinushey kevinushey added bug an unexpected problem or unintended behavior status 🔮 labels Jan 16, 2024
@kevinushey kevinushey added this to the 1.1.0 milestone Jan 16, 2024
@kevinushey
Copy link
Collaborator

@dvg-p4 awesome, much appreciated! This should now be resolved.

@kevinushey kevinushey changed the title [STUB] renv::status() displaying incomplete information about inconsistencies renv::status() displaying incomplete information about inconsistencies Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior status 🔮
Projects
None yet
Development

No branches or pull requests

2 participants