Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for -Z simulate-remapped-rust-src-base when resolving remapped paths #97786

Merged
merged 1 commit into from
Jun 29, 2022

Conversation

pietroalbini
Copy link
Member

@pietroalbini pietroalbini commented Jun 6, 2022

Discovered in #97682, -Z simulate-remapped-rust-src-base only partially simulated the behavior of remap-debuginfo = true. While the flag successfully simulates the remapping when stdlib's rmeta file is loaded, the simulated prefix was not accounted for when the remapped path's local path was being discovered. This caused the flag to not fully simulate the behavior of remap-debuginfo = true, leading to inconsistent behaviors.

This PR fixes #97682 by also accounting for the simulated path.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 6, 2022
@rust-highfive
Copy link
Collaborator

r? @lcnr

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 6, 2022
@pietroalbini
Copy link
Member Author

Note that this PR will fail CI until #97789 is merged, as src/test/ui/span/issue-71363.rs relies on the bug fixed by this PR.

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented Jun 8, 2022

r? rust-lang/compiler

@rust-highfive rust-highfive assigned jackh726 and unassigned lcnr Jun 8, 2022
@bors
Copy link
Contributor

bors commented Jun 11, 2022

☔ The latest upstream changes (presumably #97989) made this pull request unmergeable. Please resolve the merge conflicts.

@pietroalbini
Copy link
Member Author

Rebased, tests should now pass!

@rust-log-analyzer

This comment has been minimized.

@jackh726
Copy link
Member

r? @Mark-Simulacrum since you last reviewed this code

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jun 26, 2022

📌 Commit 1a5e2d8 has been approved by Mark-Simulacrum

@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 Jun 26, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jun 26, 2022
…fix, r=Mark-Simulacrum

Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths

Discovered in rust-lang#97682, `-Z simulate-remapped-rust-src-base` only partially simulated the behavior of `remap-debuginfo = true`. While the flag successfully simulates the remapping when stdlib's `rmeta` file is loaded, the simulated prefix was not accounted for when the remapped path's local path was being discovered. This caused the flag to not fully simulate the behavior of `remap-debuginfo = true`, leading to inconsistent behaviors.

This PR fixes rust-lang#97682 by also accounting for the simulated path.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 28, 2022
…fix, r=Mark-Simulacrum

Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths

Discovered in rust-lang#97682, `-Z simulate-remapped-rust-src-base` only partially simulated the behavior of `remap-debuginfo = true`. While the flag successfully simulates the remapping when stdlib's `rmeta` file is loaded, the simulated prefix was not accounted for when the remapped path's local path was being discovered. This caused the flag to not fully simulate the behavior of `remap-debuginfo = true`, leading to inconsistent behaviors.

This PR fixes rust-lang#97682 by also accounting for the simulated path.
This was referenced Jun 28, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 29, 2022
Rollup of 7 pull requests

Successful merges:

 - rust-lang#97423 (Simplify memory ordering intrinsics)
 - rust-lang#97542 (Use typed indices in argument mismatch algorithm)
 - rust-lang#97786 (Account for `-Z simulate-remapped-rust-src-base` when resolving remapped paths)
 - rust-lang#98277 (Fix trait object reborrow suggestion)
 - rust-lang#98525 (Add regression test for rust-lang#79224)
 - rust-lang#98549 (interpret: do not prune requires_caller_location stack frames quite so early)
 - rust-lang#98603 (Some borrowck diagnostic fixes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c23add7 into rust-lang:master Jun 29, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jun 29, 2022
@pietroalbini pietroalbini deleted the pa-fix-simulate-remap-prefix branch June 29, 2022 17:21
@lqd lqd mentioned this pull request Jul 6, 2022
@lqd
Copy link
Member

lqd commented Jul 6, 2022

Note: this PR was a major source of the big perf regression seen in rollup #98656 (as the results from a perf run of its revert show).

@Mark-Simulacrum Mark-Simulacrum added the perf-regression Performance regression. label Jul 6, 2022
@Mark-Simulacrum
Copy link
Member

This PR is responsible for this regression, so I am tagging it as perf-regression. It landed in #98656 (a rollup), which as now been marked as having its perf regression triaged.

I think the next step here is to investigate to see if we can avoid the at least to me unexpected impact here -- @pietroalbini can hopefully look into it a little.

@pietroalbini
Copy link
Member Author

I'm... extremely confused how this could cause such a perf regression. I'll try to spend a bit of time loooking into it.

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 26, 2022
…sion, r=Mark-Simulacrum

Remove new allocations from `imported_source_files`

rust-lang#97786 introduced a [large performance regression](rust-lang#97786 (comment)). After some local investigation it turns out the allocations performed by my change were the cause of the perf regression. This PR refactors my change to remove those allocations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

-Z simulate-remapped-rust-src-base is not fully simulating remap-debuginfo = true
9 participants