Repository navigation
proxy: trim wasm + dynamic modules from the compiled-in extension set; arm64 leg on a native runner - #704
Conversation
5023986 to
099d090
Compare
099d090 to
589753b
Compare
…; arm64 leg on a native runner
`proxy/bazel/extension_config/extensions_build_config.bzl` was not a curated
subset — it was a 659-line VERBATIM copy of Envoy v1.38.0's default that
customised nothing and had silently fallen a release behind the v1.39.0 pin (it
was missing nine extensions v1.39.0 added). Replace it with the upstream
downstream-build shape (envoyproxy/examples/filter-cc): load Envoy's default at
the pinned version and subtract, so an Envoy bump picks up new upstream
extensions for free and the `_DROPPED` list is the whole of our policy.
Dropped:
* `wasm` — aether emits no wasm filter/runtime/access-logger/stat-sink
anywhere. Takes the v8/wasmtime/wamr/emsdk build with it.
* `dynamic_module` — superseded for aether by proposal 012 (aether_stats is a
compiled-in C++ filter; the Rust dynamic-module approach was dropped) and
proposal 025's escape hatch is CRD-based. Takes the Rust toolchain,
crate_universe, bindgen/libclang and llvm-objcopy with it.
* `hickory` — `envoy.network.dns_resolver.hickory`, the one extension outside
those two groups that reaches the dynamic-modules machinery. Its name
carries no hint of it, so the first attempt kept it and `//:envoy` failed to
link on both arches with ~every `envoy_dynamic_module_callback_*` symbol
undefined: hickory deps on
`//source/extensions/dynamic_modules/builtin_extensions:hickory_dns_static`,
a Rust static library that CALLS those callbacks, while their definitions
live in `//source/extensions/dynamic_modules:abi_impl`, which only the
dropped extensions pull in. Safe to drop — aether configures no
`typed_dns_resolver_config` anywhere, so Envoy uses its default c-ares
resolver, and `dns_resolver.{cares,getaddrinfo}` both stay.
Net at v1.39.0: 330 upstream − 27 dropped = 303 compiled in, against 317 before.
Because the dynamic-modules extensions are gone, so is everything that existed
only to build them on arm64:
* `proxy/bazel/patches/` — both @envoy source patches (Rust-SDK libclang,
dynamic-modules llvm-objcopy) pointed at `@llvm_toolchain_aarch64`;
* the `@llvm_toolchain_aarch64` WORKSPACE block itself.
`CARGO_BAZEL_REPIN` does NOT go away here, though: @envoy's
`bazel/dependency_imports_extra.bzl` has a top-level
`load("@envoy_rust_crate_index//:defs.bzl", ...)`, so WORKSPACE evaluation fetches
the crate_universe repo whatever the extension set is. It goes with bzlmod (#697).
`@llvm_toolchain_aarch64` (a second llvm_toolchain with `exec_arch = "aarch64"`)
existed because `@clang_platform` and Envoy's `@llvm_toolchain` derive their
exec constraints from the DRIVER host's arch, so an x64 driver produced an
x86_64-exec cross toolchain that cannot satisfy an aarch64 exec platform.
`proxy-release.yml` already sidesteps this by running its arm64 leg on
`ubuntu-24.04-arm`; `proxy.yml` now does the same, which is what makes the
second toolchain removable.
This lands the two riskiest *semantic* changes of the bzlmod migration (#697)
against a known-good WORKSPACE build at v1.39.0, so that if `//:envoy` fails to
link it is unambiguously the extension trim and not bzlmod. It already paid for
itself: the hickory link failure above would otherwise have surfaced inside the
bzlmod PR, indistinguishable from a migration bug.
Refs #697
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
589753b to
57e61c0
Compare
CI run 1 & 2 findings (both fixed, pushed)Run 1 —
Run 2 —
Safe to drop: aether configures no Net at v1.39.0 is now 330 upstream − 27 dropped = 303 compiled in (was 317). This is exactly the failure mode PR 0 exists to isolate: had it surfaced inside |
Step 1 of the
proxy/bzlmod migration (#697), deliberately kept on WORKSPACE and Envoy v1.39.0. It lands the two riskiest semantic changes of that migration against a known-good build, so that if//:envoyfails to link we know it is the extension trim and not bzlmod — and it shrinks the bzlmod PR to purely mechanical work.What the exploration found
proxy/bazel/extension_config/extensions_build_config.bzlwas not a curated subset. It is byte-identical to Envoy v1.38.0's default (diffis empty) — a stale verbatim copy that customised nothing and had silently fallen a release behind the v1.39.0 source pin. Concretely it was missing nine extensions v1.39.0 added:So "diff our 654-line dict against Envoy's default" resolved to: we drop nothing today, and we accidentally drop whatever upstream adds tomorrow. This PR is therefore also the first time we actually decide what to drop.
Both
@envoysource patches existed only to serve@llvm_toolchain_aarch64, and both were only needed becauseenvoy.filters.http.dynamic_modules(Rust / bindgen /llvm-objcopy) is compiled in. Dropping dynamic modules deletes both patches,CARGO_BAZEL_REPIN, and the whole Rust-SDK-on-arm64 problem class. aether does not use dynamic modules: proposal 012 replaced the Rust dynamic module with the compiled-in C++aether_statsfilter, and proposal 025's extension escape hatch is CRD-based.Changes
1. Load-and-filter instead of a verbatim copy.
extensions_build_config.bzlnowloads@envoy//source/extensions:extensions_build_config.bzlat the pinned version and subtracts — the shapeenvoyproxy/examples/filter-cc(the new upstream downstream-build template) uses. All five symbols Envoy exports are present at v1.39.0 (EXTENSIONS,LEGACY_ALWAYSLINK,{CONTRIB_,MOBILE_,}EXTENSION_{CONFIG_,}PACKAGE_VISIBILITY) and all five are re-exported._DROPPED = ["wasm", "dynamic_module"](substring match on the extension name), which at v1.39.0 removes 26 entries:all_extensions.bzlforce-adds_required_extensions(xff, uuid request-id, round-robin LB) regardless of this dict, so the core floor cannot be filtered away.aether_statsis unaffected: it is a dep of the binary (AETHER_EXTENSIONSin//BUILD.bazel), not an entry in this dict — exactly like filter-cc's:http_filter_config.No wasm-engine flag is added: v1.39.0's WORKSPACE-era gate is
--define wasm=disabled, whose only consumers areselect()s inside the wasm extension packages, and those packages are no longer in the graph at all. (The bzlmod PR uses the module-flag form,--@proxy-wasm-cpp-host//bazel:engine=disabled, per the template.)2. Deleted, all downstream of the dynamic-modules drop.
proxy/bazel/patches/—envoy-rust-sdk-aarch64-libclang.patchandenvoy-dynamic-modules-aarch64-objcopy.patch, plus theirBUILD.bazel, plus thepatches =/patch_args =on the@envoyhttp_archive.@llvm_toolchain_aarch64block inproxy/WORKSPACE.CARGO_BAZEL_REPIN: "true"fromproxy.ymlandproxy-release.yml—envoy_rust_crate_indexis a lazily-fetched crate_universe repo and nothing depends on it any more.3.
proxy.yml's arm64 leg moves toruns-on: ubuntu-24.04-arm.@clang_platformis anarch_aliaswhose_arch_alias_implreadsctx.os.arch— the driver host's arch — andtoolchains_llvmlikewise derivesexec_compatible_withfromrctx.os.arch. An x64 driver therefore produces acc-toolchain-aarch64-linuxwithexec_compatible_with = x86_64: a cross tool that cannot satisfy an aarch64 exec platform. That is the entire reason@llvm_toolchain_aarch64existed.proxy-release.ymlalready runs its arm64 leg on a native arm64 runner and already proves this works;proxy.ymlnow copies that exact shape, which is what makes the second toolchain removable. This is also unchanged by bzlmod — Envoy's bzlmodllvm.toolchain(...)uses the same host-arch detection — so it has to be true either way.--modify_execution_info=Genrule=-localis kept on the arm64 overlay (its original justification — the wasm-only@v8//:generated_inspector_filesgenrule under an x64 driver — is void, but the flag is proven on this pool and removing it is an unforced risk on a cold multi-hour build)..github/actions/setup-llvm-libsis not deleted here: it shims LLVM 18.1.8'slibtinfo.so.5, and v1.39.0 is still on LLVM 18. It dies in the bzlmod PR, where the toolchain moves to LLVM 22.1.8.Gate
proxy.ymlbuilds//...on both arches on BuildBuddy RBE, which covers//:envoy,//:image_test,//integration:{build_id_test,symtab_test}and the threeaether_statstests (incl.aether_stats_integration_test, which boots a real Envoy with the filter and is the static-init / factory-registration canary). Both legs are fully cold.If
//:envoyfails to link, the fix is a one-line revert of"dynamic_module"in_DROPPED.Refs #697
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr