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

cargo vendor outputs directory with \\?\ on Windows if it previously existed #7371

Closed
agashlin opened this issue Sep 17, 2019 · 2 comments
Closed
Labels
C-bug Category: bug

Comments

@agashlin
Copy link

Problem

When using the builtin cargo vendor in 1.37.0, if the path already exists the generated .cargo/config output has a path starting with \\?\, which confuses other tools.

I've seen a few terms used for this kind of path: extended-length paths, UNC paths, NT paths. I'm not sure which is accurate.

Steps

  1. In a mingw shell, in a crate with some dependencies, mkdir vendor
  2. cargo vendor
  3. Output includes:
[source.vendored-sources]
directory = "\\\\?\\<basedir>\\vendor"

Possible Solution(s)
With cargo-vendor 0.1.23 (exposed by downgrading to 1.36.0 with rustup default 1.36.0) this was not the case, it would output directory = "<basedir>\\vendor"

This is the case whether or not the directory existed already. With the subcommand in 1.37.0, the above issue happens if the directory already existed, but if it did not then it just says directory = "vendor". This is probably coming from the GetFinalPathNameByHandleW() call inside sys::fs::canonicalize(), but I haven't dug into cargo yet to see why this is being used.

I think something similar was caught and fixed early in cargo-vendor: alexcrichton/cargo-vendor#71 (comment)

Notes

Output of cargo version:

cargo 1.37.0 (9edd089 2019-08-02)

@agashlin agashlin added the C-bug Category: bug label Sep 17, 2019
@ehuss
Copy link
Contributor

ehuss commented Sep 17, 2019

Thanks for the report! I think this is essentially the same as #7316, so I'm going to close in favor of that (though I'm going to steal your title for the other issue).

@ehuss ehuss closed this as completed Sep 17, 2019
@agashlin
Copy link
Author

Oops, I should have looked a little harder, thanks for the link!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants