Repository navigation
fix(pypi): repack patched wheels with Bazel's zipper - #4486
Merged
rickeylev merged 3 commits intoNov 15, 2026
Merged
Conversation
Patching a wheel with `pip.override` repacks it with the host `zip`, so the repository rule fails on a host without a `zip` binary, such as a minimal container. To fix, use Bazel's bundled zipper on non-Windows hosts when it is present, and keep `zip` as the fallback. The file list goes through a params file, because the zipper takes `name=path` entries. Paths it can't express (containing `=` or a newline) use `zip`. The zipper writes a fixed timestamp, so the repacked wheel is also reproducible. * Adds `zipper_params_content` and unit tests for it 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
rickeylev
reviewed
Nov 14, 2026
Wrap Starlark lines within 80 columns, document the uncompressed `c` mode passed to Bazel's zipper, and condense the news entry to focus on the user-visible outcome.
rickeylev
approved these changes
Nov 14, 2026
Collaborator
|
Other than comment under what conditions the bazel_tools zipper doesn't exist, this LGTM. I set my agent to researching that, but i'm always wary of the claims it comes back with. |
All Unix Bazel builds (including source/distro bazel_nojdk builds) embed @bazel_tools//tools/zip:zipper/zipper in embedded_tools, so drop the unreachable zipper.exists guard and update the docstrings to reflect that host zip is only used when paths contain '=' or newlines.
rickeylev
approved these changes
Nov 14, 2026
rickeylev
enabled auto-merge
November 14, 2026 22:55
Collaborator
|
Thanks for the fix! It sounds like you're running on minimal containers? Such issues have been fixed and brought up before, and there's variety of places where there are assumptions about system utilities. PRs to help address that are welcome. |
Merged
via the queue into
bazel-contrib:main
with commit Nov 15, 2026
45a8eef
15 of 17 checks passed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Patching a wheel with
pip.overriderepacks it with the hostzip, sothe repository rule fails on a host without a
zipbinary, such as aminimal container.
To fix, use Bazel's bundled zipper on non-Windows hosts via a params
file (
name=pathentries), falling back to hostziponly when filepaths contain
=or a newline. The zipper also writes a fixedtimestamp, so the repacked wheel is reproducible.