Skip to content

bazel/pigz: Build pigz against zlib-ng - #5606

Merged
phlax merged 1 commit into
envoyproxy:mainfrom
phlax:pigz-zlib-ng
Nov 14, 2026
Merged

phlax merged 1 commit into
envoyproxy:mainfrom
phlax:pigz-zlib-ng

Conversation

@phlax

@phlax phlax commented Nov 14, 2026

Copy link
Copy Markdown
Member

Build the published pigz (and toolshed's source toolchain) against zlib-ng, zlib-compatible, in place of zlib: faster compression at the same level, with standard gzip output.

pigz is a dev dependency, so the override applies only to toolshed's own builds (the packages, and its tests): a patch to the pigz module's binary deps, to the canonical @@zlib-ng+//:zlib - the patched module still depends on zlib in the module graph, so @zlib-ng is not visible from it. bazel query confirms zlib-ng's is the only zlib library pigz links.

The packages ship zlib-ng's license (share/doc/zlib-ng/LICENSE.md) in place of zlib's; the package test checks it.

Being measured in envoy-ci-staging (envoy's release image layers).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the pigz migration to zlib-ng.

No open issues 🎉

What changed in this PR

Switches toolshed’s published pigz binaries and source toolchain from zlib to zlib-ng, aiming to improve compression speed while preserving standard gzip output.

Changes:

  • Adds a development-only zlib-ng dependency and patches pigz to link against it.
  • Replaces the packaged zlib license with zlib-ng’s license and updates package assertions.
  • Updates documentation and refreshes Bazel lockfile metadata.
File Description
bazel/​pigz/​test/​assert_pigz_package.sh Checks for the zlib-ng license and updates the static-linking comment.
bazel/​pigz/​source/​BUILD Packages the zlib-ng license.
bazel/​pigz/​README.md Documents zlib-ng linkage and package contents.
bazel/​pigz/​private/​pigz-zlib-ng.patch Redirects pigz’s zlib dependency to zlib-ng.
bazel/​pigz/​private/​licenses/​zlib-ng Adds the zlib-ng license notice.
bazel/​pigz/​private/​licenses/​zlib Removes the replaced zlib license notice.
bazel/​pigz/​private/​BUILD Exports the new license and dependency patch.
bazel/​MODULE.bazel.lock Records zlib-ng metadata and refreshes cached repository specifications.
bazel/​MODULE.bazel Adds zlib-ng and applies the pigz module patch.

Review effort: Balanced

Build the published pigz (and toolshed's source toolchain) against
zlib-ng, zlib-compatible, in place of zlib: faster compression at the
same level, with standard gzip output.

pigz is a dev dependency, so the override (a patch to the `pigz`
module's binary, to the canonical `@@zlib-ng+//:zlib`, as the patched
module still depends on `zlib`) applies only to toolshed's own builds:
the packages, and its tests. The packages ship zlib-ng's license in
place of zlib's.

Signed-off-by: Ryan Northey <ryan@synca.io>
@phlax
phlax merged commit 9094b93 into envoyproxy:main Nov 14, 2026
56 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.

2 participants