3

I'm a long-time renv fan and user but on upgrading to renv 1.0.0 I'm now tearing my hair out. Every time I open a new project and run a script, after the first library command renv gives me a message:

What do you want to do?

1: Snapshot, just using the currently installed packages.
2: Install the packages, then snapshot.
3: Cancel, and resolve the situation on your own.

Selection:

Prior to v1.0.0 it just reported there was an inconsistency but didn't show a message requesting user input. I know I can just shapshot but I wanted to see if I could disable this request for user input.

So I looked at the documentation and tried

RENV_CONFIG_SYNCRONIZED_CHECK = FALSE

In my .Renviron file. And re-loaded my project. But I still get the same thing. Any suggestions? Or is it impossible to disable this?

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
  • It looks as though there are configuration options that would control this. I'm not familiar with `renv` so I don't know the proper way to change them. If you give minimal reproducible instructions to get the error (starting from nothing, and not asking for things like "write a package", be specific!), I would try to figure it out. – user2554330 Aug 14 '23 at 11:38
  • This message should only occur after you called `renv::snapshot()`, if there are missing packages. Find out where `renv::snapshot()` is being called in your project. – Konrad Rudolph Aug 14 '23 at 12:38
  • Just to add, there is an option renv.config.synchronized.check and I've tried setting it to FALSE (and confirmed that it is set to FALSE but this makes no difference. – Mike Dunbar Aug 15 '23 at 13:20
  • @KonradRudolph just to confirm, I'm not calling renv::snapshot() anywhere in my code. The response is triggered after whatever first line of R code is executed (typically a library command) – Mike Dunbar Aug 15 '23 at 13:22
  • 1
    @MikeDunbar Right, but according to the ‘renv’ source code this message is [*only*](https://github.com/search?q=repo%3Arstudio/renv%20renv_snapshot_report_missing&type=code) produced [after an explicit call to `renv::snapshot()`](https://github.com/rstudio/renv/blob/0cf6b8a54c4994cac8579ce815fb676c13e5814a/R/snapshot.R#L1012-L1058). That’s why I suspect that *something* is calling it. – Konrad Rudolph Aug 15 '23 at 13:25
  • Thanks, I agree something is calling it, but I just can't work out what. It always happens on the first line of code, but can also occasionally happen at other times (it just happened now). – Mike Dunbar Aug 15 '23 at 14:06

1 Answers1

1

This was a bug with the renv 1.0.0 release; it should be resolved with renv 1.0.2. If you're still having trouble, please file an issue at https://github.com/RStudio/renv/issues.

Kevin Ushey
  • 20,530
  • 5
  • 56
  • 88