-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use hash instead of full wheel name in wheels bucket #11738
base: main
Are you sure you want to change the base?
Conversation
@@ -29,8 +29,8 @@ pub(crate) struct BuiltWheelMetadata { | |||
impl BuiltWheelMetadata { | |||
/// Find a compatible wheel in the cache. | |||
pub(crate) fn find_in_cache(tags: &Tags, cache_shard: &CacheShard) -> Option<Self> { | |||
for directory in files(cache_shard) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an unrelated change. I got a bit confused here between directory/files while reading the code. I can move this to separate MR or remove it if required.
d49319c
to
217edc2
Compare
Thanks! Will review. |
217edc2
to
3d00223
Compare
I think this generally looks right, though I'm undecided on whether we should always do this, or only do it for wheels with filenames that exceed a certain length. It does hurt cache (plaintext) readability a bit which is inconvenient for debugging, since you can no longer infer the wheel tags etc. from the cached filename alone. |
805be70
to
a447796
Compare
Summary
Closes #2410
This changes the name of files in
wheels
bucket to use a hash instead of the wheel name as to not exceed maximum file length limit on various systems.This only addresses the primary concern of #2410. It still does not address:
To solve this we need to opt-in to longer path limits on windows (ref), but I think that is a separate issue and should be a separate MR.
As per my understanding, this is out of uv's control. Name of the output wheel will be decided by build-backend used by the project. For wheels built from source distribution, pip also uses the wheel names in cache. So I have not touched
sdists
cache.I have added a
filename: WheelFileName
field inArchive
, so we can use it while indexing instead of relying on the filename on disk. Another way to do this was to read.dist-info/WHEEL
and.dist-info/METADATA
and buildWheelFileName
but that seems less robust and will be slower.Test Plan
Tested by installing
yt-dlp
,httpie
andsqlalchemy
and verifying that cache files inwheels
bucket use hash.