-
Notifications
You must be signed in to change notification settings - Fork 13.4k
check-aux: test core, alloc, std in Miri #123506
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
Changes from all commits
7b89445
c0b564b
1242093
a986c0a
2408981
d0346c5
596908b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Disabling in Miri as these would take too long. | ||
#![cfg(not(miri))] | ||
#![feature(test)] | ||
|
||
extern crate test; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,36 @@ check-aux: | |
src/tools/cargo \ | ||
src/tools/cargotest \ | ||
$(BOOTSTRAP_ARGS) | ||
# Run standard library tests in Miri. | ||
# We use a 64bit little-endian and a 32bit big-endian target for max coverage. | ||
$(Q)BOOTSTRAP_SKIP_TARGET_SANITY=1 \ | ||
$(BOOTSTRAP) miri --stage 2 \ | ||
--target x86_64-unknown-linux-gnu,mips-unknown-linux-gnu \ | ||
library/core \ | ||
library/alloc \ | ||
--no-doc | ||
# Some doctests have intentional memory leaks. | ||
# Also, they work only on the host. | ||
$(Q)MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" \ | ||
$(BOOTSTRAP) miri --stage 2 \ | ||
library/core \ | ||
library/alloc \ | ||
--doc | ||
# In `std` we cannot test everything. | ||
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \ | ||
$(BOOTSTRAP) miri --stage 2 library/std \ | ||
--no-doc -- \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't add mips-unknown-linux-gnu here as I think std has much less code that depends on bitwidth or endianess, so the extra 10min CI time does not seem worth it. Instead we have the macOS and Windows checks below, as std does contain a lot of OS-specific code. (And it's a 32bit Windows so at least that kind of architecture is covered.) |
||
--skip fs:: --skip net:: --skip process:: --skip sys::pal:: | ||
$(Q)MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \ | ||
$(BOOTSTRAP) miri --stage 2 library/std \ | ||
--doc -- \ | ||
--skip fs:: --skip net:: --skip process:: --skip sys::pal:: | ||
# Also test some very target-specific modules on other targets. | ||
$(Q)MIRIFLAGS="-Zmiri-disable-isolation" BOOTSTRAP_SKIP_TARGET_SANITY=1 \ | ||
$(BOOTSTRAP) miri --stage 2 library/std \ | ||
--target aarch64-apple-darwin,i686-pc-windows-gnu \ | ||
--no-doc -- \ | ||
time:: sync:: thread:: env:: | ||
dist: | ||
$(Q)$(BOOTSTRAP) dist $(BOOTSTRAP_ARGS) | ||
distcheck: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that an okay approach to make the test shorter in Miri? The alternative would be more convoluted but would let the code look as before on the web view:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, especially given it's relatively isolated. Realistically I'm not convinced this example needs a huge length (100 elements or 100,000 is about equally bad if you're pushing a new stack frame per element, IMO, given that you might already be close to the end of the allowed stack when starting to execute).