-
Notifications
You must be signed in to change notification settings - Fork 34
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
lib path is not set correctly if it is also set in .Renviron #83
Comments
This is because we use profiles to override the readLines("~/.Renviron")
#> [1] "R_LIBS=~/R:/tmp/empty"
.libPaths()
#> [1] "/Users/gaborcsardi/R"
#> [2] "/private/tmp/empty"
#> [3] "/Library/Frameworks/R.framework/Versions/3.5/Resources/library"
.libPaths(.libPaths()[1])
.libPaths()
#> [1] "/Users/gaborcsardi/R"
#> [2] "/Library/Frameworks/R.framework/Versions/3.5/Resources/library"
f <- function() {
system("R -q -e '.libPaths()'", intern = TRUE)
}
f2 <- function() {
system("R --vanilla -q -e '.libPaths()'", intern = TRUE)
}
callr::r(f)
#> [1] "> .libPaths()"
#> [2] "[1] \"/Users/gaborcsardi/R\" "
#> [3] "[2] \"/Library/Frameworks/R.framework/Versions/3.5/Resources/library\""
#> [4] "> "
#> [5] "> "
callr::r(f2)
#> [1] "> .libPaths()"
#> [2] "[1] \"/Users/gaborcsardi/R\" "
#> [3] "[2] \"/private/tmp/empty\" "
#> [4] "[3] \"/Library/Frameworks/R.framework/Versions/3.5/Resources/library\""
#> [5] "> "
#> [6] "> " Created on 2018-10-24 by the reprex package (v0.2.1) |
Ideally, a callr call should re-create the exact same context in the subprocess, w.r.t. the library path settings. This means that callr should clean up after itself, by removing the fake profiles, as soon as it has loaded. This is possible in OTOH, this conservative behavior would make it really hard to work with private libraries if one have an |
See also #73. So, for practical reasons, we try to make sure that non-callr child processes of the child process inherit the same settings. This means that we have to be more aggressive setting Since |
See r-lib/revdepcheck#160
The text was updated successfully, but these errors were encountered: