-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add unstable option to ignore should_panic tests #58689
Conversation
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
r? @oli-obk |
To just satisfy Miri's needs, all we need to do is use the existing |
It was the first experiment tried, but I agree about the complexity, which is why I posted an alternative in #58689 (comment) It would only use the ShouldPanic enum and wouldn’t need a miri specific cfg. |
I've seen that, but that still adds a new option
If, OTOH, you think that option is also useful outside of Miri, then this seems fine. |
I understand your reservations, as it seems like the option would be niche outside of this. One possible advantage for miri is that since the option does not require further changes to libtest, it could be useful for testing when the time comes to support panics and unwinding. The flag idea was proposed by oli-obk, so I rolled with it (unless if I misunderstood).
The new flag can be passed to cargo similar to include-ignored
or in the case of cargo miri,
which could be passed by default by |
I suppose that works. I'll leave it up to you to decide whether it makes sense to carry that extra flag just for Miri, or whether it has more general use. I think we'll have no trouble testing the panic/unwinding story without this, when the time comes for Miri to support that. |
That’s good to hear. Thank you for the review, Ralf :)
I would like to first hear oli’s thoughts on the current changes. It’s possible I’ve made more than they expected too. |
I did indeed have the current changes in mind, but I agree with @RalfJung, if there's a simpler option, let's use that.
that won't work, libtest is never compiled with |
It is. However, I think it is NOT set inside rustbuild when we run the Miri test suite there... |
|
Running |
Also, without full MIR, you can't run tests anyway ;) So you do need
we already have the |
We could, but do we want to? This means that with that flag set, all should_panic tests will get skipped, even when not run in Miri. That seems wrong. |
hm. true. Ok, so... we roll with this PR and undo it once miri can do unwinding? |
I looked into it more and saw that compiletest and the extracted compiletest-rs crate depend on libtest's Before going further, I would like to try out ralf's suggestion locally and see if it sorts the original issue. (unless if the cli flag is preferred after all for the rustbuild/bootstrap case) |
Basically this would be a hack to make Miri somewhat more useful, but we'd have to be careful that we don't ever set Having a So I think I have come around to the conclusion that such a flag actually might make some sense. But then ignored tests should be treated just like those marked
AFAIK the extracted crate carries a copy of this, so this should be fine from a toolstate perspective. |
All the embedded targets that are panic=abort and I'm familiar with are |
@rust-lang/infra recently discussed issues with panics on Android and disabling |
It would be huge for the infra team if this is merged! |
@bors r+ This is the design I envisioned, seems to be the least surprising or least error prone solution we came up with. Additionally being useful to more than just miri makes the slight additional complexity acceptable |
📌 Commit 43e7434 has been approved by |
@bors p=1 Needed to fix a spurious failure. |
…=oli-obk Add unstable option to ignore should_panic tests Add an unstable option `--exclude-should-panic` to libtest to workaround rust-lang/miri#636 ?r @oli-obk cc @RalfJung
Seemed to cause failure in #58820 on WASM.
|
Add unstable option to ignore should_panic tests Add an unstable option `--exclude-should-panic` to libtest to workaround rust-lang/miri#636 ?r @oli-obk cc @RalfJung
☀️ Test successful - checks-travis, status-appveyor |
Tested on commit rust-lang/rust@7b4f8f9. Direct link to PR: <rust-lang/rust#58689> 💔 miri on windows: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra). 💔 miri on linux: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
Seems like I was wrong thinking that compiletest-rs carries copies of these structs. Oh well. |
Fix build with the master rust-lang/rust#58689 broke compiletest.
Add an unstable option
--exclude-should-panic
to libtest to workaround rust-lang/miri#636?r @oli-obk
cc @RalfJung