Open hutch3232 opened 7 months ago
The activate script should be getting updated here:
https://github.com/rstudio/renv/blob/536e04d2b6e28c613a1a79518ddffb51a1dcde6a/R/upgrade.R#L102-L119
Any chance you're able to do something like:
debug(renv:::r)
renv::upgrade()
and see if you can figure out what's going wrong?
As you can see I turned off the silent flags when running R for debugging purposes.
args <- c("--vanilla", "-f", renv_shell_path(script))
r(args)
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> {
+ renv <- asNamespace("renv")
+ renv$summon()
+ NULL <- renv_metadata_version_create(structure(list(Package = "renv",
+ Version = "1.0.5", OS_type = NA_character_, NeedsCompilation = "no",
+ Repository = "CRAN", Source = "Repository"), url = "https://mypackage_repo.com/cran/src/contrib", type = "source", name = "CRAN"))
+ renv_infrastructure_write("/mnt/code", version = NULL)
+ }
Error in NULL <- renv_metadata_version_create(structure(list(Package = "renv", :
invalid (do_set) left-hand side to assignment
Execution halted
I think it's because version
exists in this scope and is NULL
.
🤦 You are definitely right. I'll take a look.
Should now be resolved with the latest development builds of renv
; are you able to confirm?
Thank you for working on this! I attempted to test it. It was a bit less clear how I should do that but here is what I tried.
I found the commit where it looked like you introduced the fix, so I installed that version of renv
. Then I ran renv::upgrade
in debug
mode. Like before, I turned off the silencing of errors and received this:
devtools::install_github(repo = "rstudio/renv", ref = "60a8e4bd484cfded9757780c2edb28aa8a2d68fe")
A new version of the renv package will be installed:
# GitHub ---------------------------------------------------------------------
- renv [ver: 1.0.5.9000 -> 0.17.3-62; ref: 48a3815d1062d1913c3af361ae1a365090254c92 -> 0.17.3-62; sha: 48a3815d -> bdafa403]
This project will use the newly-installed version of renv.
R version 4.3.3 (2024-02-29 ucrt) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> {
+ renv <- asNamespace("renv")
+ renv$summon()
+ version <- renv_metadata_version_create(list(Package = "renv",
+ Version = "0.17.3-62", Source = "GitHub", RemoteType = "github",
+ RemoteHost = "api.github.com", RemoteUsername = "rstudio",
+ RemoteRepo = "renv", RemoteRef = "0.17.3-62", RemoteSha = "bdafa4033ec3166aa1f36a4f02db8e3d09ca4ae0"))
+ renv_infrastructure_write(project, version = version)
+ }
Error: attempt to apply non-function
Execution halted
It isn't clear to me what has gone wrong but I'm happy to try other testing/troubleshooting steps if you have any you'd like me to try.
Hi @kevinushey, thanks as always for the amazing
renv
package! I tried usingrenv::upgrade
to go from 1.0.4 to 1.0.5 this morning and encountered this issue:The fix was very simple. I just ran
renv::activate()
and it then changed the one line inrenv/activate.R
to reflect the new version number. Then I ranrenv::snapshot()
to cleanup therenv
record, but this latter behavior is not new to 1.0.5, I've always needed to do that.