-
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
"error: path too long" on Windows when doing "cargo install --git" #13020
Comments
Can you paste the full error output? Feel free to censor paths if you'd prefer. |
Sure, here you go. Install in progress:
After it reaches around 48%:
|
Yeah, you need to set registry to long paths. Usually git enables this on instalation I.e. navigate to |
Would it make sense to have cargo recommend this? |
Cargo would first need #7986 to make use of the registry setting. Without the manifest option set, the registry setting will be ignored. See Enable Long Paths in Windows 10, Version 1607, and Later. |
It would make sense for cargo to offer it as a fix, in my opinion. |
Hmm... I do have |
See my reply above. It's something Cargo would need to opt into. Note that this doesn't affect Cargo's own code (only libgit2 dependency) because the Rust standard library works around the problem even without the registry setting and manifest option. |
Demonstrating that it's enabled:
|
Ok, I can reproduce but there is another setting I'm trying |
Cargo also needs to opt in. This can only be done via an application manifest. From my link above:
|
Can you try with https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli set? |
No change:
|
You might also need to run: |
That fixes it, @ChrisDenton though I need to run that command from an elevated command prompt. Is this something interesting and worth fixing? Is it desirable to put this in a readme somewhere? At the very least this Issues chain should give a workaround for people who run into this problem in the future, but should there be a long-term solution and if so what should it be? |
Oh maybe I guess Cargo could detect the error and suggest using setting |
One thought is to have cargo automatically set that option when creating dependency or index clones. I think that should work, and should be safe, and doesn't appear to require setting a registry entry. A risk is that the user has independent tooling, like a backup program or something that inspects the |
Yeah it's designed so it can be a repository local setting, no problem. The |
* When building for windows, we need to set `git config --system core.longpaths true` * This commit modifies ci.yml to do so * See rust-lang/cargo#13020 for more info
you can Use Git with Core.LongPaths by running |
Problem
When attempting to install a crate via git, the checkout process gets to 48% and then errors out with "error: path too long".
Steps
cargo install --git https://github.com/web-infra-dev/rspack
Possible Solution(s)
No response
Notes
This repo probably doesn't even work, especially since I don't see a binary if I manually check it out and try to build it. However I'm opening this issue because it's very reproducible and the error is generated very early on.
Version
The text was updated successfully, but these errors were encountered: