Draft
Add filter-cc: a tested, docs-first native filter build example using bzlmod#1390
Conversation
Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tested docs-first native filter build example using bzlmod
Add filter-cc: a tested, docs-first native filter build example using bzlmod
Sep 2, 2026
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.
Adds the agreed hard-blocker for the envoy bzlmod migration: a full, tested example showing how a downstream developer builds a native Envoy HTTP filter (statically linked) with bzlmod. Modelled on
wasm-cc, ports the oldenvoy-filter-examplesampleheader filter, and is docs-first — the tested artefacts (MODULE.bazel,BUILD,envoy.yaml, …) are exactly what is documented.filter-cc/moduleMODULE.bazelper the issue sketch —envoy/envoy_apideps,envoy_toolchains_extension(clang_platform), LLVM toolchain wiring asdev_dependency(same setup aswasm-cc); extension wiring validated against envoy main now that docs/bazel: Switch to bzlmod envoy#47155 has merged.BUILD—api_proto_package(), filter libs, statically linked//:envoy, andhttp_filter_integration_test(real integration test forbazel test //.../ BCR presubmit).http-filter-example, updated for envoy head: uses the non-deprecatedUnifiedFactoryBaseAPI instead of overriding the deprecatedNamedHttpFilterConfigFactory::createFilterFactoryFromProto, and leans onPassThroughDecoderFilterfor the boilerplate:envoy.yamlusing thesamplefilter,docker-compose.yaml(proxy from built binary + echo backend),docker-compose-build.yaml(filter_build/filter_testviashared/build, same pattern aswasm_compile_update), Dockerfiles,example.rst,README.md..bazelrcis bzlmod-first (unlikewasm-cc's workspace default), with BCR + envoy bazel-registry and the downstream-relevant flags from envoy's.bazelrc.Testing
verify.sh— builds//:envoyin the shared build container, brings up the composition, asserts the filter'sVia: sample-filterheader appears on proxied requests..github/workflows/_verify_filter.yml(wired intoverify.yml) — pins envoy main head viagit_overrideand builds//:http_filter_configin the build container. Per open decision 1 in the issue, CI proves the extension wiring cheaply; the full static link is left toverify.shand BCR presubmit (hosted runners can't sustain a full envoy link).Integration & publishing
MODULE.bazel:bazel_dep+local_path_overrideforenvoy-example-filter-cc— the same mechanism envoy head-testing uses forwasm-cc.BUILD: wired into:configs,:docs_rst, theexamples_docstoctree genrule and the:docstar..bcr/filter-cc/{metadata.template.json,presubmit.yml,source.template.json}+moduleRootsentry so it is published alongsidewasm-cc.Follow-ups (per issue): envoy-side head testing of all build examples, and the
dynmodexample reusing this structure.filter-cc) using bzlmod #1389