-
Notifications
You must be signed in to change notification settings - Fork 182
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
Custom definition of R_LIBS
#857
Comments
Steps to reproduce:
In container, run
In R console, run
After removing
as expected. |
@cboettig Any idea? |
Right, so this follows conventions I think Dirk originally established with debian's r-base (Note @eddelbuettel is both rocker maintainer and a debian mantainer), and he can probably explain better. Note the permissions -- the default user is added to Of course users are free to override the R_LIBS env to whatever they want, e.g. in In containerized setups these days it's also still a common pattern that even user-permission installs go in a system path 'below' home (the Jupyter project uses |
As I read it the issue here seems to be the reordered path, ie why > .libPaths()
[1] "/usr/local/lib/R/site-library"
[2] "/usr/local/lib/R/library"
[3] "/home/mm/R/x86_64-pc-linux-gnu-library/4.4" per #857 (comment) by @michaelmayer2 above. We usually put the user PATH first: edd@rob:~/git$ docker run --rm -ti rocker/r-base bash
root@57eb7eafca96:/# useradd -s /bin/bash -m dirk
root@57eb7eafca96:/# su - dirk
dirk@57eb7eafca96:~$ Rscript -e '.libPaths()'
[1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
[3] "/usr/lib/R/library"
dirk@57eb7eafca96:~$ mkdir -p R/x86_64-pc-linux-gnu-library/4.4
dirk@57eb7eafca96:~$ Rscript -e '.libPaths()'
[1] "/home/dirk/R/x86_64-pc-linux-gnu-library/4.4"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
dirk@57eb7eafca96:~$ |
Thanks @eddelbuettel for your input - So we seem to have a different behaviour when comparing
|
Thank you. Is anyone interested in a fix for this? |
@michaelmayer2 would you be interested in making a PR for this? matching the |
Container image name
rocker/r-ver:4.4.0
Container image digest
sha256:73adabf378930f8744f56bac1fe5e99870532eb4ced1a15075991bac909d21f3
What operating system related to this question?
Linux
System information
Question
I am curious why you added
rocker-versioned2/scripts/install_R_source.sh
Line 149 in 92e20d2
Renviron.site
. According to the R documentation, the presence ofsite-library
in${R_HOME}/site-library
alone will add this tolibPaths()
(cf. https://stat.ethz.ch/R-manual/R-devel/library/base/html/libPaths.html "First, .Library.site is initialized from R_LIBS_SITE. If this is unset or empty, the ‘site-library’ subdirectory of R_HOME is used. Only directories which exist at the time of initialization are retained. Then, .libPaths() is called...").I have recently seen a case where the current definition of
R_LIBS
inRenviron.site
in the docker image leads to the behaviour of.libPaths()
listing the folders in reverse order (i.e.R_LIBS_USER
the last) which makes package installations usinginstall.packages()
impossible (unless you really set target.libPaths()
manually.I am sure there is valid reason for your approach to
Renviron.site
- just curious to understand the history of it.The text was updated successfully, but these errors were encountered: