-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fixed workspaces issues due to non-canonical manifest path #7729
fixed workspaces issues due to non-canonical manifest path #7729
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
oh, looks like under windows the canonical path is a UNC path, see rust-lang/rust#42869 |
Thanks for the PR! Unfortunately though this sort of user-space canonicalization is very tricky and we try to avoid it wherever we can. Can this same issue be solved with syscalls or some other form of path comparison which doesn't require manually interpreting the path? |
like I said I am not aware of other ways, but I am pretty new to rust, so maybe there is another solution |
One of the fundamental questions is whether or not the normalization should follow symlinks. I'm not sure I have a good answer to that. Using symlinks in a workspace seems likely to be problematic. Cargo has One thing I've been curious about is whether or not |
I think in general we've been bitten enough by any form of canonicalization that we want to avoid adding more canonicalization to Cargo. Can we perhaps solve this by not comparing paths? Is there something else we can do in Cargo? |
I was not aware of Another interesting crate could be same-file it compares files by comparing their inode-number on unix respectively the file_index on windows. |
ccf00c7
to
a0a8513
Compare
Looking through some paths the normalization logic is actually already applied for |
☔ The latest upstream changes (presumably #8321) made this pull request unmergeable. Please resolve the merge conflicts. |
This has been here for quite some time now so I'm going to go ahead and close this, feel free to resubmit though! |
this PR fixes #7686
comparisons with the root manifest path failed even if paths were identical.
This was due to a comparison with a non-canonical root manifest path with the canonical one.
This PR canonicalizes the manifest path when a Workspace is created, so that all future comparison are using the canonical manifest path.
Before two identical path, just represented differently, where not equal e.g.
a/../a != a
With this PR the comparison looks like this
a == a
, which is as expected equal