-
Notifications
You must be signed in to change notification settings - Fork 14k
Use rustc target metadata for build-manifest target lists #148983
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
Use rustc target metadata for build-manifest target lists #148983
Conversation
|
These commits modify compiler targets. |
| } | ||
|
|
||
| fn collect_rustc_targets() -> RustcTargets { | ||
| let rustc_path = std::env::var("RUSTC").expect("RUSTC 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.
How is this using the stage1 compiler rather than the bootstrap compiler? Doesn't bootstrap use the bootstrap compiler when building build scripts and proc macros for the host? I believe it checks for the presence of --target, which rustc --print=target-list doesn't have.
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.
Hm, I definitely see differences when editing the in-tree sources so I don't think that's the case? E.g., the diff above would be different if it was using the bootstrap compiler, it wouldn't reflect rustc_target changes made here.
I'll try to poke at bootstrap to see whether there's something possibly broken there in a different local configuration or something though.
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.
Ah, we only do that in Mode::Std: https://github.com/Mark-Simulacrum/rust/blob/7ee4357dd16d3b2170bfa7bbebfb51af08d31577/src/bootstrap/src/core/builder/cargo.rs#L1069
So this shouldn't be an issue here.
4fc4226 to
7ee4357
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
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.
This is really nice, thanks!
While reviewing this, I realized that This listing is updated by <https://github.com/rust-lang/generate-manifest-list> every 7 days. in build-manifest's README is outdated, could you remove it please?
Also it would be nice to add to the README that the list of supported targets is auto-generated from a stage1 rustc.
|
Also, should |
AFAIK, promote-release runs the binary, but build-manifest is never built outside of rust-lang/rust CI, so that shouldn't be necessary -- we depend on RUSTC being set correctly at build time only. Relevant code that extracts the binary: https://github.com/rust-lang/promote-release/blob/44a5f66b1e0b9d780a8737abcbe41587e952dbb0/src/build_manifest.rs#L32 |
7ee4357 to
bb1fcfc
Compare
|
Sorry, I didn't realize that promote-release will literally just run an already compiled binary, I was thinking of |
bb1fcfc to
2fb86b4
Compare
|
I don't have insight into the target modifications, but the bootstrap changes look good to me. Feel free to r=me once CI is green. EDIT: I tried |
This comment was marked as resolved.
This comment was marked as resolved.
This ensures that as long as the target metadata is updated to reflect the current state (tier 3 vs 1/2, host toolchain support), the manifest will also be updated. This avoids an extremely common 'oops' when we move targets between tiers. This mostly removes a bunch of tier 3 targets from manifests. I didn't spot check against produced artifacts but given that they are tier 3 it's probably reasonable to leave it as-is and bug reporters can fix the target metadata in rustc (or we can stop producing artifacts). Follow-up work would ideally lint the artifact list as part of nightly/beta/stable builds as well, but for now this is simple and hopefully removes at common source of extra PRs when modifying targets.
2fb86b4 to
1848322
Compare
|
@bors r=Kobzol |
Rollup of 7 pull requests Successful merges: - #148703 (Use `overflow_checks` intrinsic so `IterRangeFrom` yields MAX before panicking in debug) - #148881 (use `cfg_select!` to pick assembly in codegen test) - #148911 (Make flags from `*FLAGS*` (such as `RUSTFLAGS`) env. vars. have precedence over flags set by bootstrap) - #148914 (fix incorrect import in `std_detect` on `aarch64-unknown-openbsd`) - #148971 (Document Error::{new,other} as to be avoided in pre_exec) - #148983 (Use rustc target metadata for build-manifest target lists) - #148995 (add must_use to extract_if methods) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #148983 - Mark-Simulacrum:build-manifest-dynamic-targets, r=Kobzol Use rustc target metadata for build-manifest target lists This ensures that as long as the target metadata is updated to reflect the current state (tier 3 vs 1/2, host toolchain support), the manifest will also be updated. This avoids an extremely common 'oops' when we move targets between tiers. This mostly removes a bunch of tier 3 targets from manifests. I didn't spot check against produced artifacts but given that they are tier 3 it's probably reasonable to leave it as-is and bug reporters can fix the target metadata in rustc (or we can stop producing artifacts). Follow-up work would ideally lint the artifact list as part of nightly/beta/stable builds as well, but for now this is simple and hopefully removes at common source of extra PRs when modifying targets. Manifest list delta: ```diff --- old +++ new -host:i686-apple-darwin -host:mips-unknown-linux-gnu -host:mips64-unknown-linux-gnuabi64 -host:mips64el-unknown-linux-gnuabi64 -host:mipsel-unknown-linux-gnu -host:mipsisa32r6-unknown-linux-gnu -host:mipsisa32r6el-unknown-linux-gnu -host:mipsisa64r6-unknown-linux-gnuabi64 -host:mipsisa64r6el-unknown-linux-gnuabi64 -target:aarch64-unknown-hermit -target:aarch64-unknown-managarm-mlibc -target:aarch64-unknown-redox -target:amdgcn-amd-amdhsa -target:arm64e-apple-darwin -target:arm64e-apple-ios -target:arm64e-apple-tvos -target:armebv7r-none-eabi -target:armebv7r-none-eabihf -target:armv7s-apple-ios -target:bpfeb-unknown-none -target:bpfel-unknown-none -target:csky-unknown-linux-gnuabiv2 -target:csky-unknown-linux-gnuabiv2hf -target:i386-apple-ios -target:i586-unknown-redox -target:i686-apple-darwin -target:loongarch32-unknown-none -target:loongarch32-unknown-none-softfloat -target:m68k-unknown-linux-gnu -target:m68k-unknown-none-elf -target:mips-mti-none-elf -target:mips-unknown-linux-gnu -target:mips-unknown-linux-musl -target:mips64-unknown-linux-gnuabi64 -target:mips64-unknown-linux-muslabi64 -target:mips64el-unknown-linux-gnuabi64 -target:mips64el-unknown-linux-muslabi64 -target:mipsel-mti-none-elf -target:mipsel-unknown-linux-gnu -target:mipsel-unknown-linux-musl -target:mipsisa32r6-unknown-linux-gnu -target:mipsisa32r6el-unknown-linux-gnu -target:mipsisa64r6-unknown-linux-gnuabi64 -target:mipsisa64r6el-unknown-linux-gnuabi64 -target:riscv32gc-unknown-linux-gnu -target:riscv32im-risc0-zkvm-elf -target:riscv32ima-unknown-none-elf -target:riscv64gc-unknown-hermit -target:riscv64gc-unknown-linux-musl -target:riscv64gc-unknown-managarm-mlibc -target:sparc-unknown-none-elf -target:x86_64-unikraft-linux-musl -target:x86_64-unknown-hermit -target:x86_64-unknown-managarm-mlibc ```
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#148703 (Use `overflow_checks` intrinsic so `IterRangeFrom` yields MAX before panicking in debug) - rust-lang#148881 (use `cfg_select!` to pick assembly in codegen test) - rust-lang#148911 (Make flags from `*FLAGS*` (such as `RUSTFLAGS`) env. vars. have precedence over flags set by bootstrap) - rust-lang#148914 (fix incorrect import in `std_detect` on `aarch64-unknown-openbsd`) - rust-lang#148971 (Document Error::{new,other} as to be avoided in pre_exec) - rust-lang#148983 (Use rustc target metadata for build-manifest target lists) - rust-lang#148995 (add must_use to extract_if methods) r? `@ghost` `@rustbot` modify labels: rollup
This ensures that as long as the target metadata is updated to reflect the current state (tier 3 vs 1/2, host toolchain support), the manifest will also be updated. This avoids an extremely common 'oops' when we move targets between tiers.
This mostly removes a bunch of tier 3 targets from manifests. I didn't spot check against produced artifacts but given that they are tier 3 it's probably reasonable to leave it as-is and bug reporters can fix the target metadata in rustc (or we can stop producing artifacts).
Follow-up work would ideally lint the artifact list as part of nightly/beta/stable builds as well, but for now this is simple and hopefully removes at common source of extra PRs when modifying targets.
Manifest list delta: