Skip to content

Correctly handle remapping from path containing the current directory with trailing paths #85344

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

Merged
merged 6 commits into from
Aug 25, 2021

Conversation

cbeuw
Copy link
Contributor

@cbeuw cbeuw commented May 15, 2021

If we have a auxiliary/lib.rs, and we generate the metadata with --remap-path-prefix $PWD/auxiliary=xyz, the path to $PWD/auxiliary/lib.rs won't be correctly remapped in the metadata. This is because internally, path to the working directory itself and relative paths to files under the working directory are remapped separately (hence neither are affected since neither has $PWD/auxiliary as prefix), but the concatenation between the working directory and the relative path is not remapped. This PR fixes that.

@rust-highfive
Copy link
Contributor

r? @matthewjasper

(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 May 15, 2021
@cbeuw cbeuw force-pushed the remap-across-cwd branch from 0e951a3 to 1ced98a Compare May 16, 2021 11:37
@matthewjasper matthewjasper reopened this May 16, 2021
@bstrie bstrie added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2021
@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 26, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 12, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2021
@camelid
Copy link
Member

camelid commented Aug 15, 2021

r? @michaelwoerister

Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, @cbeuw!

I left some comments below for making the test case more robust. Otherwise this is good to merge.

@michaelwoerister michaelwoerister added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 19, 2021
@cbeuw
Copy link
Contributor Author

cbeuw commented Aug 19, 2021

@michaelwoerister All addressed. Thanks for reviewing!

@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2021
@camelid camelid added the A-metadata Area: Crate metadata label Aug 19, 2021
@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 24, 2021

📌 Commit 08c55bd has been approved by michaelwoerister

@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 Aug 24, 2021
@bors
Copy link
Collaborator

bors commented Aug 24, 2021

⌛ Testing commit 08c55bd with merge a6e1d5007597713f57bba6f231b4fce0d9ce39fb...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Aug 24, 2021

💔 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 Aug 24, 2021
@inquisitivecrystal inquisitivecrystal added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 24, 2021
@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 25, 2021

📌 Commit 7ed9f2e has been approved by michaelwoerister

@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 Aug 25, 2021
@bors
Copy link
Collaborator

bors commented Aug 25, 2021

⌛ Testing commit 7ed9f2e with merge 958d788...

@bors
Copy link
Collaborator

bors commented Aug 25, 2021

☀️ Test successful - checks-actions
Approved by: michaelwoerister
Pushing 958d788 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 25, 2021
@bors bors merged commit 958d788 into rust-lang:master Aug 25, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 25, 2021
@cbeuw cbeuw deleted the remap-across-cwd branch November 11, 2021 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metadata Area: Crate metadata 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-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.