Skip to content

Conversation

@Urgau
Copy link
Member

@Urgau Urgau commented Dec 17, 2025

This is done to avoid leaking the relative paths to the standard library after the overall of filenames in #149709.

Noted that the paths were already leaking before, but to a lesser extent since most (but not all) the paths embedded in the distributed rlib were absolute.

In general Cargo compiles workspace members with relative paths, so it's better anyway to remap the relative path.

In addition to our tests I have manually confirmed that it also works as expected for the printed diagnostics paths.

cf. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/remapping.20of.20the.20standard.20library/near/564093571

r? @jieyouxu

This is done to avoid leaking the relative paths to the standard
library after the overall of filenames.

Noted that the paths were already leaking before, but to a lesser extent
since the paths embedded in the distributed `rlib` were absolute.

In general Cargo compiles workspace members with relative paths, so it's
better anyway to remap the relative path.

cf https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/remapping.20of.20the.20standard.20library/near/564093571
@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 Dec 17, 2025
@Urgau
Copy link
Member Author

Urgau commented Dec 17, 2025

@bors try

rust-bors bot added a commit that referenced this pull request Dec 17, 2025
Prefer remapping the relative `library/` and `compiler/` directories
@rust-bors
Copy link

rust-bors bot commented Dec 17, 2025

⌛ Trying commit 74eecf9 with merge 7b8f45c

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/20316932080

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

3 participants