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 cannot handle long paths on windows everywhere #10197

Closed
jessesna opened this issue Dec 13, 2021 · 1 comment
Closed

cargo cannot handle long paths on windows everywhere #10197

jessesna opened this issue Dec 13, 2021 · 1 comment
Labels
C-bug Category: bug

Comments

@jessesna
Copy link

Problem

I'm trying to execute cargo publish and the process fails with a

error: failed to verify package tarball

Caused by:
  failed to remove file `..........\build_script_build-1355d04cfd9a6cb5.build_script_build.b1cedc92-cgu.0.rcgu.o`

Caused by:
  The system cannot find the path specified. (os error 3)

The path is 261 characters long.
The actual problem is the Maximum Path Length Limitation which can easily be avoided by using the magic "\\?\" prefix.

Steps

  1. create or copy any project to a location where it itself is closely below the MAX_PATH limit and try to publish

Possible Solution(s)

Use the magic "\\?\" prefix for all paths on windows

Notes

Long Paths can be globally enabled in Windows 10, Version 1607, and Later but this is a somewhat intrusive method which can break other applications.

Version

cargo 1.57.0 (b2e52d7ca 2021-10-21)
release: 1.57.0
commit-hash: b2e52d7cab0a286ee9fcc0c17510b1e72fcb53eb
commit-date: 2021-10-21
host: x86_64-pc-windows-msvc
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1-DEV (sys:0.4.49+curl-7.79.1 vendored ssl:Schannel)
os: Windows 10.0.19044 [64-bit]
@jessesna jessesna added the C-bug Category: bug label Dec 13, 2021
@ehuss
Copy link
Contributor

ehuss commented Dec 13, 2021

Sorry you're running into trouble with the long paths. Unfortunately this isn't a particularly easy thing to fix universally. I'm going to close as a duplicate of #9770 and the issues linked therein.

@ehuss ehuss closed this as completed Dec 13, 2021
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