Repository navigation
bazel/pigz: Allow a pigz on the host, by path - #5605
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The host pigz target is rejected during Bazel analysis, the rendering assertion always fails, and toolchain registration incorrectly prioritizes the host over matching prebuilts.
3 open issues
What changed in this PR
Adds a configurable host-installed pigz to Bazel’s compression toolchains, intended as a fallback when no prebuilt is available or the matching prebuilt is disabled.
Changes:
- Adds
setup(host_path = ...)with path validation, file watching, and host platform constraints. - Documents host-toolchain usage and remote-execution requirements, and updates the unavailable-toolchain message.
- Adds rendering and platform-mapping tests and refreshes the extension lockfile entry.
| File | Description |
|---|---|
| bazel/pigz/toolchain.bzl | Mentions host configuration in the fallback error. |
| bazel/pigz/test/pigz_test.bzl | Tests host-toolchain rendering and platform mapping. |
| bazel/pigz/test/BUILD | Registers the host platform-mapping test. |
| bazel/pigz/README.md | Documents host setup and intended resolution priority. |
| bazel/pigz/private/pigz_prebuilt.bzl | Validates and links host pigz and generates its toolchain. |
| bazel/pigz/extensions.bzl | Exposes and forwards the host_path option. |
| bazel/MODULE.bazel.lock | Records the updated extension digest and attribute. |
Review effort: Balanced
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 17, 2026
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Backport note (workspace): the path is set with `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. (cherry picked from commit 77185d7) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 17, 2026
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Backport note (workspace): the path is set with `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. (cherry picked from commit 77185d7) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 17, 2026
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Backport note (workspace): the path is set with `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. (cherry picked from commit 77185d7) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 17, 2026
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Backport note (workspace): the path is set with `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. (cherry picked from commit 77185d7) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 17, 2026
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Backport note (workspace): the path is set with `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. (cherry picked from commit 77185d7) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/toolshed
that referenced
this pull request
Nov 17, 2026
…allow the libcxx LLVM version to be set Port `//oci` (`oci_base_edit`), `//pigz` and `//tarball:compressed_tar.bzl` from `main` at bazel-v0.5.22, so Envoy's WORKSPACE release branches (`release/v1.39` and earlier) can build their release container images with rules_oci and gzip the packages with all the cores, as `main` and `release/v1.40` do. Backported, with what differs from `main`: - envoyproxy#5597 `oci_base_edit`: as on `main`. - envoyproxy#5601 hermetic pigz: the toolchain and the prebuilt repositories only. `setup_pigz()` and `load_pigz_toolchains()` (`//pigz:repositories.bzl`) replace the module extension, as `//pgp` does for `sq`, and this repo's `WORKSPACE` calls both. The source build and its packaging stay on `main`, which publishes the prebuilts. The README describes them as `main` now builds them (against zlib-ng, envoyproxy#5606, which has nothing else to backport here). `repository_ctx.repo_metadata` is only called where Bazel has it: Envoy's `release/v1.38` and earlier use Bazel 7. - envoyproxy#5605 a pigz on the host, by path: `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. - envoyproxy#5607 `compressed_tar`: as on `main`. zstd uses the consumer's `@zstd` (Envoy has one; this branch's toolshed does not), so only gzip is tested here, on Linux only. Also, not a backport: `setup_libcxx_libs(llvm_version = ...)`. The libc++ bundles for cross-compiling are fetched for toolshed's LLVM (22.1.8), but Envoy's `release/v1.39` and earlier compile with LLVM 18.1.8, so a cross-compile there (arm64 from x64, as the one-job release build does) gets LLVM 18's headers with LLVM 22's `__config_site` and fails. The option selects the bundles of the consumer's LLVM, from the bins release that published them (0.1.59 for 18.1.8). The prebuilt hashes (`VERSIONS["pigz_sha256"]`) are empty, as in envoyproxy#5601, for the release preparation to set: the `_release.yml` step that does that comes with envoyproxy#5601 too. This branch has no source toolchain to fall back to, so `//pigz` is `manual` (there is no pigz without a prebuilt for the platform), and the tests that run it are `manual` until the hashes are set. (cherry picked from commit 0dbd94a) (cherry picked from commit fc8e06e) (cherry picked from commit 77185d7) (cherry picked from commit 49947f3) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
that referenced
this pull request
Nov 17, 2026
`pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")` adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled, rather than building pigz or failing. The path must be absolute and exist (it is watched, so a change re-evaluates the toolchains), and the host must be Linux or macOS on x86_64 or aarch64; otherwise the hub fails, with the reason. The hub is not reproducible with a host pigz. The fallback's failure now points at the option too. Backport note (workspace): the path is set with `setup_pigz(host_path = ...)`. The prebuilts are not configurable here, so a prebuilt for the host always takes precedence. (cherry picked from commit 77185d7) Signed-off-by: Ryan Northey <[email protected]>
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.


pigz_prebuilt_extension.setup(host_path = "/abs/path/pigz")adds a toolchain over that pigz for the host's OS and CPU, after the prebuilts: so it is used where there is no prebuilt (eg macOS), or where the prebuilt is disabled (linux_x86_64_sha256 = ""), rather than requiring a source build or failing.//pigzthen resolves: the prebuilt, the host pigz, a consumer's source toolchain, else the failing fallback (whose message now mentionshost_path).repo_metadata).Tests: the hub rendering with a host toolchain (after the prebuilts, and alone), and the host OS/CPU mapping.