rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

Remove R_LIBS_USER path placed in Renviron #186

Closed jozefhajnala closed 4 years ago

jozefhajnala commented 4 years ago

This PR proposes to remove the fixed R_LIBS_USER library path from the Renviron file.

The motivation is twofold

  1. It might be desirable for the users to be able to set the environment variable and have it recornized by R in the library paths as is the default behavior. Having it present in the Renviron file will however override the set environment variable, which is unexpected (unless the user studies the Dockerfile)
  2. Consistency with the r-base image which does not place a custom R_LIBS_USER into the Renviron file and therefore supports setting it as an evironment variable.

Example:

docker run --rm -it rocker/r-ver:3.4.4 bash

Inside the container:

Rscript -e ".libPaths()"
mkdir testlib
export R_LIBS_USER=testlib
# testlib will not be considered:
Rscript -e ".libPaths()"

If this change is desired, can be included it for all the relevant r-ver Dockerfiles.

riccardoporreca commented 4 years ago

@jozefhajnala, see #175 for a recent discussion around the topic and the corresponding PR #176. In particular, note that this is currently fixed only for the 3.6.1 and latest tags, but as pointed out in https://github.com/rocker-org/rocker-versioned/pull/176#issuecomment-555841048 it could possibly propagate to other tags.

jozefhajnala commented 4 years ago

@jozefhajnala, see #175 for a recent discussion around the topic and the corresponding PR #176. In particular, note that this is currently fixed only for the 3.6.1 and latest tags, but as pointed out in #176 (comment) it could possibly propagate to other tags.

Thanks @riccardoporreca, will read through the links, I completely missed those discussions.

cboettig commented 4 years ago

Thanks both!

I'd be happy for a PR to back-propagate the solution from #176, since I think that was basically a bugfix which we should have done all along (like we were already doing with plain R_LIBS.

I realize that is not the same as having no R_LIBS_USER set at all. I can see the argument for that but we should make sure we have no side effects from the change.

cboettig commented 4 years ago

Done in rocker/rocker-versioned2