Skip to content

Commit

Permalink
Send R script R_HOME warning to stderr
Browse files Browse the repository at this point in the history
Follow-up to #367. Redirecting the wasm R and Rscript to the host binaries
works, but R_HOME is no longer as expected. A warning about this is printed
to `stdout`, breaking subcommands and pipes when cross-compiling R packages
that run R or Rscript in e.g. Makevars.

This change redirects that warning to `stderr`.

See also https://bugs.r-project.org/show_bug.cgi?id=15070
  • Loading branch information
georgestagg committed Mar 13, 2024
1 parent 263f258 commit 836ab15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/R-4.3.3/emscripten-r-home-stderr.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: R-4.3.3/src/scripts/R.sh.in
===================================================================
--- R-4.3.3.orig/src/scripts/R.sh.in
+++ R-4.3.3/src/scripts/R.sh.in
@@ -28,7 +28,7 @@ if test -n "${R_HOME}" && \

if test -n "${R_HOME}" && \
test "${R_HOME}" != "${R_HOME_DIR}"; then
- echo "WARNING: ignoring environment value of R_HOME"
+ echo "WARNING: ignoring environment value of R_HOME" >&2
fi
R_HOME="${R_HOME_DIR}"
export R_HOME
1 change: 1 addition & 0 deletions patches/R-4.3.3/series
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ emscripten-xhr-download.diff
emscripten-disable-bcEval.diff
emscripten-fix-blas-dlsym-search.diff
emscripten-avoid-testing-issues.diff
emscripten-r-home-stderr.diff
fix-signrank-wilcox.diff
fix-devUp.diff
flang-avoid-maxloc.diff
Expand Down

0 comments on commit 836ab15

Please sign in to comment.