Repository navigation
ci: Use hermetic llvm-strip for image binaries - #48869
Merged
Merged
Conversation
`cp_binary_for_image_build` ran binutils `strip` from the build image. Resolve the LLVM toolchain's `llvm-strip` as `STRIP_BIN` instead, which also strips GCC-built binaries, so this does not depend on the build image (eg the minimal `ci` image, which has no binutils). Signed-off-by: Ryan Northey <[email protected]>
jwendell
previously approved these changes
Oct 30, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
When STRIP_BIN is unset, resolving the strip tool can redirect bazel-bin to a different build output, causing subsequent packaging steps to fail on missing inputs or include stale binaries.
1 open issue
What changed in this PR
This PR removes image packaging’s dependency on system binutils by using the hermetic LLVM toolchain’s llvm-strip, including for GCC-built binaries.
Changes:
- Adds a helper to resolve and export
STRIP_BIN. - Uses the resolved tool to strip validation tools and the Envoy image binary.
| File | Description |
|---|---|
ci/do_ci.sh |
Replaces system strip calls with STRIP_BIN during image preparation. |
ci/bazel_fun.sh |
Adds cached resolution of the hermetic llvm-strip executable. |
Review effort: Balanced
|
|
||
| # Tools for the tools image. Strip to save size. | ||
| strip bazel-bin/test/tools/schema_validator/schema_validator_tool \ | ||
| hermetic_strip |
`bazel_tool_path` builds the tool with the default options, which repointed `bazel-bin` away from the caller's build (eg `-c opt`), so image packaging could read missing or stale binaries after `hermetic_strip`. Build with `--experimental_convenience_symlinks=ignore` so the caller's symlinks are left alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
jwendell
approved these changes
Oct 30, 2026
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 9, 2026
`cp_binary_for_image_build` ran binutils `strip` from the build image. Resolve the LLVM toolchain's `llvm-strip` as `STRIP_BIN` instead, which also strips GCC-built binaries, so this does not depend on the build image (eg the minimal `ci` image, which has no binutils). --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit ac6af8d) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 11, 2026
`cp_binary_for_image_build` ran binutils `strip` from the build image. Resolve the LLVM toolchain's `llvm-strip` as `STRIP_BIN` instead, which also strips GCC-built binaries, so this does not depend on the build image (eg the minimal `ci` image, which has no binutils). --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit ac6af8d) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
to phlax/envoy
that referenced
this pull request
Nov 12, 2026
`cp_binary_for_image_build` ran binutils `strip` from the build image. Resolve the LLVM toolchain's `llvm-strip` as `STRIP_BIN` instead, which also strips GCC-built binaries, so this does not depend on the build image (eg the minimal `ci` image, which has no binutils). --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit ac6af8d) Signed-off-by: Ryan Northey <[email protected]>
phlax
added a commit
that referenced
this pull request
Nov 12, 2026
`cp_binary_for_image_build` ran binutils `strip` from the build image. Resolve the LLVM toolchain's `llvm-strip` as `STRIP_BIN` instead, which also strips GCC-built binaries, so this does not depend on the build image (eg the minimal `ci` image, which has no binutils). --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit ac6af8d) 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.

cp_binary_for_image_buildran binutilsstripfrom the build image. Resolve the LLVM toolchain'sllvm-stripasSTRIP_BINinstead, which also strips GCC-built binaries, so this does not depend on the build image (eg the minimalciimage, which has no binutils).