-
Notifications
You must be signed in to change notification settings - Fork 356
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
Miri does not work with a sysroot built without cfg(miri) #3311
Comments
Can you explain why you need to compile libstd without |
I need the exact same libstd be used for compiling rustc against and to run miri with. Without |
Yes but it will definitely not work for some programs, and I'm not sure why we'd make any effort to keep it working even for hello-world. For example, panicking and backtraces have Miri-specific code. |
I agree with Ben, we can only reasonably support sysroots built with
Why?
Why doesn't it work? |
Cargo can't run on wasm32-wasi as spawning processes is not supported. cargo-miri fails for a similar reason and in addition there was some weird compilation error I didn't investigate. |
I would not expect to be able to run miri from within wasi. We should use cross compilation to run against wasi targets. If you want to run miri in a wasi environment, build a target libstd with cfg miri on a supported host and ship those binaries |
The sysroot that uses cfg(miri) is not the one that can be used to compile miri itself. |
My goal is to have a miri playground run entirely in the browser.
I used one with cfg(miri) disabled both for compiling miri against and to use as sysroot at runtime.
Getting that working is non-trivial. It doesn't mesh with bootstrap and outside of that, getting the exact same rustc version to do compilation with isn't easy (the output of the build does contain a rustc compiled to wasm, but cargo doesn't know how to use it) and it no longer has a simple |
I'm afraid an environment which can't even run cargo is too cursed for us to support. But as I said above, if it's just about "poll", that can land on its own merits. However you'll run into a bunch of other places in the sysroot that (need to) use |
Whichever rustc you use to build wasi miri should be used to build |
Also, |
But anyway, the discussion here now really is part of #722 (comment). It doesn't seem like there's anything being tracked separately? So let's close this. I guess we could track adding "poll" support, but then there are so many shims missing, it's not worth having an issue for each one of them. I guess that was your intent when you opened the issue, but then it got side-tracked based on the motivation you stated -- sorry for that. |
This is necessary to be able to use a libstd compiled without
cfg(miri)
, yet still with-Zalways-encode-mir
. In particular for #722 (comment) I had to use the same standard library as would be linked against for regular programs ascargo-miri
to build a new standard library with-Zalways-encode-mir
andcfg(miri)
doesn't work on wasm. Because the poll syscall is missing, I had to patch the standard library to never try the poll based fast path for detecting if all stdio fds are open.The text was updated successfully, but these errors were encountered: