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

Crate failed to unpack on Windows (os error 3) - path name too long #2516

Open
UK992 opened this issue Mar 24, 2016 · 7 comments
Open

Crate failed to unpack on Windows (os error 3) - path name too long #2516

UK992 opened this issue Mar 24, 2016 · 7 comments
Labels
A-filesystem Area: issues with filesystems C-bug Category: bug E-hard Experience: Hard O-windows OS: Windows S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@UK992
Copy link

UK992 commented Mar 24, 2016

unable to get packages from source

Caused by:
  Failed to unpack package `servo-skia v0.20130412.3`

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

Failed if path has spaces servo/servo#9442
and also for unknown reason servo/servo#10089 (maybe too many subfolders or capital letters?)
or something wrong with crate servo-skia?

@UK992 UK992 changed the title Crate failed to unpack on Windows Crate failed to unpack on Windows (os error 3) Mar 24, 2016
@alexcrichton
Copy link
Member

What version of Cargo were you using for this? It looks like this may be similar to #2309 where the path name is just too long in the servo-skia crate

@UK992
Copy link
Author

UK992 commented Mar 24, 2016

2016-03-04 version for servo/servo#10089 and 2015-10-01 for servo/servo#9442 (based on github history)

@alexcrichton
Copy link
Member

The "spaces in path" mentioned in servo/servo#9442 I don't think have anything to do with Cargo. It sounded like that was primarily for makefiles and various scripts here and there which didn't properly escape spaces, but Cargo doesn't have to worry about any of that.

For servo/servo#10089 the error message is "The system can not find the path specified" for a path name with 263 bytes in it, which on my system returns "The filename or extension is too long". I suspect a different version of Windows may have been in use which had a different error for the report.

SimonSapin added a commit to servo/skia that referenced this issue Apr 11, 2016
This doesn’t significantly affect the size of tarballs,
but make them not include some files with very long paths like

gm/rebaseline_server/testdata/outputs/expected/compare_rendered_pictures_test.CompareRenderedPicturesTest.test_endToEnd/compare_rendered_pictures.json

This will hopefull help on Windows:

http://logs.glob.uno/?c=mozilla%23servo#c403696
https://i.imgur.com/JeBRLlE.png
rust-lang/cargo#2516
http://logs.glob.uno/?c=mozilla%23servo#c403699

The longest path from the crate root is now 65, down from 150.

third_party/freetype/include_overrides/freetype/config/ftoption.h

I’ve checked that `cargo build --target arm-linux-androideabi` still succeeds
when run on the result of extracting the tarball.
SimonSapin added a commit to servo/skia that referenced this issue Apr 11, 2016
This doesn’t significantly affect the size of tarballs,
but make them not include some files with very long paths like

gm/rebaseline_server/testdata/outputs/expected/compare_rendered_pictures_test.CompareRenderedPicturesTest.test_endToEnd/compare_rendered_pictures.json

This will hopefully help on Windows:

http://logs.glob.uno/?c=mozilla%23servo#c403696
https://i.imgur.com/JeBRLlE.png
rust-lang/cargo#2516
http://logs.glob.uno/?c=mozilla%23servo#c403699

The longest path from the crate root is now 65, down from 150.

third_party/freetype/include_overrides/freetype/config/ftoption.h

I’ve checked that `cargo build --target arm-linux-androideabi` still succeeds
when run on the result of extracting the tarball.
SimonSapin added a commit to servo/skia that referenced this issue Apr 11, 2016
This doesn’t significantly affect the size of tarballs,
but make them not include some files with very long paths like

gm/rebaseline_server/testdata/outputs/expected/compare_rendered_pictures_test.CompareRenderedPicturesTest.test_endToEnd/compare_rendered_pictures.json

This will hopefully help on Windows:

http://logs.glob.uno/?c=mozilla%23servo#c403696
https://i.imgur.com/JeBRLlE.png
rust-lang/cargo#2516
http://logs.glob.uno/?c=mozilla%23servo#c403699

The longest path from the crate root is now 65, down from 150.

third_party/freetype/include_overrides/freetype/config/ftoption.h

I’ve checked that `cargo build --target arm-linux-androideabi` still succeeds
when run on the result of extracting the tarball.
bors-servo pushed a commit to servo/skia that referenced this issue Apr 11, 2016
Exclude more directories in Cargo.toml

This doesn’t significantly affect the size of tarballs, but make them not include some files with very long paths like

```
gm/rebaseline_server/testdata/outputs/expected/compare_rendered_pictures_test.CompareRenderedPicturesTest.test_endToEnd/compare_rendered_pictures.json
```

This will hopefully help on Windows:

http://logs.glob.uno/?c=mozilla%23servo#c403696
https://i.imgur.com/JeBRLlE.png
rust-lang/cargo#2516
http://logs.glob.uno/?c=mozilla%23servo#c403699

The longest path from the crate root is now 65, down from 150.

```
third_party/freetype/include_overrides/freetype/config/ftoption.h
```

I’ve checked that `cargo build --target arm-linux-androideabi` still succeeds when run on the result of extracting the tarball.

r? @mbrubeck

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/skia/91)
<!-- Reviewable:end -->
@CryZe
Copy link

CryZe commented Apr 19, 2016

I just encountered this with neon-sys. Apparently cargo can't unpack crates that cause paths that are too long. This is not an issue of Windows though, as I was able to manually unzip it with WinRAR. So this is definitely a bug in cargo.

This was the path that was causing trouble:

C:\Users\Christopher\.cargo\registry\src\github.com-88ac128001ac3a9a\neon-sys-0.1.9\node_modules\node-gyp\node_modules\request\node_modules\har-validator\node_modules\is-my-json-valid\node_modules\generate-object-property\node_modules\is-property\is-property.js

@carols10cents carols10cents changed the title Crate failed to unpack on Windows (os error 3) Crate failed to unpack on Windows (os error 3) - path name too long Sep 25, 2017
@carols10cents carols10cents added C-bug Category: bug O-windows OS: Windows labels Sep 25, 2017
@vae520283995
Copy link

I have the same problem

@sachinparyani
Copy link

I have the same problem when I try to install cargo-edit-locally using the cargo install command. Here is the entire stacktrace

(C:\Users\Administrator\anaconda3) C:\Users\Administrator\source\AzureMlCli\dataprep\Core\rust_lex\rslex-http-stream>cargo install cargo-edit-locally
Updating crates.io index
Installing cargo-edit-locally v0.1.3
error: failed to compile cargo-edit-locally v0.1.3, intermediate artifacts can be found at C:\Users\ADMINI~1\AppData\Local\Temp\cargo-installvQtOd9

Caused by:
failed to download libgit2-sys v0.6.19

Caused by:
unable to get packages from source

Caused by:
failed to unpack package libgit2-sys v0.6.19

Caused by:
failed to unpack entry at libgit2-sys-0.6.19/libgit2/tests/resources/push_src/.gitted/modules/submodule/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx

Caused by:
failed to unpack C:\Users\Administrator\AppData\Local\viennaBuildTools\rust\nightly-2020-09-09\cargo\registry\src\github.com-1ecc6299db9ec823\libgit2-sys-0.6.19\libgit2\tests\resources\push_src\.gitted\modules\submodule\objects\pack\pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx

Caused by:
failed to unpack libgit2-sys-0.6.19/libgit2/tests/resources/push_src/.gitted/modules/submodule/objects/pack/pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx into C:\Users\Administrator\AppData\Local\viennaBuildTools\rust\nightly-2020-09-09\cargo\registry\src\github.com-1ecc6299db9ec823\libgit2-sys-0.6.19\libgit2\tests\resources\push_src\.gitted\modules\submodule\objects\pack\pack-a81e489679b7d3418f9ab594bda8ceb37dd4c695.idx

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

@weihanglo weihanglo added E-hard Experience: Hard S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. A-filesystem Area: issues with filesystems labels Jun 29, 2023
@Maatarashiii
Copy link

I rewrote the code to this form, and it does not crash the program, but there is one thing, but, as I said, the program cannot find the path to the file, although it exists, and that’s the essence of the question, how to fix this?

image

It produces the following error, Error: The system cannot find the specified path. (os error 3)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-filesystem Area: issues with filesystems C-bug Category: bug E-hard Experience: Hard O-windows OS: Windows S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

8 participants