Skip to content

[bp/1.40] CI/toolshed/deps stack - #49053

Merged
phlax merged 27 commits into
envoyproxy:release/v1.40from
phlax:bp-1.40-toolshed
Nov 12, 2026
Merged

phlax merged 27 commits into
envoyproxy:release/v1.40from
phlax:bp-1.40-toolshed

Conversation

@phlax

@phlax phlax commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

The remaining CI, toolchain and dependency backports for release/v1.40, on top of #49174 and #49184.

In the order they landed on main, with lockfiles regenerated for each commit that changes module inputs:

Not clean cherry-picks:

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

A missing Wasmtime runtime target breaks build analysis, while excluded CVE Program files and non-recursive downloads prevent vulnerability scans from running.

3 open issues
What changed in this PR

This backport updates Envoy 1.40’s CI and build tooling to use more hermetic tools and shared implementations from toolshed.

Changes:

  • Upgrade toolshed and migrate GCC, Git, spelling, coverage, and CVE tooling.
  • Update CI image selection, compiler checks, execution-context testing, and downstream workspace configuration.
  • Remove superseded tooling and update documentation, build dependencies, and test fixtures.
File Description
tools/​toolchain/​detect.cc Exercise Linux sysroot APIs and report GCC selection.
tools/​toolchain/​BUILD Define the GCC-selection indicator.
tools/​testdata/​spelling/​punctuation Add punctuation regression fixtures.
tools/​testdata/​spelling/​non_ascii Add non-ASCII regression fixtures.
tools/​spelling/​spelling_dictionary.txt Extend accepted vocabulary.
tools/​spelling/​defs.bzl Expose Hunspell toolchain files.
tools/​spelling/​check_spelling_pedantic.py Replace Aspell with Hunspell and refine token handling.
tools/​spelling/​check_spelling_pedantic_test.py Assert exact spelling-error locations.
tools/​spelling/​BUILD Wire hermetic Hunspell and dictionary inputs.
tools/​proto_format/​BUILD Use toolchain-provided Git for API hashes.
tools/​git/​modified_since_last_github_commit.sh Honor GIT_BIN.
tools/​git/​last_github_commit.sh Honor GIT_BIN.
tools/​git/​defs.bzl Expose Git toolchain runtime and executable.
tools/​git/​BUILD Publish Git helper targets.
tools/​dependency/​version.jq Remove local version-comparison implementation.
tools/​dependency/​cves.sh Remove local CVE scanner driver.
tools/​dependency/​cve_utils.jq Remove local CVE matching utilities.
tools/​dependency/​cve_update.sh Remove local CVE update driver.
tools/​dependency/​cve_test.sh Remove local CVE validation script.
tools/​dependency/​cve_report.jq Remove local CVE reporting implementation.
tools/​dependency/​cve_matcher.jq Remove local CVE matcher entry point.
tools/​dependency/​cve_fetch.py Remove local CVE downloader.
tools/​dependency/​BUILD Adopt toolshed’s CVE scan macro.
tools/​dependency/​ansi.jq Remove superseded report-color utilities.
tools/​coverage/​validate.sh Remove local coverage validation script.
tools/​coverage/​templates/​macros.html Remove local coverage template macros.
tools/​coverage/​templates/​index.html Remove local coverage index template.
tools/​coverage/​templates/​base.html Remove local coverage base template.
tools/​coverage/​report_generator.sh.template Remove local coverage report driver.
tools/​coverage/​filter.jq Remove local coverage processing logic.
tools/​coverage/​BUILD Adopt toolshed’s coverage report macro.
tools/​code_format/​config.yaml Remove obsolete toolchain formatting exclusion.
tools/​code_format/​check_format.py Honor GIT_BIN in visibility checks.
test/​run_envoy_bazel_coverage.sh Delegate coverage execution through a compatibility wrapper.
test/​fuzz/​README.md Document toolshed fuzz-coverage commands.
test/​extensions/​filters/​http/​mcp_json_rest_bridge/​http_request_builder_test.cc Correct fixture spelling and expected URLs.
test/​exe/​BUILD Make LLVM readelf an unconditional test dependency.
test/​common/​upstream/​BUILD Assign a lifecycle test to a remote-execution pool.
test/​common/​tls/​context_impl_test.cc Use the generated certificate hash constant.
source/​extensions/​wasm_runtime/​wasmtime/​BUILD Add a Rust runtime dependency.
source/​extensions/​dynamic_modules/​sdk/​rust/​BUILD Update sysroot header labels.
source/​common/​http/​http1/​legacy_parser_impl.cc Suppress a vendored macro’s cast warning locally.
MODULE.bazel Upgrade toolshed and configure shared toolchains.
mobile/​test/​BUILD Add mobile coverage report targets.
mobile/​MODULE.bazel Update dependencies and toolshed extensions.
mobile/​bazel/​platforms.bzl Remove the local platform-alias helper.
mobile/​bazel/​extensions.bzl Remove platform setup and add explicit rule loads.
mobile/​.bazelrc Select mobile-specific coverage targets.
docs/​MODULE.bazel Update dependencies and platform-alias setup.
docs/​bazel/​get_workspace_status Honor GIT_BIN for build metadata.
compat/​openssl/​prefixer/​BUILD Use hermetic static libstdc++.
ci/​run_envoy_docker.sh Default CI to the minimal image.
ci/​README.md Document GCC modes, Git tooling, and execution-context testing.
ci/​matrix/​test.sh Extend compiler resolution and host-override checks.
ci/​matrix/​README.md Document hermetic compiler expectations.
ci/​matrix/​docker-compose.yml Update GCC expectations and enable host-override checks.
ci/​format_pre.sh Use resolved Git for formatting diffs.
ci/​envoy_build_sha.sh Remove GCC-specific image selection.
ci/​do_ci.sh Integrate hermetic tools and revise test modes.
ci/​check_and_fix_format.sh Use resolved Git for API patches.
ci/​bazel_fun.sh Add Bazel-backed tool resolution helpers.
ci.bazelrc Override the host platform for remote-execution info queries.
changelogs/​current/​minor_behavior_changes/​build__hermetic-gcc.rst Describe the hermetic GCC migration.
bazel/​toolchains.bzl Remove the legacy libstdc++ toggle.
bazel/​tests/​external/​MODULE.bazel Update toolshed and platform aliases.
bazel/​tests/​external/​.bazelrc Advance the registry pin.
bazel/​tests/​codeql/​README.md Document toolshed’s host LLVM interface.
bazel/​tests/​codeql/​MODULE.bazel Migrate host LLVM configuration to toolshed.
bazel/​tests/​codeql/​.bazelrc Update the registry and isolate CI settings.
bazel/​repo.bzl Remove legacy GCC settings and load shell rules explicitly.
bazel/​README.md Document compiler, coverage, and spelling migrations.
bazel/​rbe/​toolchains/​README.md Remove obsolete generated-toolchain instructions.
bazel/​rbe/​toolchains/​linux.latest.bazelrc Remove legacy remote GCC configuration.
bazel/​rbe/​toolchains/​gcc.env.json Remove host GCC environment settings.
bazel/​rbe/​toolchains/​empty.bzl Remove obsolete toolchain metadata.
bazel/​rbe/​toolchains/​configs/​linux/​LICENSE Remove the deleted toolchain’s bundled license file.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​config/​BUILD Remove legacy GCC registration and platform.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​cc/​WORKSPACE Remove generated workspace metadata.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​cc/​tools/​cpp/​empty.cc Remove the obsolete toolchain stub.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​cc/​cc_wrapper.sh Remove the host GCC wrapper.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​cc/​builtin_include_directory_paths Remove host-specific include paths.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​cc/​BUILD Remove generated host GCC targets.
bazel/​rbe/​toolchains/​configs/​linux/​gcc/​cc/​armeabi_cc_toolchain_config.bzl Remove the legacy ARM toolchain stub.
bazel/​rbe/​toolchains/​BUILD Remove the GCC-specific remote platform.
bazel/​get_workspace_status Honor GIT_BIN for build metadata.
bazel/​gcc/​defs.bzl Report unsupported GCC platforms explicitly.
bazel/​gcc/​BUILD Register opt-in GCC and fallback toolchains.
bazel/​external/​BUILD Load the static-library rule explicitly.
bazel/​extensions.bzl Delegate LLVM setup and retain migration shims.
bazel/​deps.yaml Update toolshed release metadata.
bazel/​BUILD Add unwinder controls and GCC-selection settings.
api/​MODULE.bazel Upgrade toolshed and remove its separate jq dependency.
api/​bazel/​deps.yaml Update toolshed release metadata.
api/​bazel/​cc_proto_descriptor_library/​text_format_transcoder.cc Fail explicitly on malformed embedded descriptors.
api/​bazel/​cc_proto_descriptor_library/​BUILD Add the logging dependency.
api/​.bazelrc Update the registry and isolate CI settings.
.gitignore Ignore Hunspell’s personal dictionary file.
.github/​workflows/​toolchain-test.yml Expand toolchain-test path triggers.
.github/​workflows/​envoy-dependency.yml Remove GCC-image update fields.
.github/​workflows/​_run.yml Add explicit devtools-image selection.
.github/​workflows/​_precheck_format.yml Remove an outdated host-tool comment.
.github/​workflows/​_cve_scan.yml Invoke the toolshed-generated scan test.
.github/​workflows/​_cve_fetch.yml Invoke the toolshed updater with refresh controls.
.github/​workflows/​_check_build.yml Add an execution-context matrix entry.
.github/​config.yml Add execution-context triggers and remove the GCC-image digest.
.devcontainer/​Dockerfile.in Stop installing Aspell.
.bazelrc Update compiler, unwinder, coverage, and registry settings.

