-
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
Bootstrap: Check validity of --target
and --host
triples before starting a build
#123546
Conversation
r? @onur-ozkan rustbot has assigned @onur-ozkan. Use |
This comment has been minimized.
This comment has been minimized.
For custom targets, which property do we check for the file specified by passing Also, the build currently fails, since I assumed for my local that the current working directory is the right path, I believe there must exist an environment variable for this rather than using |
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.
For custom targets, which property do we check for the file specified by passing --target argument?
If I understand correctly, we use this same flag for an existing target too, but instead of a name, we specify the file path?
RUST_TARGET_PATH
environment variable is reserved to be used for the custom targets.
a80463f
to
d6618d8
Compare
These commits modify compiler targets. |
This comment has been minimized.
This comment has been minimized.
d6618d8
to
70e6ffb
Compare
This comment has been minimized.
This comment has been minimized.
FWIW the current approach is entirely different from what Mark suggested here. |
70e6ffb
to
9a868cf
Compare
What are your thoughts on this:
|
This comment has been minimized.
This comment has been minimized.
We can add them (those not included from the stage0 yet) to a hard-coded list on bootstrap. |
Why do few of the tests have |
Those are just an alias for simulating targets to be used for some of the bootstrap tests. |
What would be the right approach to fix this, give the actual path rather than the alias? |
Those tests should remain the same; instead, we should find a way to skip the target name sanity check if it was given from the bootstrap tests. We don't need to check target names while testing bootstrap. |
In the |
9a868cf
to
c3062d5
Compare
8d62d99
to
59e210a
Compare
This comment has been minimized.
This comment has been minimized.
59e210a
to
ffdb04a
Compare
…tarting a build Resolves rust-lang#122128
ffdb04a
to
09c0768
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.
Some parts missing in this PR, but this looks good enough for now and I will do the rest in a follow-up PR later as they are not necessarily needed right now.
Thank you for the fixes and patience!
@bors r+ |
Thanks for the approval! 🦀 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6c90ac8): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.137s -> 674.338s (0.33%) |
let target_str = target.to_string(); | ||
|
||
let supported_target_list = | ||
output(Command::new(&build.config.initial_rustc).args(["--print", "target-list"])); |
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.
As I said on the associated issue, asking the bootstrap compiler is not correct when bootstrap doesn't know about a target yet, but the in-tree rustc does. You have to check if the target is listed in compiler/rustc_target/src/spec/mod.rs
.
Edit: Missed that this was already discussed in #123546 (comment).
…roalbini handle the targets that are missing in stage0 During sanity checks, we search for target names to determine if they exist in the compiler's built-in target list (`rustc --print target-list`). While a target name may be present in the stage2 compiler, it might not yet be included in stage0. This PR handles that difference. Follow-up of rust-lang#123546
Rollup merge of rust-lang#124461 - onur-ozkan:followup-123546, r=pietroalbini handle the targets that are missing in stage0 During sanity checks, we search for target names to determine if they exist in the compiler's built-in target list (`rustc --print target-list`). While a target name may be present in the stage2 compiler, it might not yet be included in stage0. This PR handles that difference. Follow-up of rust-lang#123546
Resolves #122128
As described in the issue, validating the
target
andhost
triples would save a lot of time before actually starting a build. This would also check for custom targets by looking for a valid JSON spec if the specified target does not exist in the supported list of targets.