-
Notifications
You must be signed in to change notification settings - Fork 350
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_NO_STD can lead to very confusing errors #3529
Comments
Amusingly, |
Rollup merge of rust-lang#124582 - RalfJung:std-not-found, r=Nilstrieb always print nice 'std not found' error when std is not found Fixes rust-lang/miri#3529 Arguably Miri is doing something odd by letting people create no-std sysroots for arbitrary targets -- but equally arguably, there's no good reason for rustc to special-case the host triple here. Being a non-host triple does not imply the target is a no-std target, after all.
Somehow rust-lang/rust#124582 did not help, this still prints the same bad error. I don't know why things behave different for the host target vs anther target. |
Ah, the issue arises when first doing I think that's good enough for now; though if MIRI_NO_STD keeps confusing people maybe we should entirely remove it. |
To reproduce, consider the following crate:
with
main.rs
beingIt turns out
panic_semihosting
actually needsstd
on targets that do not satisfyall(target_arch = "arm", target_os = "none")
.When running this with a truly no-std target such as
x86_64-unknown-none
, this is very clear from the error:However, when one does
MIRI_NO_STD=1 cargo miri run
to run this without std on a target that has std, the error is pretty bad:I don't know exactly why that is. But my current inclination is to just remove the MIRI_NO_STD env var; it shouldn't be needd as
-none
targets get built without std automatically...The text was updated successfully, but these errors were encountered: