-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
renv::update()
not using correct library
#2108
Comments
Thanks for the bug report. I think this behavior is expected... for example, if I use > renv::update()
- Checking for updated packages ... Done!
The following package(s) will be updated:
# CRAN -----------------------------------------------------------------------
- class [7.3-22 -> 7.3-23]
- cluster [2.1.6 -> 2.1.8]
- foreign [0.8-87 -> 0.8-88]
- KernSmooth [2.23-24 -> 2.23-26]
- MASS [7.3-61 -> 7.3-65]
- Matrix [1.7-1 -> 1.7-2]
- nlme [3.1-166 -> 3.1-167]
- nnet [7.3-19 -> 7.3-20]
- rpart [4.1.23 -> 4.1.24]
- spatial [7.3-17 -> 7.3-18]
- survival [3.7-0 -> 3.8-3]
Do you want to proceed? [Y/n]:
# Downloading packages -------------------------------------------------------
- Downloading KernSmooth from CRAN ... OK [101.5 Kb in 0.45s]
- Downloading MASS from CRAN ... OK [1.1 Mb in 0.28s]
- Downloading Matrix from CRAN ... OK [5.9 Mb in 0.33s]
- Downloading class from CRAN ... OK [95 Kb in 0.16s]
- Downloading cluster from CRAN ... OK [602.8 Kb in 0.46s]
- Downloading foreign from CRAN ... OK [334.1 Kb in 0.49s]
- Downloading nlme from CRAN ... OK [2.3 Mb in 0.27s]
- Downloading nnet from CRAN ... OK [122.2 Kb in 0.17s]
- Downloading rpart from CRAN ... OK [720.5 Kb in 0.24s]
- Downloading spatial from CRAN ... OK [152.7 Kb in 0.26s]
- Downloading survival from CRAN ... OK [8.4 Mb in 0.84s]
Successfully downloaded 11 packages in 5 seconds.
The following package(s) will be installed:
- class [7.3-23]
- cluster [2.1.8]
- foreign [0.8-88]
- KernSmooth [2.23-26]
- MASS [7.3-65]
- Matrix [1.7-2]
- nlme [3.1-167]
- nnet [7.3-20]
- rpart [4.1.24]
- spatial [7.3-18]
- survival [3.8-3]
These packages will be installed into "~/scratch/matrix-example/renv/library/macos/R-4.4/aarch64-apple-darwin20".
Do you want to proceed? [Y/n]:
# Installing packages --------------------------------------------------------
- Installing KernSmooth ... OK [installed binary and cached in 0.14s]
- Installing MASS ... OK [installed binary and cached in 0.27s]
- Installing Matrix ... OK [installed binary and cached in 0.19s]
- Installing class ... OK [installed binary and cached]
- Installing cluster ... OK [installed binary and cached]
- Installing foreign ... OK [installed binary and cached]
- Installing nlme ... OK [installed binary and cached in 0.1s]
- Installing nnet ... OK [installed binary and cached]
- Installing rpart ... OK [installed binary and cached]
- Installing spatial ... OK [installed binary and cached]
- Installing survival ... OK [installed binary and cached in 0.14s]
Successfully installed 11 packages in 1.7 seconds.
> find.package("Matrix")
[1] "/Users/kevin/scratch/matrix-example/renv/library/macos/R-4.4/aarch64-apple-darwin20/Matrix" In other words,
I think this is a reasonable default behavior, but the issue you note does mean that
|
We had some internal discussion and the consensus here is that having |
I could be misunderstanding how the code works, but the
library
path created here:renv/R/update.R
Line 268 in e641696
is never actually used later in the function.
The reason I bring this up is that I'm running into a situation where I run
renv::update()
and it attempts to update all packages installed in my global library instead of just my project library. It has to do with what is returned by.libPaths()
, which always returns a vector of size 2 - the project library and the global library path, no matter what I do (I've tried manually setting it).However, it seems like the issue I described would be irrelevant if the line I referenced above was what was used later on in the function instead of
libpaths
. Because thenth(libpaths, 1)
would return the project library instead of bothThe text was updated successfully, but these errors were encountered: