-
Notifications
You must be signed in to change notification settings - Fork 155
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} 0.17.0 cannot find rmarkdown on hydrate with bare project on CI #1161
Comments
Any chance you can share a reproducible example? The output of the following might also be useful:
And perhaps:
|
😅 I can only get it to trigger on R CMD check, so it's one of those awkward situations where I'm trying to pick up a grain of rice with chopsticks attached to baseball bats. I'll insert those commands and see what output I can get. |
That's.... interesting. Here's the output on r-devel: The following packages are used in this project, but not available locally:
rmarkdown
renv will attempt to download and install these packages.
* Hydrated 0 packages in 0.0055 milliseconds.
── renv diagnostics ────────────────────────────────────────────────────────────
── find.package ──
[1] "/tmp/RtmpjB6CA6/RLIBS_1d2b6a5e5492/rmarkdown"
── libPaths() ──
[1] "/tmp/RtmpjB6CA6/RLIBS_1d2b6a5e5492" "/opt/R/devel/lib/R/library"
── renv_libpaths_user() ──
[1] "NULL"
── renv_libpaths_site() ──
character(0)
── renv_hydrate_dependencies() ──
* Discovering package dependencies ...
Done!
list()
── renv_hydrate_libpaths() ──
[1] "NULL" "/opt/R/devel/lib/R/library"
→ Recording changes in lockfile
for context, this is what I see on [kraftwerk voice] my home computer: ── renv diagnostics ────────────────────────────────────────────────────────────
── find.package ──
[1] "/home/zhian/R/library/rmarkdown"
── libPaths() ──
[1] "/home/zhian/R/library" "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library" "/usr/lib/R/library"
── renv_libpaths_user() ──
[1] "~/R/library"
── renv_libpaths_site() ──
[1] "/usr/local/lib/R/site-library/" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
── renv_hydrate_dependencies() ──
* Discovering package dependencies ... Done!
list()
── renv_hydrate_libpaths() ──
[1] "/home/zhian/R/library" "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library" "/usr/lib/R/library"
[5] "/usr/lib/R/library" |
One more context that succeeds: R 4.0.5: ── renv diagnostics ────────────────────────────────────────────────────────────
── find.package ──
[1] "/tmp/Rtmpz4ewKg/RLIBS_17bb13301fed/rmarkdown"
── libPaths() ──
[1] "/tmp/Rtmpz4ewKg/RLIBS_17bb13301fed" "/opt/R/4.0.5/lib/R/library"
── renv_libpaths_user() ──
[1] "/tmp/Rtmpz4ewKg/RLIBS_17bb13301fed"
── renv_libpaths_site() ──
character(0)
── renv_hydrate_dependencies() ──
* Discovering package dependencies ...
Done!
list()
── renv_hydrate_libpaths() ──
[1] "/tmp/Rtmpz4ewKg/RLIBS_17bb13301fed" "/opt/R/4.0.5/lib/R/library" |
OH HO HO HO! I think it comes down to the environment variables. Somehow From the failing run on R 4.2:
And from a successful run on R 4.1
|
I think the answer to this problem is to add Lines 143 to 156 in 31ae17a
I've tested it on my machine and it has restored my ability to check. Yes, it's hacky and doesn't really get into the root of the issue, but I honestly have no clue why R CMD check is doing things this way. |
In R CMD check for R >= 4.2, the environment variable R_LIBS_USER somehow gets set to the character NULL. This is a bandaid for this. See rstudio#1161 (comment)
In R CMD check for R >= 4.2, the environment variable R_LIBS_USER somehow gets set to the character NULL. This is a bandaid for this. See #1161 (comment)
It's successful for R 4.0 and up! 🎉 Thank you for the help! CI is still failing for R < 4.0... it appears to be setting the user lib to one that doesn't exist on the CI... at least it's different than the successful runs. Do you know why that may be?
|
Sorry, I don't know... As a workaround, you can also try passing a custom |
I could also consider having |
I am happy to report that this solution did indeed fix the remaining problems! 👯 @kevinushey, I cannot speak for the wider R community, but the time and dedication you put into {renv} has made a whole lot of reproducibility issues a lot easier to tackle. The fact that you were able to point me to the right tools to help debug this issue (despite my best efforts at complicating matters 🙈) shows how well-designed {renv} is as a flexible and sensible method for package management. Thank you so much for everything you do 🙌🏼
I saw that you implemented this in c068880 and I can report that on re-running the job, it now works! |
Great news :-) Thank you for the kinds words; I'm glad that I'm able to play my part! |
I'm having a problem with {sandpaper}, which uses {renv} to provision a non-invasive dependencies for lessons.
I'm finding an odd situation: on Continuous integration, and ONLY on R > 4.2 and < 4.0, {renv} can not detect {rmarkdown} during bootstrap.
During bootstrap, I do the following steps:
However, with the latest version of {renv}, I've noticed problems with the bootstrap hydration phase:
But when I run
renv::diagnostics()
, {rmarkdown} is available locally:diagnostics report
Do you have any advice of where I can look to debug?
The text was updated successfully, but these errors were encountered: