-
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
"Package collision in lockfile" using UNC/root local device/etc paths #6198
Comments
I would be willing to help diagnose, I'd appreciate if you could make a zip file that I could unzip on my |
It is a bit laborious to recreate, isn't it? 😅 Here you go: path-bug.zip |
No I am just feeling brain dead from Rust Belt Rust, and wanted a supportive response that did not involve me thinking for a while. Sorry. Working from your zip I was able to reproduce locally. Oddly if the tomls are changed from |
Ah, this is very good to know. It gives us a good workaround for the wasm-pack scenario. |
@alexcrichton So this looks like a path normalization bug, where do our source paths get normalized? |
@Eh2406 I think it has to do with something around in |
It looks like this is where the And this is the function it calls that's mostly likely to be giving bad results: https://github.com/rust-lang/cargo/blob/master/src/cargo/util/paths.rs#L47-L72 Though it's also possibly a bug in the |
Canonical paths should not have any more normalization done to them. The point of canonical paths is that all normalization has already been applied to them. Eg It also means that you cannot take a path and append Edit: From #winapi IRC:
|
The most correct way to join |
We had a conversation about this on IRC, logs, a. What cargo is currently doing is wrong, doing it correctly is hard and there is not a library for it (if you make it we will use it). |
Hi guys, I've also encountered this issue while working with Trunk and Seed. |
Problem
When invoking Cargo with the current directory or manifest path given as one of Windows' more "exotic" kinds of paths, such as a
\\?\
"root local device path," internal path comparisons can fail and the build aborts. Ideally, Cargo would be able to handle these paths.Steps
One way to reproduce the bug is with a directory structure like this:
main
depends, viapath = "../dep_a"
andpath = "../dep_b"
, on bothdep_a
anddep_b
.dep_a
also depends, viapath = "../dep_b"
, ondep_b
.Here is a zip file containing the structure described above: path-bug.zip
Then, the bug can be triggered by running this command:
It produces an error message like this:
wasm-pack
hits this issue because it sets the current directory to a canonicalized.
when invoking Cargo. See rustwasm/wasm-pack#380, rustwasm/wasm-pack#413, and an attempt to work around this problem in rustwasm/wasm-pack#389.Notes
I most recently reproduced this with Cargo version
cargo 1.31.0-nightly (5dbac9888 2018-10-08)
, on Windows 10.The text was updated successfully, but these errors were encountered: