Skip to content
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

Redirect $(WASM)/lib/R/bin JS binaries to use native R #367

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

georgestagg
Copy link
Member

The binaries built by Emscripten in $(WASM)/lib/R/bin are JavaScript output, unable to be run directly by the host machine. Such binaries can be run using Node, but require some further setup (e.g. relocation of the required R.wasm file).

Since these scripts do not work when executed directly, Makevars targets relying on running R code using $(R_HOME)/bin/R fail. The symbols.rds target in lib/share/make/shlib.mk is an example of this issue.

With this commit, these specific scripts are redirected to use the version of R compiled for the host machine, working around the problem.

This should hopefully fix r-wasm/rwasm#13.

The binaries built by Emscripten in $(WASM)/lib/R/bin are JavaScript
output, unable to be run directly by the host machine. Such binaries can
be run using Node, but require some further setup (e.g. relocation of
the required `R.wasm` file).

Since these scrips do not work, Makevars targets relying on executing
R code using `$(R_HOME)/bin/R` fail. The `symbols.rds` target in
`lib/share/make/shlib.mk` is an example.

With this commit, these specific scripts are redirected to use the
version of R compiled for the host machine, working around the issue.
@georgestagg georgestagg merged commit b83a88f into main Feb 28, 2024
2 checks passed
@georgestagg georgestagg deleted the redirect-lib-bin branch February 28, 2024 14:22
georgestagg added a commit that referenced this pull request Mar 13, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in make symbols.rds causes duckdb to fail
1 participant