Skip to content

bootstrap: always propagate CARGO_TARGET_{host}_LINKER#152077

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cuviper:bootstrap-host-linker
Feb 9, 2026
Merged

bootstrap: always propagate CARGO_TARGET_{host}_LINKER#152077
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
cuviper:bootstrap-host-linker

Conversation

@cuviper

@cuviper cuviper commented Feb 4, 2026

Copy link
Copy Markdown
Member

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

rustbot commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

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

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+ rollup=iffy

@rust-bors

rust-bors Bot commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

📌 Commit cdd0ede has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Feb 8, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 8, 2026
…ark-Simulacrum

bootstrap: always propagate `CARGO_TARGET_{host}_LINKER`

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.
rust-bors Bot pushed a commit that referenced this pull request Feb 8, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #151869 (add test for codegen of SIMD vector from array repeat)
 - #152077 (bootstrap: always propagate `CARGO_TARGET_{host}_LINKER`)
 - #126100 (Reword the caveats on `array::map`)
 - #152275 (Stop having two different alignment constants)
 - #152325 (Remove more adhoc groups that correspond to teams)
@rust-bors rust-bors Bot merged commit 120b188 into rust-lang:main Feb 9, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 9, 2026
rust-timer added a commit that referenced this pull request Feb 9, 2026
Rollup merge of #152077 - cuviper:bootstrap-host-linker, r=Mark-Simulacrum

bootstrap: always propagate `CARGO_TARGET_{host}_LINKER`

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.
@cuviper cuviper deleted the bootstrap-host-linker branch June 1, 2026 15:58
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants