Skip to content

ci: Use hermetic llvm-strip for image binaries - #48869

Merged
phlax merged 2 commits into
envoyproxy:mainfrom
phlax:ci-hermetic-strip-main
Oct 30, 2026
Merged

phlax merged 2 commits into
envoyproxy:mainfrom
phlax:ci-hermetic-strip-main

Conversation

@phlax

@phlax phlax commented Oct 30, 2026

Copy link
Copy Markdown
Member

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).

`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]>
@phlax phlax changed the title kci: Use hermetic llvm-strip for image binaries ci: Use hermetic llvm-strip for image binaries Oct 30, 2026
@phlax
phlax requested a balanced review from Copilot October 30, 2026 13:16
jwendell
jwendell previously approved these changes Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment thread ci/do_ci.sh

# 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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reported for the switch to hermetic llvm-strip for image binaries.

1 open issue

Review effort: Balanced

@phlax
phlax requested a review from jwendell October 30, 2026 13:32
@phlax
phlax enabled auto-merge (squash) October 30, 2026 13:35
@phlax
phlax merged commit ac6af8d into envoyproxy:main Oct 30, 2026
30 of 34 checks passed
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]>
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.

3 participants