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

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Dec 17, 2025

☀️ Try build successful (CI)
Build commit: 7b8f45c (7b8f45c196d5f10b2f859b09c58205f9f9228066, parent: 68f11a11b666b36137374b6e54fc0d013a3b26cf)

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks, let give this a try at least. If this proves problematic, we can revert.

View changes since this review

@jieyouxu
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Dec 18, 2025

📌 Commit 74eecf9 has been approved by jieyouxu

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 Dec 18, 2025
@bors
Copy link
Collaborator

bors commented Dec 18, 2025

⌛ Testing commit 74eecf9 with merge 0e7ebb4...

bors added a commit that referenced this pull request Dec 18, 2025
Prefer remapping the relative `library/` and `compiler/` directories

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
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 18, 2025

💔 Test failed - checks-actions

@bors bors 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 Dec 18, 2025
@jieyouxu
Copy link
Member

Huh.

@Urgau
Copy link
Member Author

Urgau commented Dec 18, 2025

Those tests failures are interesting, they show the remapped paths, despite compiletest asking rustc to change the prefix to /rustc/FAKE_PREFIX (with -Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX).

I have manually checked and the above prefix change works as expected for imported files (ie files described in rmeta), but as far as I can tell none of those filenames comes from an rlib/rmeta.

Instead they come from the compiled artifact it-self, and more specifically the debuginfo, which is retrived by the backtraces and shown on those tests. (yes, even in the note:, thanks to some wild backtrace capturing in rustc_errors)

The reason this wasn't an issue before is because were only producing the relative paths, which are not remapped before this PR. As for why those tests didn't fail on PR CI, I have no idea.


In any-case we well need a mechanism that supplants the current /rustc/FAKE_PREFIX normalization.

This is even complicated by the fact depending on whenever the compiler/std was compiled with remapping on or off changes the kind of paths we get, as with remapping on we will get absolute paths (starting with /rustc/) but with remapping off we will only get relative paths, which I think prevents us from applying any normalization globally.

Given that all of those test already had custom normalization for those backtrace paths, I have opted to add a simple //@ normalize-stderr: "/rustc(?:-dev)?/[a-z0-9.]+/" -> "" rule to all of the failing tests.

@Urgau
Copy link
Member Author

Urgau commented Dec 18, 2025

@bors try jobs=dist-x86_64-linux

@rust-bors

This comment has been minimized.

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

try-job: dist-x86_64-linux
@rust-bors
Copy link

rust-bors bot commented Dec 19, 2025

☀️ Try build successful (CI)
Build commit: 3822c58 (3822c58804c3d0f64dd4e612587894ac319d5d22, parent: fcf67da039f42e3905cf6f69e33304299c45149f)

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Hm... yeah. The extra test normalizations don't feel great, but not end of the world.

View changes since this review

@jieyouxu
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 19, 2025

📌 Commit 0acc846 has been approved by jieyouxu

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 Dec 19, 2025
@bors
Copy link
Collaborator

bors commented Dec 19, 2025

⌛ Testing commit 0acc846 with merge 1d8f9c5...

@bors
Copy link
Collaborator

bors commented Dec 19, 2025

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing 1d8f9c5 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 19, 2025
@bors bors merged commit 1d8f9c5 into rust-lang:main Dec 19, 2025
13 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 19, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 0f0d850 (parent) -> 1d8f9c5 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1d8f9c548d4d8845951f1d927caac1620e86353d --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 3558.8s -> 4164.5s (+17.0%)
  2. x86_64-gnu-miri: 4470.2s -> 5032.7s (+12.6%)
  3. x86_64-mingw-2: 9121.5s -> 10068.3s (+10.4%)
  4. x86_64-gnu-llvm-20-2: 5548.6s -> 6084.8s (+9.7%)
  5. aarch64-msvc-2: 6565.1s -> 5978.0s (-8.9%)
  6. aarch64-apple: 10310.5s -> 9417.7s (-8.7%)
  7. tidy: 148.8s -> 161.5s (+8.5%)
  8. x86_64-msvc-2: 8305.3s -> 8956.8s (+7.8%)
  9. dist-aarch64-apple: 8173.8s -> 7545.4s (-7.7%)
  10. dist-i586-gnu-i586-i686-musl: 5510.0s -> 5103.6s (-7.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1d8f9c5): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.6%, secondary 0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.9% [1.5%, 4.4%] 2
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-4.2% [-4.2%, -4.2%] 1
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) 0.6% [-4.2%, 4.4%] 3

Cycles

Results (primary 2.1%, secondary 2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.1% [2.1%, 2.2%] 2
Regressions ❌
(secondary)
2.8% [2.2%, 4.1%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.1% [2.1%, 2.2%] 2

Binary size

Results (primary 0.1%, secondary 0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 4
Regressions ❌
(secondary)
0.3% [0.2%, 0.5%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.1%] 4

Bootstrap: 479.055s -> 480.26s (0.25%)
Artifact size: 390.50 MiB -> 390.57 MiB (0.02%)

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

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

6 participants