Review effort: Balanced

Comment thread .github/workflows/_cve_scan.yml Resolved
Comment thread tools/dependency/BUILD Resolved
@phlax
phlax requested a balanced review from Copilot November 6, 2026 15:01
@phlax phlax changed the title [bp/1.40] CI/toolshed stack [bp/1.40] CI/toolshed/deps stack Nov 6, 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

The prefixer’s hard-coded x86_64 runtime breaks native ARM builds, while the coverage wrapper bypasses CI startup options and can publish stale reports.

3 open issues
3 resolved since last review

Review effort: Balanced

Comment thread compat/openssl/prefixer/BUILD Resolved
Comment thread test/run_envoy_bazel_coverage.sh Resolved
Comment thread test/run_envoy_bazel_coverage.sh Resolved
@phlax phlax changed the title [bp/1.40] CI/toolshed/deps stack [WIP/bp/1.40] CI/toolshed/deps stack Nov 6, 2026
@phlax
phlax marked this pull request as draft November 6, 2026 16:14
@phlax
phlax requested a balanced review from Copilot November 9, 2026 09:45

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

The unsupported target_compatible_with argument causes envoy_cc_test to fail when loading //test/exe on every platform, blocking builds and test queries that include the package.

1 open issue
3 resolved since last review

Review effort: Balanced

Comment thread test/exe/BUILD Resolved

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

phlax and others added 15 commits November 12, 2026 08:22
With git (envoyproxy#48874), jq and hunspell (envoyproxy#48894) now hermetic, CI no longer
needs the devtools build image. ci/run_envoy_docker.sh now uses the
minimal ci image whenever it runs under GitHub Actions, rather than only
for jobs that set docker-ci.

Jobs that still need devtools opt in with the new devtools workflow
input (ENVOY_DOCKER_DEVTOOLS). For now that is only mobile docs
publishing, whose publish.sh runs host git outside do_ci.sh. Local and
devcontainer use keeps devtools. The selection lives in each branch's
script, so release branches, which run main's workflows, keep their
existing behaviour.

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 0545bf5)
Signed-off-by: Ryan Northey <[email protected]>
…oxy#49051)o

Pairs with the toolshed scanner change adding cvelistV5 records as a
source for CVEs that NVD has not analyzed: glob the `cve_data/cvelist/`
month files into the scan data, sync the subdirectory from the bucket,
and pass a token for the fetcher's release lookup.

Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 8fc0b64)
Signed-off-by: Ryan Northey <[email protected]>
`exec` bypasses the exported `bazel` function from `ci/build_setup.sh`,
dropping the CI startup options (`--output_user_root`/`--output_base`),
so under CI the coverage run used a default output base instead of the
configured one. Call it as a command like the other CI scripts do.

Signed-off-by: Ryan Northey <[email protected]>
(cherry picked from commit 9e8c36e)
Signed-off-by: Ryan Northey <[email protected]>
Created by Envoy dependency bot for @phlax

Signed-off-by: dependency-envoy[bot]
<148525496+dependency-envoy[bot]@users.noreply.github.com>

Signed-off-by: dependency-envoy[bot] <148525496+dependency-envoy[bot]@users.noreply.github.com>
Co-authored-by: dependency-envoy[bot] <148525496+dependency-envoy[bot]@users.noreply.github.com>
(cherry picked from commit 4b80277)
Signed-off-by: Ryan Northey <[email protected]>
…48966)

actions/checkout 7 refuses to fetch a fork PR's head or merge commit in
a `pull_request_target` workflow when the ref matches the event's
`pull_request.merge_commit_sha` or `head.sha`. The request job fetches
the PR's merge commit to read its CI config, which it does on purpose
and without executing anything from the checkout, so it has to opt in.

