Repository navigation
Conversation
uv test inventory changesThis PR changes the tests when compared with the
|
7e2132d to
2ceceab
Compare
|
NB: I suspect BurntSushi/walkdir#217 is what we'll want longer-term here. |
7010b0e to
d82f411
Compare
af2937c to
1dc90cc
Compare
1dc90cc to
7732526
Compare
7732526 to
0f0a828
Compare
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
0f0a828 to
9a6dd20
Compare
EliteTK
left a comment
There was a problem hiding this comment.
I'm not too fond of this kind of a workaround.
walkdir is a bit too established for an upstream fix to land in a way which would cleanly help here. I think a perfectly reasonable decision is to just write our own small walker for our purposes which gives you entries in a form which makes it easy to manipulate without needing to deal with long paths (of course for logging we'd still need to construct a path, which we can still do). I wouldn't mind fixing this (sounds like fun).
This PR does have two gaps though:
uv_distribution::prune: called for the sdists bucket, uses walkdir without this guard, since we extract into a shallower path and then rename, there's a chance we could still construct paths that end up too long.find_archive_references: called for the sdists and wheels buckets, uses walkdir without this guard, but it skipssrcdirectories and thus is probably not realistically going to have an issue because of this.
|
Yeah, it's kind of a sad workaround.
How do you mean? I think that PR linked above would address our specific problem, although it does involve a public API break on |
|
I'll see if I can lift the changes further here; I agree at minimum we should be guarding the |
WIP, I still need to clean this up + think about appropriate warning states.Summary
Fixes #15569.
TL;DR: if a user runs
uv cache clean(or similar) but their cache directory contains absolute paths that are pathologically long (longer thanPATH_MAX=1024),walkdirwill fail to materialize them before we have a chance to actually delete them.The solution is to take their parent directory and remove each member relative to it. Rust's
remove_dir_alldoes this robustly by usingopenatandunlinkaton macOS.I think we could probably broaden this to Linux (and other Unix-likes?) as well. However the problem is less apparent there since
PATH_MAXis even more pathological (4096).I decided not to add a user warning here, since it's not really actionable.
Test Plan
Added integration tests.