-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve test suite for -Zbuild-std
#7350
Conversation
r? @ehuss (rust_highfive has picked a reviewer for you, use r? to override) |
5c21b64
to
0c8631b
Compare
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.
Nice! It's a bit elaborate, but is pleasantly fast.
Will this still work if we switch cargo to create its own sysroot? I assume we'd just remove the line that adds --sysroot
.
r=me with the above addressed, and if you're comfortable moving forward.
I'm curious to get a bit more of your feeling on this, is this maybe too elaborate? I stared with a blank slate and basically just kept hitting "compile" and filled out all the dependencies and I'm not sure how we'd simplify this much more though without broader changes to rustc/cargo, which I'm pretty unwilling to do just for the sake of tests.
I believe so yeah, I made sure that the tests currently do |
Eh, I think the only concern is the maintenance burden going forward, updating it to match upstream as needed. I suspect the rate of change should be small, so I don't think it is too much of a problem. If the tests end up being fussy or break often, we can rethink it later if needed. Otherwise it will just be a directory full of files nobody will ever need to look at. |
Ok that sounds good. If this is hard to manage then let's deal with it then. |
0c8631b
to
dfa61e5
Compare
Ok I've pushed up what I'm thinking for a full integration test doing everything, want to double check me @ehuss? |
Looks like the |
affe70a
to
a1da038
Compare
Ok green now! |
☔ The latest upstream changes (presumably #7360) made this pull request unmergeable. Please resolve the merge conflicts. |
a4184c4
to
f2e6a04
Compare
☔ The latest upstream changes (presumably #7159) made this pull request unmergeable. Please resolve the merge conflicts. |
This commit is aimed directly at rust-lang/wg-cargo-std-aware#33 and in general making the `-Zbuild-std` tests more robust. The main change here is that a new source tree is checked in, `tests/testsuite/mock-std`, which mirrors rust-lang/rust's own tree for libstd. This mock tree is as empty as it can be, ideally duplicating almost nothing but for not requiring duplication of Cargo metadata about patches and such. The end result here looks like: * All `-Zbuild-std` tests are now run in parallel * All tests run much more quickly since they're compiling tiny crates instead of actually compiling libstd/libcore * No tests require network access * We verify that crates have access to the "custom" libraries that we build Coverage of tests is not currently expanded, but it's hoped that we could add that shortly afterwards. Coverage has actually gone down slightly since the custom target test was commented out temporarily and the full integration test of running `-Zbuild-std` isn't run on CI any more. Closes rust-lang/wg-cargo-std-aware#33
Extract out all our test support code to its own standalone crate so it can be shared between multiple test suites if necessary.
Only run these tests on one CI builder (not all platforms) though. This is extremely resource intensive since it rebuilds libstd. Currently this does not share a build directly like before because the number of tests are supposed to be small, but if necessary we can add that in later too.
f2e6a04
to
2180c18
Compare
2180c18
to
ebd1052
Compare
@bors r+ |
📌 Commit ebd1052 has been approved by |
Improve test suite for `-Zbuild-std` This commit is aimed directly at rust-lang/wg-cargo-std-aware#33 and in general making the `-Zbuild-std` tests more robust. The main change here is that a new source tree is checked in, `tests/testsuite/mock-std`, which mirrors rust-lang/rust's own tree for libstd. This mock tree is as empty as it can be, ideally duplicating almost nothing but for not requiring duplication of Cargo metadata about patches and such. The end result here looks like: * All `-Zbuild-std` tests are now run in parallel * All tests run much more quickly since they're compiling tiny crates instead of actually compiling libstd/libcore * No tests require network access * We verify that crates have access to the "custom" libraries that we build Coverage of tests is not currently expanded, but it's hoped that we could add that shortly afterwards. Coverage has actually gone down slightly since the custom target test was commented out temporarily and the full integration test of running `-Zbuild-std` isn't run on CI any more. Closes rust-lang/wg-cargo-std-aware#33
☀️ Test successful - checks-azure |
This commit is aimed directly at rust-lang/wg-cargo-std-aware#33 and in
general making the
-Zbuild-std
tests more robust. The main change hereis that a new source tree is checked in,
tests/testsuite/mock-std
,which mirrors rust-lang/rust's own tree for libstd. This mock tree is as
empty as it can be, ideally duplicating almost nothing but for not
requiring duplication of Cargo metadata about patches and such.
The end result here looks like:
-Zbuild-std
tests are now run in parallelinstead of actually compiling libstd/libcore
that we build
Coverage of tests is not currently expanded, but it's hoped that we
could add that shortly afterwards. Coverage has actually gone down
slightly since the custom target test was commented out temporarily and
the full integration test of running
-Zbuild-std
isn't run on CI anymore.
Closes rust-lang/wg-cargo-std-aware#33