MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #17609] Rscript.c looks for R home using RHOME env-var instead of R_HOME #6783

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

Rscript.c gets the r home path (runtime) by using the command getenv("RHOME") where I believe it should be using getenv("R_HOME") with the underscore. From poking around in the docs, it seems like RHOME is some older deprecated version of R_HOME.

This is line 200 of Rscript.c. It would just be a 1 character change, but I don't have SVN set up and don't really know how to use it.

This is only an issue when R_HOME is over-ridden in R, and some code ends up calling something like `system('...Rscript', ...). That Rscript system call will not respect the over-ridden R home with which that R session was started.


METADATA

MichaelChirico commented 4 years ago

Some comment below on this PR ('RHOME' -> 'R_HOME') in case it helps move it forward. To me this one looks like a bug - possibly due to some legacy code. (Disclaimer: I don't know the history of 'RHOME' and 'R_HOME' and why there was two in the first place.)

PACKAGE INSTALLATION:
\item The deprecated environment variable \env{RHOME} is no longer
set when a package is installed: use \env{R_HOME} instead (and
depend on \code{R (>= 2.9)} ).

PS. There's a comment in src/library/methods/R/SClasses.R reading "## see $RHOME/src/main/duplicate.c for the corresponding datatypes". Maybe that should be updated to use '$R_HOME/...' or just 'RHOME/...'?


METADATA

github-actions[bot] commented 4 years ago

NA


METADATA