-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix x test compiler
unit tests under rust.parallel-compiler = true
#130345
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
I would also like to add some testing of this to CI so that it doesn't regress, but it seems easier to pursue that as a separate step. |
[features] | ||
# tidy-alphabetical-start | ||
rustc_use_parallel_compiler = [ | ||
'rustc_data_structures/rustc_use_parallel_compiler', | ||
'rustc_errors/rustc_use_parallel_compiler', | ||
'rustc_middle/rustc_use_parallel_compiler', | ||
] | ||
# tidy-alphabetical-end |
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.
Disclosure: x test tidy
doesn't seem to actually enforce alphabetical ordering of these sub-lists, so the alphabetical check only applies to the top-level features.
#[cfg_attr(bootstrap, doc = "```ignore")] | ||
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")] |
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.
Thanks to Boxy for helping me figure out how to actually do this. ✨
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.
Unfortunately we have multiple checks using hand-rolled parsers that don't understand this pattern, so I've had to “fix” one and trick the other.
This comment has been minimized.
This comment has been minimized.
00e0042
to
0ad5711
Compare
This comment has been minimized.
This comment has been minimized.
These changes can be reverted during the next bootstrap bump.
This fixes `x test compiler` under `rust.parallel-compiler = true`.
0ad5711
to
0e3cb54
Compare
Hmm, or maybe we should just make the rayon dependency unconditional and sidestep the whole feature mess, as multiple people have suggested. @rustbot author |
When running unit tests in
compiler
, bootstrap dutifully enables therustc_use_parallel_compiler
feature for the target crate, but that feature isn't automatically propagated to dependencies. That results in various bogus failures, such as crates depending onrustc_data_structures
being unable to find rayon.The fix is to add a
rustc_use_parallel_compiler
feature to more compiler crates, and forward it to the appropriate dependencies. We already have some of this, which is why the unit tests work in CI, but these changes restore the ability to unit-test individual compiler crates from the command line.As a related bonus, this PR also conditionally ignores some doctests that are incompatible with the stage 0 compiler, because they rely on behaviour that hasn't made its way to beta yet.