-
Notifications
You must be signed in to change notification settings - Fork 446
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
Remap $PWD to empty string instead of "." #1563
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Could this yield rewritten paths that look like absolute paths, e.g., if |
In my testing, rustc is smart and does not do that (it strips the leading
slash).
…On Mon., Sep. 26, 2022, 01:32 Krasimir Georgiev, ***@***.***> wrote:
Could this yield rewritten paths that look like absolute paths, e.g., if
$pwd is /path/to/dir and a relative path in a message is to subdir/lib.rs,
replacing $pwd with the empty string could yield messages with a path
like /subdir/lib.rs, which looks like an absolute path and is confusing
IMO.
—
Reply to this email directly, view it on GitHub
<#1563 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJO2TQI434TYWFIEORAA3LWAFNRVANCNFSM6AAAAAAQTR7IFI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Looks good then! @goffrie could you address this PR's google-cla check? |
Done. |
Could this be demonstrated by a test? |
I added a test and manually verified that it fails without this change (the path has a leading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This fixes an inconsistency in file paths (included in e.g. panic info), wherein some paths would have a leading
./
and some would not.I believe specifically generic code that is instantiated across a crate boundary would end up with an absolute path, then have it remapped to
.
, whereas other code would use the literal path passed on the command line torustc
, which is generally a relative path with no./
prefix.