Skip to content

Conversation

@Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented Nov 15, 2025

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:

--- 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

@rustbot
Copy link
Collaborator

rustbot commented Nov 15, 2025

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 15, 2025

r? @Kobzol

rustbot has assigned @Kobzol.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Mark-Simulacrum Mark-Simulacrum changed the title use rustc target metadata for build-manifest target lists Use rustc target metadata for build-manifest target lists Nov 15, 2025
}

fn collect_rustc_targets() -> RustcTargets {
let rustc_path = std::env::var("RUSTC").expect("RUSTC set");
Copy link
Member

@bjorn3 bjorn3 Nov 16, 2025

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mark-Simulacrum Mark-Simulacrum force-pushed the build-manifest-dynamic-targets branch from 4fc4226 to 7ee4357 Compare November 16, 2025 13:29
@rustbot
Copy link
Collaborator

rustbot commented Nov 16, 2025

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.

Copy link
Member

@Kobzol Kobzol left a 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.

View changes since this review

@Kobzol
Copy link
Member

Kobzol commented Nov 16, 2025

Also, should promote-release be updated to set the correct RUSTC path?

@Mark-Simulacrum
Copy link
Member Author

Also, should promote-release be updated to set the correct RUSTC path?

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

@Mark-Simulacrum Mark-Simulacrum force-pushed the build-manifest-dynamic-targets branch from 7ee4357 to bb1fcfc Compare November 16, 2025 15:45
@Kobzol
Copy link
Member

Kobzol commented Nov 16, 2025

Sorry, I didn't realize that promote-release will literally just run an already compiled binary, I was thinking of cargo run for some reason.

@Mark-Simulacrum Mark-Simulacrum force-pushed the build-manifest-dynamic-targets branch from bb1fcfc to 2fb86b4 Compare November 16, 2025 15:51
@Kobzol
Copy link
Member

Kobzol commented Nov 16, 2025

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 ToolTarget locally and it indeed won't work (unless the std is built for a different reason/bootstrap command), so ToolStd it is for the moment, I guess.

@rust-log-analyzer

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.
@Mark-Simulacrum Mark-Simulacrum force-pushed the build-manifest-dynamic-targets branch from 2fb86b4 to 1848322 Compare November 16, 2025 16:13
@Mark-Simulacrum
Copy link
Member Author

@bors r=Kobzol

@bors
Copy link
Collaborator

bors commented Nov 16, 2025

📌 Commit 1848322 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2025
bors added a commit that referenced this pull request Nov 16, 2025
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
@bors bors merged commit 6e2dce8 into rust-lang:main Nov 16, 2025
11 checks passed
@rustbot rustbot added this to the 1.93.0 milestone Nov 16, 2025
rust-timer added a commit that referenced this pull request Nov 16, 2025
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
```
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Nov 17, 2025
…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
@Mark-Simulacrum Mark-Simulacrum deleted the build-manifest-dynamic-targets branch November 17, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants