-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid erroring for source distributions with symlinks in archive (#1944)
## Summary For context, we have three extraction paths: - untar (async) - used for any `.tar.gz`, local or remote. - unzip (async) - used to unzip remote wheels, or local or remote source distributions. - unzip (sync) - used to untar locally-available wheels into the cache. We use three different crates for these: - [`tokio-tar`](https://github.com/vorot93/tokio-tar) - [`async-zip`](https://github.com/Majored/rs-async-zip) - [`zip-rs`](https://github.com/zip-rs/zip) These all seem to have different support for symlinks: - `tokio-tar` tries to create a symlink (which works fine on Unix but errors on Windows, since we typically don't have elevated permissions). - `async-zip` _seems_ to write the target contents directly to the file (which is what we want). - `zip-rs` _apparently_ writes the _name_ of the target to the file (which isn't what we want). Thankfully, symlinks are not allowed in wheels (pypa/pip#5919, https://discuss.python.org/t/symbolic-links-in-wheels/1945), so we can ignore `zip-rs`. For `tokio-tar`, we now _skip_ (and warn) if we see a symlink on Windows. We could do what pip does, and recursively copy, but it's difficult because we don't have `Seek` on the file. (Alternatively, we could use hard links and junctions, though those also might need to exist already.) Let's see how far this gets us. (We also no longer attempt to set permissions on symlinks on Unix, which caused another failure.) Closes #1858.
- Loading branch information
1 parent
019e2fd
commit a1f5041
Showing
4 changed files
with
78 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters