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

What is the "rustc_binary.wasm" file? #11

Closed
RealSput opened this issue Jan 28, 2023 · 11 comments
Closed

What is the "rustc_binary.wasm" file? #11

RealSput opened this issue Jan 28, 2023 · 11 comments

Comments

@RealSput
Copy link

Hello,
I am looking for the "rustc_binary.wasm" file, but could not find it anywhere. Where could I find it?
Thanks

@bjorn3
Copy link
Owner

bjorn3 commented Jan 28, 2023

This is a version of rustc I compiled to wasm using several patches. I only have the file locally. I can share it, but I lost the associated sysroot at some point, so I'm not sure how useful it would be.

@RealSput
Copy link
Author

I would be happy if you could share it. I have attempted to compile it but it always errors, e.g the wasm32_unknown_wasi target wasn't found.

@bjorn3
Copy link
Owner

bjorn3 commented Jan 28, 2023

rust-lang/miri#722 has the rough procedure necessary for compiling, but it's been a while so things probably changed. In any case here is the compressed file: rustc_binary.wasm.gz If I recall correctly it uses https://github.com/bjorn3/rustc_codegen_cranelift/ as codegen backend, but as I don't recall which commit I built it from, I don't think it will be easy to find the right version of the standard library to build. I believe I patched out the version check, but compiling the standard library with a version that deviates too much will cause crashes or other weird behavior.

@RealSput
Copy link
Author

I couldn't find how to compile it, could you link me to a comment (or multiple) with instructions? I still get the target "wasm32_unknown_wasi" not found error.

@bjorn3
Copy link
Owner

bjorn3 commented Jan 28, 2023

Roughly rust-lang/miri#722 (comment). It will need changes to adapt to rustc changes that happened since, but I don't knpw which changes exactly.

@RealSput
Copy link
Author

I now get this error:

error: toolchain `66ec64ccf31883cd2c28d045912a76179c0c6ed2` doesn't exist in any channel

How could it be fixed?

@bjorn3
Copy link
Owner

bjorn3 commented Jan 29, 2023

CI artifacts for arbitrary commits are only kept for a limited period. You can either build that commit yourself or try to update the instructions for a newer version. I can't help further in the near future unfortunately.

@bjorn3
Copy link
Owner

bjorn3 commented Jun 9, 2023

Fixed the rustc example in #28 and provided a precompiled rustc wasm executable at rust-lang/miri#722 (comment).

@bjorn3
Copy link
Owner

bjorn3 commented Jun 9, 2023

Closing as there is now a working precompiled rustc wasm executable available.

@bjorn3 bjorn3 closed this as completed Jun 9, 2023
@RealSput
Copy link
Author

RealSput commented Jun 9, 2023

Closing as there is now a working precompiled rustc wasm executable available.

Where?

@bjorn3
Copy link
Owner

bjorn3 commented Jun 9, 2023

rust-lang/miri#722 (comment) contains the links.

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

No branches or pull requests

2 participants