This only bites when the event payload carries `merge_commit_sha`, which
GitHub fills in asynchronously, so most fork PRs have been passing since
the toolshed bump to checkout 7.0.1 (envoyproxy#48133) and some fail at the
checkout (run 41670586329).

Signed-off-by: Ryan Northey <[email protected]>
Since 2026-11-09T22:58Z restoring the cached build image intermittently
leaves Docker unable to start on GitHub's hosted runners ("Job for
docker.service failed"), failing jobs in their first 20s. The cache blob
(primed 2026-10-21), the runner image (20261101.360 since 2026-11-03)
and the restore path are unchanged, so this is on the runner side, and
the restore action discards the journal that would say why.

Since envoyproxy#48963 the CI build image is 275 MiB in six layers, pulled in
seconds, so the cache saves nothing worth stopping Docker and swapping
/var/lib/docker under sudo on every job. Drop the restore from the run
workflow and stop priming the cache; the cache-build-image inputs are
kept so callers need not change.

Signed-off-by: Ryan Northey <[email protected]>
…ols (envoyproxy#49130)

Each coverage test action uploaded its raw profile (141MB for an
integration test, 89% of it a copy of the binary's symbol table) for a
separate postprocessing action to download again: ~160GB in and out of
the CAS and 7 worker-hours of postprocess actions per full run, plus a
9GB merge on the runner.

Run the postprocessing inside the test action instead, and use
toolshed's coverage tools for it: `llvm-cov` exports line coverage for
workspace sources only (function and branch records, and external code,
are never read by the report), and the lcov merger strips what remains
and removes the coverage directory's intermediates before the test's
outputs are uploaded.

Measured on a full run (1,597 tests, 96.9% before and after): CAS
uploads 133GB -> 1.35GB, no postprocess actions, coverage phase 838s ->
650s, critical path 346s -> 287s, report merge 107s -> 27s.

Signed-off-by: Ryan Northey <[email protected]>
…envoyproxy#49140)

The coverage report (grcov) spent ~30s of its ~44s parsing and merging
the ~1,600 per-test tracefiles, on the critical path after the last test
finishes; the baseline report rendered a second time for nothing.
toolshed 0.5.20's coverage_report takes a prebuilt lcov-merge (bins
release 0.2.32) that merges them in a few seconds and hands grcov one
file; the baseline report becomes the merged tracefile. On platforms
without the prebuilt (s390x, ppc64le, macOS) the report is unchanged.

Requires envoy_toolshed 0.5.20.envoy.

Signed-off-by: Ryan Northey <[email protected]>
…oxy#49129)

The deflake workflow could only test commits already on main: the
checkout asserts the ref is an ancestor of the current branch. Add `pr`,
`ref` and `repository` inputs, fetched after the trusted checkout, so a
flake can be reproduced from a pull request's merge ref or a branch on a
fork before a fix lands, and a `timeout-minutes` input for long runs.

Testing a pull request, ref or fork branch runs code that is not on this
branch, so the job runs untrusted, as in PR CI: no app token, no deploy
key, no signing keys. `_run.yml` enforces this itself rather than
leaving it to each caller — the checkout step refuses
`checkout-ref`/`checkout-pr` with `trusted: true`, and fails when
`checkout-repository` is given without a ref rather than silently
testing this branch. The run keeps this branch's Actions cache scope, so
only dispatch code you would push to this repository.

Signed-off-by: Ryan Northey <[email protected]>

---------

Signed-off-by: Ryan Northey <[email protected]>
When `update_registry.check` fails, its message is not picked up by the
CI error matcher, making the failure hard to find in the logs. Emit a
`FAIL:` line to stderr so it is surfaced.

Signed-off-by: Jonh Wendell <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
…y#48870)

Add an `update` input to the `registry` task of the dependency workflow,
passed through update.sh and `do_ci.sh registry` to `registry_update`:

- `*` bumps every module (in every nested MODULE.bazel) that has a newer
version available in the envoy bazel-registry, as reported by the
toolshed module updater after the pin has moved.
- `name` bumps that module to its latest registry version, `name=1.2.3`
to that version; specs are space separated and applied in every module
that declares them, as `deps.update` does.
- `*` is rejected when combined with other specs, and `update` is
rejected for the `bazel` and `lockfiles` tasks.

Inside the build container the command is exec'd unquoted, where a bare
`*` would glob, so update.sh passes it as `all`; `registry_update`
accepts either. Lockfiles are regenerated once at the end.

---------

Signed-off-by: Ryan Northey <[email protected]>
@phlax
phlax marked this pull request as ready for review November 12, 2026 08:31
@phlax phlax changed the title [WIP/bp/1.40] CI/toolshed/deps stack [bp/1.40] CI/toolshed/deps stack Nov 12, 2026
@phlax
phlax requested a balanced review from Copilot November 12, 2026 08:33

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.

🔵 Needs a closer look

The post-release chain waits only for docs archival, allowing branch reopening and next-release PR creation before publication completes or even if it fails; it must also require the github job to succeed.

4 open issues

Review effort: Balanced

…9203)

The `github/run` action splits `command` on whitespace and does not
parse it as shell, so the sync task's quoted `--signoff="Name <email>"`
was cut in two and the commit ended up with a malformed trailer:

  Signed-off-by: "publish-envoy[bot]

Pass the signoff as an array from `source`, as the create-release task
already does.

The reopen-branch (`dev`) task did not pass a signoff at all, so its
commits had none. Give it the same one.

Backport note: picked from the pull request ahead of its merge to main.

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.

🔵 Needs a closer look

The toolchain, coverage-action, and privileged release-workflow backports require cross-platform GCC/Clang CI and end-to-end release dry-run validation that static review cannot establish.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

…yproxy#49166)

The `prefixer` links the hermetic GCC runtime's `libstdc++.a`
(`//compat/openssl/prefixer:libstdcxx`), which defaulted to
`@gcc_runtime_linux_x86_64`. On a Linux aarch64 host the tool is built
for aarch64 but linked against the x86_64 archive, so `--config=openssl`
fails with `libstdc++.a(...) is incompatible with elf64-littleaarch64`.

Declare `gcc_runtime_linux_aarch64` (toolshed's `gcc_extension` already
supports `arch = "aarch64"`) and make the flag's default follow the CPU
via an `alias` and a `select`. The x86_64 default is unchanged.

Additional Description:

- `build_setting_default` of a `label_flag` cannot be a `select`, hence
the `alias`.
- The `select` is evaluated in the configuration the `prefixer` is built
for, so an aarch64 build picks the aarch64 runtime and any other CPU
keeps the previous x86_64 default.
- aarch64 builds now fetch toolshed's aarch64 GCC runtime archive for
the `prefixer`.
- No C++ is added, so there is no unit test or coverage to add
(CONTRIBUTING.md asks for an explanation when 100% coverage is not
possible). This is a BUILD/MODULE-only change that is verified by
building.
- Related: envoyproxy#48840 and envoyproxy#39632 introduced the hermetic libstdc++ but kept
an x86_64-only default.
- AI assistance: this change was drafted and tested with the help of
Claude Code. I reviewed it and understand every line of it, and I will
answer review comments myself.

Risk Level: Low (build configuration of a build-time tool; the default
branch is unchanged).

Testing:
Manual, on a Linux aarch64 host (NVIDIA BlueField-3 DPU), Bazel 9.3.2,
from a clean output base, with this commit on top of `main` 363c84b
(`envoy_toolshed` 0.5.20):

```
bazel build -c opt --config=openssl //compat/openssl/prefixer:prefixer //compat/openssl:prefixed_ossl_source //compat/openssl:bssl-compat
```

- After: the build completes successfully (2861 actions).
- After: `file` on the `prefixer` reports `ELF 64-bit LSB pie
executable, ARM aarch64`, and the `CppLink` action of the `prefixer`
(`bazel aquery`) references only
`gcc_runtime_linux_aarch64/aarch64-linux/lib64/libstdc++.a`.
- After: the only `gcc_runtime` and `llvm_minimal` repositories in the
output base are `gcc_runtime_linux_aarch64` and
`llvm_minimal_linux_arm64`; the x86_64 ones are not fetched.
- Before (same host, `main` without this change, earlier base 93aab93):
`//compat/openssl/prefixer:prefixer` fails with `libstdc++.a(...) is
incompatible with elf64-littleaarch64`.

Not tested: a full `//source/exe:envoy-static` build, x86_64 hosts (left
to CI), cross-compilation.

Docs Changes: N/A (`bazel/SSL.md` already lists aarch64 as supported for
OpenSSL).

Platform Specific Features: Linux aarch64 only; other platforms are
unchanged.

Fixes envoyproxy#49165

---------

Signed-off-by: Cong Son <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>

@jwendell jwendell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe drop the gcc commits

• #39632 ( bazel: Switch to hermetic gcc toolchains ), including  changelogs/current/minor_behavior_changes/build__hermetic-gcc.rst 
• #48632 ( bazel/gcc: Enable prebuilt wee8 )
• #48631 ( gcc/ci: Quieten logging ), unless it's still useful with the existing GCC toolchain

Switching the toolchain in a stable release may force users to adapt their build systems when they don't need to...

@phlax
phlax merged commit 1de4e1f into envoyproxy:release/v1.40 Nov 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants