r-wasm / webr

The statistical language R compiled to WebAssembly via Emscripten, for use in web browsers and Node.
https://docs.r-wasm.org/webr/latest/
Other
848 stars 67 forks source link

Install Rust toolchnain #358

Closed yutannihilation closed 7 months ago

yutannihilation commented 7 months ago

Fix https://github.com/r-wasm/rwasm/issues/20

This pull request adds two things:

  1. Install the nightly Rust toolchain and wasm32-unknown-emscripten target
  2. Install fake DEB packages of rustc and cargo in order to prevent another Rust toolchain from being installed via apt.

The second point is optional, so if you prefer not adding this, I'll remove.

You can inspect the docker image built from this Docker file by:

docker pull ghcr.io/yutannihilation/webr-rust:main

(I'm rebuilding the image at the time of creating this pull request as I tweaked some orders. I think the change won't matter, but just for making sure...) done!

``` $ docker manifest inspect ghcr.io/yutannihilation/webr-rust:main | grep size "size": 4393, "size": 30439111, "size": 629569132, "size": 718266714, "size": 32, ``` = 1.38GB
georgestagg commented 7 months ago

Thanks again for this!

yutannihilation commented 7 months ago

Thank you!

By the way, do you know when this propagates to R-universe? I want to confirm Rust-powered R packages get successfully built on R-universe, but it seems the image is not built so often.

https://github.com/r-universe-org/build-wasm/pkgs/container/build-wasm/versions

georgestagg commented 7 months ago

By the way, do you know when this propagates to R-universe?

I don't, sorry. It will depend on when they update the Docker image in their build infrastructure.

yutannihilation commented 7 months ago

I see, thanks. I'll ask on https://github.com/r-universe-org/help.

yutannihilation commented 7 months ago

It works on R-universe now! 🎉

https://github.com/r-universe-org/help/issues/325#issuecomment-1953983242