uv
d6795da0 - Set permissions after streaming unzip (#1151)

Commit
2 years ago
Set permissions after streaming unzip (#1151) ## Summary When we migrated to an "unzip while we stream" solution, we lost the logic to set permissions on the extracted files, so executables in wheels were no longer executable. It turns out this is a little tricky, since the permissions metadata is in the central directory at the _end_ of the zip file, and the async ZIP reader explicitly stops iteration once it hits the central directory. (Specifically, it goes 4 bytes into the central directory, since it sees the 4-byte signature header and then stops.) So, to solve that, I've added a `CentralDirectoryReader` that continues where that iterator left off. This required forking the async zip crate: https://github.com/charliermarsh/rs-async-zip/pull/1. It took a lot of fiddling but I'm quite confident in the code now, especially since the async zip crate validates the signature kind on every read. The central directory is typically quite small (even for the Zig wheel, which is enormous, it's just around 1MB), so I don't expect this to have a high cost. Closes https://github.com/astral-sh/puffin/issues/1148.
Author
Parents
Loading