-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Run Miri and mir-opt tests without a target linker #119035
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So
self.crates
is entirely ignored whenis_for_mir_opt_tests
is set?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.
Yes; as far as I understand
crates
is the crates you're asking to build explicitly. For example when you runx build library/core
crates
is["core"]
. When we're building (possibly cross-compiling) a sysroot for mir-opt tests, the only thing it makes sense to build isstd
and all of its dependencies; attempting to select any other set would be unnecessary if you're explicitly requestinglibrary/test
, or insufficient to build some of the mir-opt tests if you tried to request onlycore
.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.
What about the "proc_macro" crate?
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.
That's handled down here: https://github.com/rust-lang/rust/pull/119035/files#diff-675065335a90de4a4e1ac5bc0a078709f865ff2d357ba2650309f0ad8614b1d3R1620-R1621
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.
And somehow it also works for Miri... 🤷 whatever, as long as CI is happy.^^ I just hope I won't have to debug this, the bootstrap logic is getting more and more messy it feels like.
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.
Miri doesn't use this code path, the only change for Miri is how we detect that we should disable the target sanity check.
The logic here is complicated mostly because the mir-opt tests cannot reuse Miri's technique for building a MIR-only sysroot because of this call:
rust/compiler/rustc_mir_transform/src/inline/cycle.rs
Line 76 in 090d5ea
libstd.so
. So we need a normal build but one that disables the dylib crate-type forstd
, andcargo rustc --crate-type
seems to be the only option and also designed for this based on the RFC.I agree that the code is rather complicated, but I think that reflects our overall poor support for cross compilation as opposed to being new complexity. And I'm volunteering to help maintain this sort of code; I understand it now that I've worked on it a bit.