-
Notifications
You must be signed in to change notification settings - Fork 216
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
Support running cargo miri
in situations where target != host (e.g. "cross-interpretation")
#698
Comments
Hm, I guess I did something wrong here, since it says I added wontfix. I didn't mean to. If it's just github being weird, can I get some justification there? EDIT: I see what happened. I missed the small link to not use the templat on the "new issue" page, so just started with the "plz add my crate" template and deleted it and started fresh. Unfortunately, That template also has you add a wontfix to your own issue. |
Yeah, you'd be surprised at how many people don't read the template before opening an issue. |
Does |
You don't even need to have the target installed. The docs don't tell you to install a target and I never said so either when advertising this feature, so I wonder how this implicit assumption crept in.^^
Yes (but this also happens automatically when needed). |
Ah, good point... but in principle we could use similar infrastructure for both of these kinds of flags. |
If I'm understanding you correctly, that'd be a bad thing on the playground, as the setup we do now takes ~150 seconds which would blow far past the request timeout of 10 seconds. To make sure we are on the same page, what do you think the timing of each of these commands would be if run sequentially?
|
Yeah, it'd probably be way too long.
On a "x86_64-unknown-linux-gnu" host I assume? The last command doesn't benefit from the previous ones, it builds a new standard library, which takes around 50-60s on my system. |
So to make this performant, we'd need to do this when pre-building the container:
Once for each playground-supported target. Does that sound correct? |
Yes, that sounds right. However, don't you also need to pre-build the dependencies? So you can just do |
Maybe, I dunno! I assume that's changed over time and the build has never been updated since it worked: |
Yeah the |
The playground has the ability to run code under miri, but it would nice to be able to choose other targets.
A somewhat unknown (but highly useful) feature of miri is that it can run as a cross-interpreter. That is, even on x86_64-apple-darwin (or whatever), if I have, say the
powerpc-unknown-linux-gnu
target installed, I can do:and it will simulate running the test on that architecture, including emulating 32-bit big-endian linux (well, the set of linux syscalls that miri supports, anyway).
Right now I can't do this on the playground, and it would be useful to do quick checks and examples of big-endian code.
The downside is needing UI for this, and needing to
rustup target add
on the playground servers. So I understand some hesitancy.Personally, I think it's most valuable for targets that are very different than x86_64 — e.g. I feel like just saying having an option for big-endian 32 and 64 bit targets would be good enough.
(It would be nice to also have one for target_pointer_width="16", like
msp430-*
oravr-*
, but these being no_std only, it's hard enough to actually run the code that users probably should just do it locally)Anyway, I thought I'd mention it. I kind of suspect it's the kind of "that'd be nice but doing it in a non-hacky way is likely not worth the effort" thing, but figured I'd suggest anyway. No worries if you'd rather wontfix this.
Note that this is related to #446, but not the same, as --target isn't a RUSTFLAG (or a MIRIFLAG), its a flag for cargo.
The text was updated successfully, but these errors were encountered: