Closed pnacht closed 3 years ago
You would need to set R_REMOTES_STANDALONE="true"
before running the update to ensure that no optional dependencies are loaded in the current R session.
See https://github.com/r-lib/remotes#environment-variables for documentation on this and other available environment variables.
For my education: why this isn't set by an argument to the function, instead of relying on an environment variable?
Or, even better, wouldn't it be possible to check the list of updates and, if a dependency is found, silently set standalone mode (or ask the user for permission)?
I unfortunately have no idea how to write an MWE for this, but I just ran
update_packages()
on a new session (no loaded packages). I had some 70+ packages to update, amongst them wascurl
.update_packages
managed to update many packages, but once it got tocurl
it failed, saying it was loaded. I assume this is because somecurl
method is called somewhere alongupdate_packages()
(though a quick glance at the source code found nothing), which therefore attaches the package to the environment and therefore fails the update.I am therefore forced to restart the session, update
curl
manually withinstall.packages("curl")
and then callupdate_packages()
again to update whatever is left.I used to run this command using
devtools::update_packages()
, and would get this issue with multiple packages (rlang
,vctrs
, etc). Now withremotes
it seems to have only been withcurl
(it's still running in the background).If my theory is correct, I'd understand if the issue is unavoidable. However, in that case I'd suggest removing
remote
's dependencies from the update list (so that it won't fail) and then sending the user a warning saying "Unable to updatecurl
, please reset your session and runinstall.packages("curl")
.