Skip to content

bootstrap: always propagate CARGO_TARGET_{host}_LINKER#152077

Open
cuviper wants to merge 1 commit intorust-lang:mainfrom
cuviper:bootstrap-host-linker
Open

bootstrap: always propagate CARGO_TARGET_{host}_LINKER#152077
cuviper wants to merge 1 commit intorust-lang:mainfrom
cuviper:bootstrap-host-linker

Conversation

@cuviper
Copy link
Member

@cuviper cuviper commented Feb 4, 2026

We were already setting CARGO_TARGET_{target}_LINKER when there is a
setting in bootstrap.toml, and when the host and target are the same,
this is also used for build scripts and proc-macros.

However, the host value wasn't set when building for any other target,
and Cargo would see that as a fingerprint change for those build
artifacts, rebuilding them.

If we always set the CARGO_TARGET_{host}_LINKER, then those build
scripts will keep a consistent Cargo fingerprint, so they'll remain
cached no matter how we're alternating targets.

We were already setting `CARGO_TARGET_{target}_LINKER` when there is a
setting in `bootstrap.toml`, and when the host and target are the same,
this is also used for build scripts and proc-macros.

However, the host value wasn't set when building for any other target,
and Cargo would see that as a fingerprint change for those build
artifacts, rebuilding them.

If we always set the `CARGO_TARGET_{host}_LINKER`, then those build
scripts will keep a consistent Cargo fingerprint, so they'll remain
cached no matter how we're alternating targets.
@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) labels Feb 4, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 4, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants