I cleaned up a pure javascript wasi shim for in the browser I wrote a while back: https://github.com/bjorn3/browser_wasi_shim It is far from feature complete, but it is able to run programs that don't interface with the os too much, like a rustc compiled to wasi.
out of curiosity, how did you get rustc working on wasi? I was under the impression that basically the first thing rustc does is spawn a thread where the real work is done and that trying to make rustc use just the main thread would be quite difficult
would be great to add rustc
as a benchmark to sightglass
making rustc use the main thread is a matter of removing a thread::spawn
. making it work on the main thread soundly when running more than 1 compilation session is less easy, but this only runs a single compilation session, so it is fine.
as for the how to patch it exactly see https://github.com/rust-lang/miri/issues/722#issuecomment-819831196. The only difference in my case is that the rustc is older and I used cg_clif instead of miri. At one point I had a matching sysroot and was able to compile a hello world to x86_64 excluding linking, but I deleted it it seems.
This is cool, thanks for posting this!
Last updated: Nov 22 2024 at 17:03 UTC