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

Do not use the absolute path to cache wheel extensions. #226

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

stewartmiles
Copy link
Contributor

Wheel names can be long and paths to mounted wheels can be long. Previously util.path_to_cache_dir() was unconditionally building cache paths using the absolute path of the cache directory joined with the absolute path to a wheel being mounted. This makes it very easy to generate in huge paths that exceed the maximum path length (MAX_PATH) on Windows machines without the
registry change to support long paths.

A user-wide shared location for cached data is potentially easy enough to poison with incorrect extensions, so using the absolute path of a wheel being mounted to cache extensions doesn't seem to add any more protection and results in very long hard to read paths that can exceed Windows path limits in out of the box installations.

Fixes #224

Wheel names can be long and paths to mounted wheels can be long.
Previously `util.path_to_cache_dir()` was unconditionally building
cache paths using the absolute path of the cache directory joined
with the absolute path to a wheel being mounted. This makes it very
easy to generate in huge paths that exceed the maximum path length
(MAX_PATH) on Windows machines without the
[registry change](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry)
to support long paths.

A user-wide shared location for cached data is potentially easy enough
to poison with incorrect extensions, so using the absolute path of a
wheel being mounted to cache extensions doesn't seem to add any more
protection and results in very long hard to read paths that can exceed
Windows path limits in out of the box installations.

Fixes pypa#224
@stewartmiles
Copy link
Contributor Author

All the failures on this commit are related to the job:

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
flags: unittests
files: coverage.xml

@vsajip vsajip merged commit fac84c7 into pypa:master Oct 7, 2024
23 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce temporary path length of extensions extracted from wheels
2 participants