You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reprex is to clone https://github.com/rladies/rladies.github.io and try and load it in Positron. Note that activate.R has pinned the renv version to 1.0.1 there, an old version.
What follows is my analysis of the problem from #6344
(id encourage using renv::upgrade() to get all the way up to latest renv, you may have to do this from rstudio)
(you will have to fully clean out the renv/library/ if you've already restored before, you need to get renv to re-bootstrap itself)
The long answer is that we have specific patches support for renv to avoid letting renv ask the user questions at .Rprofile time before ark is fully started up. We recognize when renv is running through a global option and return "n" rather than showing an input prompt to the user, which lets renv return from its renv:::ask() helper function. (For anyone besides renv, we error if menu() or readline() are called during startup)
Since we return "n" and that is not a supported option, the menu() call gets into an infinite loop, causing the crash.
To patch this old renv version, we could probably:
Continue to detect the renv.autoloader.running global option
Also detect if the buffer contains "What do you want to do?" and return "cancel" rather than "n" in that case, as that is specific to renv 1.0.1
It is worth noting that in renv 1.0.8 and above, we have totally fixed this problem by preventing renv from asking the user questions at all, thanks to rstudio/renv#1915.
So here's the state of things:
renv < 1.0.2, you get a crash, which we will try and patch if we can
renv 1.0.2 -> 1.0.7, you get the 1st image below, from our auto response of "n"
renv 1.0.8 and above, you get the 2nd image below, from renv knowing now to ask questions and instead tell the user to renv::restore()
The text was updated successfully, but these errors were encountered:
See #6344 (comment)
Reprex is to clone https://github.com/rladies/rladies.github.io and try and load it in Positron. Note that
activate.R
has pinned the renv version to 1.0.1 there, an old version.What follows is my analysis of the problem from #6344
I've determined that for @drmowinckels the problem is that rladies uses a fairly old version of renv in https://github.com/rladies/rladies.github.io/tree/main
The TLDR is that if you just bump the renv version from 1.0.1 -> 1.0.2 here, it will work again:
https://github.com/rladies/rladies.github.io/blob/5f58ce6faa66e27e24baffe2ede1c33f3e52d989/renv/activate.R#L5
(id encourage using
renv::upgrade()
to get all the way up to latest renv, you may have to do this from rstudio)(you will have to fully clean out the
renv/library/
if you've already restored before, you need to get renv to re-bootstrap itself)The long answer is that we have specific
patchessupport for renv to avoid letting renv ask the user questions at.Rprofile
time before ark is fully started up. We recognize when renv is running through a global option and return"n"
rather than showing an input prompt to the user, which lets renv return from itsrenv:::ask()
helper function. (For anyone besides renv, we error ifmenu()
orreadline()
are called during startup)The problem is that in renv 1.0.1 and below, renv didn't use
renv:::ask()
in this spot, it usedrenv:::menu()
, and that required that we return"cancel"
to this particular question 😢.https://github.com/rstudio/renv/blob/5dc2fc934867a1b34ec9d1c594dc57d3c9698650/R/load.R#L822
Since we return
"n"
and that is not a supported option, themenu()
call gets into an infinite loop, causing the crash.To patch this old renv version, we could probably:
renv.autoloader.running
global option"What do you want to do?"
and return"cancel"
rather than"n"
in that case, as that is specific to renv 1.0.1It is worth noting that in renv 1.0.8 and above, we have totally fixed this problem by preventing renv from asking the user questions at all, thanks to rstudio/renv#1915.
So here's the state of things:
"n"
renv::restore()
The text was updated successfully, but these errors were encountered: