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

Issues with renv 0.17.0 and 0.17.1 #406

Closed
zkamvar opened this issue Mar 7, 2023 · 7 comments
Closed

Issues with renv 0.17.0 and 0.17.1 #406

zkamvar opened this issue Mar 7, 2023 · 7 comments
Labels
bug Something isn't working frequency: high indicator that a use-case has a high-frequency in lessons package cache Related to the {renv} package cache solution 💡 A temporary solution is in the comments

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Mar 7, 2023

Note

We are leaving this issue open so that anyone who experiences issues know to upgrade {renv}

Recommendation

It is recommended for users to use {renv} version >= 0.17.2 (currently on CRAN) OR {renv} version <= 0.16.0.

Please run install.packages("renv") from your R console to upgrade.


Note

What follows below are protocols for when {renv} version 0.17.2 was not yet on CRAN.'
If you have {renv} version >= 0.17.2, then you do not need to do anything.

Test if you need to update your version of {renv}

To test if you need to update your version of {renv}, run this R code in your R console:

packageVersion("renv") > package_version("0.17.1")
#> [1] TRUE

If the result is TRUE, then you do not need to do anything.

If the result is FALSE, then follow one of the steps below.

Upgrading to the patched version: 0.17.0-38

To upgrade to the patched version of {renv}, use the following code to install renv version 0.17.0-38 from The Carpentries R-universe. Note: this is the version that {sandpaper} will use to build your R Markdown lessons on GitHub.

install.packages('renv', repos = c('https://carpentries.r-universe.dev', 'https://cloud.r-project.org'))

Note
renv 0.17.1 has a bug with its package cache (see rstudio/renv#1168) where the hashing changed.
This has been fixed in 0.17.2.

Downgrading to 0.16.0

If you wish to downgrade {renv} instead, you can install {renv} from an archive:

install.packages("https://cran.r-project.org/src/contrib/Archive/renv/renv_0.16.0.tar.gz")

Problem

The new version of {renv} 0.17.0 introduced a few unexpected bugs:

  1. The renv/ folder now contains a locked sandbox folder, which causes teardown errors:
    rm: cannot remove '/tmp/Rtmp7JrJC1/Rbuild184d2b8b02c/sandpaper/renv/sandbox/R-4.2/x86_64-pc-linux-gnu/99f2a2ef/spatial': Permission denied
    ... snip ...
    rm: cannot remove '/tmp/Rtmp7JrJC1/Rbuild184d2b8b02c/sandpaper/renv/sandbox/R-4.2/x86_64-pc-linux-gnu/99f2a2ef/foreign': Permission denied
    
  2. The welcome message has changed so our regex no longer works and causes R CMD check to fail:
    --- re-building ‘building-with-renv.Rmd’ using rmarkdown
    Quitting from lines 44-48 (building-with-renv.Rmd) 
    Error: Error: processing vignette 'building-with-renv.Rmd' failed with diagnostics:
    NA/NaN argument
    
  3. BioConductor packages can no longer be provisioned or restored (see renv 0.17.0 issues with provisioning non-CRAN packages rstudio/renv#1156)
  4. Continuous Integration is failing in ways that I cannot debug at the moment (see {renv} 0.17.0 cannot find rmarkdown on hydrate with bare project on CI rstudio/renv#1161 and [temporary fix] use devel renv #405)

Lessons Affected

  • BioConductor Lessons can no longer restore their package cache
  • New R Markdown lessons can no longer add new packages to the cache

All other existing lessons should work as expected.

@zkamvar zkamvar added the bug Something isn't working label Mar 7, 2023
@zkamvar zkamvar pinned this issue Mar 7, 2023
zkamvar added a commit to carpentries/carpentries.r-universe.dev that referenced this issue Mar 7, 2023
This will address carpentries/sandpaper#406 and rstudio/renv#1156 until the next version of {renv} is sent to CRAN
@zkamvar zkamvar added the package cache Related to the {renv} package cache label Mar 8, 2023
@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 9, 2023

Update

The issues presented have been fixed as of {renv} 0.17.0-38 🎉

Point 1 was fixed in rstudio/renv@8b5cb2c
Point 2 was easily addressed in c0f19a1 and 75506e3, which updated the message parsing.

Point 3 was not explicitly a BioConductor bug and was addressed in rstudio/renv@7aa92a0, which updated how r-universe repositories were handled.

Point 4 was fixed by rstudio/renv@028ccc5 and rstudio/renv@c068880, which updated the way R_LIBS_USER envvars were validated and how hydrate provisions source libraries.

Tasks left

@zkamvar zkamvar added solution 💡 A temporary solution is in the comments frequency: high indicator that a use-case has a high-frequency in lessons labels Mar 9, 2023
@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 17, 2023

{renv} 0.17.1 has been released to CRAN. I will test this with the bioc lessons and then close this issue.

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 17, 2023

It does not break the bioc lessons, but #415 shows that there is something up with the reporting mechanism.

In addition, the hashing mechanism appears to be different

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 17, 2023

In addition, the hashing mechanism appears to be different

I see that someone else has noticed this: rstudio/renv#1168

@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 17, 2023

What this means is that, because we make sure to rebuild if the package cache file has changed

sandpaper::package_cache_trigger(TRUE)

then all R-based lessons will constantly go through a rebuild process until renv 0.17.2 is released.

@zkamvar zkamvar changed the title Issues with renv 0.17.0 Issues with renv 0.17.0 and 0.17.1 Mar 17, 2023
@zkamvar
Copy link
Contributor Author

zkamvar commented Mar 29, 2023

As of {renv} 0.17.2, you do not need to do anything as long as your version of {sandpaper} is up-to-date

@zkamvar
Copy link
Contributor Author

zkamvar commented May 19, 2023

I believe this is no longer an issue, so I will close it hoping that others who face this problem will find their way here.

@zkamvar zkamvar closed this as completed May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frequency: high indicator that a use-case has a high-frequency in lessons package cache Related to the {renv} package cache solution 💡 A temporary solution is in the comments
Projects
None yet
Development

No branches or pull requests

1 participant