Skip to content

remap OUT_DIR paths to fix build script path leakage in crate metadata. #155935

Open
paradoxicalguy wants to merge 2 commits intorust-lang:mainfrom
paradoxicalguy:fix-out-dir-remap
Open

remap OUT_DIR paths to fix build script path leakage in crate metadata. #155935
paradoxicalguy wants to merge 2 commits intorust-lang:mainfrom
paradoxicalguy:fix-out-dir-remap

Conversation

@paradoxicalguy
Copy link
Copy Markdown
Contributor

problem:

  • build script outputs (OUT_DIR) leak absolute paths into crate metadata causing non-determinism across identical builds.
  • bootstrap remaps source paths (self.build.src) and registry sources but doesn't not remap self.build.out used by OUT_DIR

fix:

  • adding --remap-path-prefix for self.build.out , mapping it to a stable virtual prefix, consistent with existing remappings

result:

  • removes path-based non-determinism from build script outputs
  • verified via stage 2 reproducibility testing.

r? @Urgau

@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 Apr 28, 2026
@rust-log-analyzer

This comment has been minimized.

Copy link
Copy Markdown
Member

@Urgau Urgau left a comment

Choose a reason for hiding this comment

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

Looks good to me.

View changes since this review

@Urgau
Copy link
Copy Markdown
Member

Urgau commented Apr 28, 2026

r=me once the typo is resolved and CI is happy

@bors delegate+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

✌️ @paradoxicalguy, you can now approve this pull request!

If @Urgau told you to "r=me" after making some further change, then please make that change and post @bors r=Urgau.

View changes since this delegation.

@paradoxicalguy
Copy link
Copy Markdown
Contributor Author

i was not able to find what the problem was 😭
thanks, changed and pushed again

Comment thread src/bootstrap/src/core/builder/cargo.rs Outdated
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
@Urgau
Copy link
Copy Markdown
Member

Urgau commented Apr 28, 2026

i was not able to find what the problem was 😭

Yeah, the backtrace is a red herring, I've asked for it to be removed when tidy fails, #t-infra/bootstrap > Stop priting a backtrace when tidy failed @ 💬.

@paradoxicalguy
Copy link
Copy Markdown
Contributor Author

@bors r=Urgau, all CI tests green

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

📌 Commit 26ce8a9 has been approved by Urgau,

It is now in the queue for this repository.

⚠️ The following reviewer(s) could not be found: ``

🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened.

@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 Apr 28, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 28, 2026
remap OUT_DIR paths to fix build script path leakage in crate metadata. 





### problem: 
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds. 
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing. 

r? @Urgau
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 28, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

💔 Test for a6fbdb7 failed: CI. Failed job:

@Urgau
Copy link
Copy Markdown
Member

Urgau commented Apr 29, 2026

Seems spurious.

@bors retry

@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 Apr 29, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 29, 2026
…r=Urgau,

remap OUT_DIR paths to fix build script path leakage in crate metadata.

### problem:
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds.
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing.

r? @Urgau
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 29, 2026
…r=Urgau,

remap OUT_DIR paths to fix build script path leakage in crate metadata.

### problem:
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds.
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing.

r? @Urgau
rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Rollup of 9 pull requests

Successful merges:

 - #151742 (Remove redundant information in `rustc_abi::Variants`)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…r=Urgau,

remap OUT_DIR paths to fix build script path leakage in crate metadata.

### problem:
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds.
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing.

r? @Urgau
@paradoxicalguy
Copy link
Copy Markdown
Contributor Author

is there any issue regarding merge/rollups?

@Urgau
Copy link
Copy Markdown
Member

Urgau commented Apr 29, 2026

is there any issue regarding merge/rollups?

Not that I know of, this PR is currently being tested in #155964. It can take up to a few days for a PR to be merged, our CI is not very fast and we have a bunch of PRs to merge.

@paradoxicalguy
Copy link
Copy Markdown
Contributor Author

is there any issue regarding merge/rollups?

Not that I know of, this PR is currently being tested in #155964. It can take up to a few days for a PR to be merged, our CI is not very fast and we have a bunch of PRs to merge.

understandable, i was asking in addition to bors build failing too, this pr's and last rollup's, both.

rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #155189 (simd_reduce_min/max: remove float support)
 - #155721 (When archive format is wrong produce an error instead of ICE)
 - #155794 (privacy: share effective visibility initialization)
 - #155856 (std_detect: support detecting more features on aarch64 Windows)
 - #155861 (Suggest `[const] Trait` bounds in more places)
 - #155899 (`dlltool`: Set the working directory to workaround `--temp-prefix` bug)
 - #155916 (Update with new LLVM 22 target for `wasm32-wali-linux-musl` target)
 - #155935 (remap OUT_DIR paths to fix build script path leakage in crate metadata. )
 - #155950 (use the new `//@ needs-asm-mnemonic: ret` more)
 - #155958 (ci(free-disk-space): remove more tools and fix warnings)
 - #155949 (Update `opt_ast_lowering_delayed_lints` query to allow "stealing" lints, allowing to use `FnOnce` instead of `Fn`)
 - #155951 (Make `FlatMapInPlaceVec` an unsafe trait.)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 29, 2026
…r=Urgau,

remap OUT_DIR paths to fix build script path leakage in crate metadata.

### problem:
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds.
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing.

r? @Urgau
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.

5 participants