link.exe: Don't embed full path to PDB file in binary.
This PR makes rustc unconditionally pass /PDBALTPATH:%_PDB% to MSVC-style linkers, causing the linker to only embed the filename of the PDB in the binary instead of the full path. This will help implement the trim-paths RFC for *-msvc targets.
Passing /PDBALTPATH:%_PDB% to the linker is already done by many projects that need reproducible builds and debugger's should still be able to find the PDB if it is in the same directory as the binary.
r? @ghost
Fixes https://github.com/rust-lang/rust/issues/87825
https://github.com/rust-lang/rust/pull/122306 updated backtrace-rs to a version that includes https://github.com/rust-lang/backtrace-rs/pull/584, so this is unblocked now.
@rustbot ping windows
r? compiler
Hey Windows Group! This bug has been identified as a good "Windows candidate". In case it's useful, here are some instructions for tackling these sorts of bugs. Maybe take a look? Thanks! <3
cc @albertlarsan68 @arlosi @ChrisDenton @danielframpton @gdr-at-ms @kennykerr @luqmana @lzybkr @nico-abram @retep998 @sivadeilra @wesleywiser
@bors rollup=never since this touching an *-msvc-only run-make test.
Looks good!
r? compiler
Thanks @michaelwoerister for fixing this and landing that fix to backtrace-rs to unblock it!
@bors r+
:pushpin: Commit c37a8244d966f78843d9afddcf8897f9eccfb159 has been approved by wesleywiser
It is now in the queue for this repository.
However, backtrace-rs currently does not find the PDB. Consequently, this PR is blocked until https://github.com/rust-lang/backtrace-rs/pull/584 is merged.
Merged and backtrace has been updated, so this can land, yep.
:hourglass: Testing commit c37a8244d966f78843d9afddcf8897f9eccfb159 with merge 4026a87f9559aa6ebd3f1fd9bfaf13457f3149e3...
:broken_heart: Test failed - checks-actions
r? @wesleywiser
Let's see if this is the same i686 backtracing issue already encountered in https://github.com/rust-lang/backtrace-rs/pull/584, where backtracing was pretty flaky without frame pointers enabled.
@bors r=wesleywiser
:pushpin: Commit d3af77c678bf45b5c84bad66407b77564073ead3 has been approved by wesleywiser
It is now in the queue for this repository.
:hourglass: Testing commit d3af77c678bf45b5c84bad66407b77564073ead3 with merge 3f79023fe0d39556d8eab36a3349104167f39d25...
:broken_heart: Test failed - checks-actions
I modified the test code in https://github.com/rust-lang/rust/pull/121297/commits/0a094bae28a00117b99262621ff22876796d2885, so that unwinding will more reliably produce a stack trace that actually contains frames from the test. Unwinding not always working is a pre-existing issue on i686-pc-windows-msvc and unrelated to the change in this PR.
@bors r+
:pushpin: Commit 0a094bae28a00117b99262621ff22876796d2885 has been approved by wesleywiser
It is now in the queue for this repository.
:hourglass: Testing commit 0a094bae28a00117b99262621ff22876796d2885 with merge c5b571310dc60c6a58c6505cce2fb7e2f3f9aa68...
:sunny: Test successful - checks-actions Approved by: wesleywiser Pushing c5b571310dc60c6a58c6505cce2fb7e2f3f9aa68 to master...
Finished benchmarking commit (c5b571310dc60c6a58c6505cce2fb7e2f3f9aa68): comparison URL.
Overall result: no relevant changes - no action needed
@rustbot label: -perf-regression
Instruction count
This benchmark run did not return any relevant results for this metric.
Max RSS (memory usage)
Results
This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
2.2% | [2.2%, 2.2%] | 1 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
-2.8% | [-4.8%, -1.0%] | 14 |
| Improvements ✅ (secondary) |
-2.5% | [-5.7%, -0.5%] | 52 |
| All ❌✅ (primary) | -2.5% | [-4.8%, 2.2%] | 15 |
Cycles
This benchmark run did not return any relevant results for this metric.
Binary size
This benchmark run did not return any relevant results for this metric.
Bootstrap: 671.321s -> 670.605s (-0.11%) Artifact size: 311.51 MiB -> 311.47 MiB (-0.01%)