Repository navigation
[bp/1.40] Fixes and deps foundation stack - #49174
Conversation
2566901 to
a1dd7b3
Compare
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical renderer, dependency, and sysroot incompatibilities block LLVM and Wasmtime builds, ordinary Linux linking, and hermetic OpenSSL prefixer builds.
4 open issues
What changed in this PR
This PR establishes the first stage of the 1.40 backport stack from #49053, combining dependency and Bazel foundations with standalone runtime fixes and CI adjustments.
Changes:
- Updates the registry and toolshed dependencies, removes
envoy_toolshed_jq, and adapts build definitions for Bazel 9. - Re-enables Wasmtime testing, separates execution-context checks, and adjusts platform and build-pool selection.
- Fixes jemalloc accounting and fatal-signal diagnostics, with regression tests and admin-disabled test guards.
| File | Description |
|---|---|
tools/spelling/spelling_dictionary.txt |
Adds terminology used by the changes. |
tools/dependency/cve.yaml |
Excludes a CVE affecting the unused C unpacker. |
test/server/backtrace_test.cc |
Tests fault and backtrace output to stderr. |
test/integration/stats_integration_test.cc |
Guards admin-specific statistics expectations. |
test/integration/base_integration_test.cc |
Handles listener diagnostics without admin support. |
test/extensions/filters/http/ext_proc/BUILD |
Selects a pool for heavy compilation. |
test/extensions/filters/http/bandwidth_share/filter_integration_test.cc |
Skips an admin-dependent test when disabled. |
test/extensions/dynamic_modules/bootstrap/integration_test.cc |
Guards admin-dependent bootstrap tests. |
test/extensions/common/matcher/BUILD |
Adjusts the domain-matcher build pool. |
test/extensions/bootstrap/reverse_tunnel/upstream_socket_interface/BUILD |
Adjusts the reverse-tunnel build pool. |
test/extensions/access_loggers/stats/stats_test.cc |
Allows negative allocator-memory deltas. |
test/exe/BUILD |
Restricts the service-manager test to Windows. |
test/common/upstream/BUILD |
Adjusts the lifecycle-test build pool. |
test/common/tls/context_impl_test.cc |
Uses the generated certificate hash constant. |
test/common/signal/signals_test.cc |
Tests fatal-signal descriptions. |
test/common/router/BUILD |
Adjusts the outlier-detection build pool. |
test/common/memory/heap_shrinker_test.cc |
Checks reserved-memory bounds and jemalloc shrinking. |
source/server/backtrace.h |
Adds logger-independent stderr diagnostics. |
source/extensions/wasm_runtime/wasmtime/BUILD |
Adds a Rust runtime dependency. |
source/extensions/dynamic_modules/sdk/rust/BUILD |
Updates raw sysroot header labels. |
source/common/signal/signal_action.h |
Expands alternate-stack sizing and exposes signal descriptions. |
source/common/signal/signal_action.cc |
Avoids allocating signal descriptions and bypasses logging. |
source/common/memory/stats.cc |
Includes retained pages in jemalloc reserved memory. |
source/common/http/http1/legacy_parser_impl.cc |
Suppresses a vendored macro’s cast warning. |
MODULE.bazel |
Updates dependencies and LLVM sysroot labels. |
mobile/MODULE.bazel |
Updates toolshed and proxy-Wasm dependencies. |
mobile/bazel/extensions.bzl |
Loads explicit C++ and Objective-C rules. |
docs/MODULE.bazel |
Updates documentation-workspace dependencies. |
compat/openssl/prefixer/BUILD |
Adjusts sysroot include paths. |
ci/README.md |
Documents the execution-context CI target. |
ci/do_ci.sh |
Restores Wasmtime testing and separates execution-context checks. |
ci/bazel_fun.sh |
Reports workspace-update progress. |
ci.bazelrc |
Overrides the host platform for remote-execution info commands. |
changelogs/current/bug_fixes/memory__jemalloc-reserved-accounting.rst |
Documents the jemalloc accounting fix. |
changelogs/current/bug_fixes/logging__fatal-signal-backtraces.rst |
Documents fatal-signal diagnostic changes. |
changelogs/changelogs.yaml |
Registers the memory changelog area. |
bazel/tests/external/MODULE.bazel |
Updates toolshed for external-workspace testing. |
bazel/tests/external/.bazelrc |
Updates the registry pin. |
bazel/tests/codeql/MODULE.bazel |
Updates CodeQL-workspace dependencies. |
bazel/tests/codeql/.bazelrc |
Updates the registry and isolates CI settings. |
bazel/repo.bzl |
Loads the shell rule in generated BUILD content. |
bazel/rbe/toolchains/configs/linux/gcc/config/BUILD |
Uses the standard host-platform target. |
bazel/rbe/toolchains/configs/linux/gcc/cc/cc_toolchain_config.bzl |
Explicitly loads the toolchain-config provider. |
bazel/rbe/toolchains/configs/linux/gcc/cc/armeabi_cc_toolchain_config.bzl |
Explicitly loads the ARM toolchain-config provider. |
bazel/external/BUILD |
Loads the static-library rule explicitly. |
bazel/extensions.bzl |
Adjusts generated LLVM BUILD content. |
bazel/envoy_test.bzl |
Exposes test target compatibility constraints. |
bazel/deps.yaml |
Updates toolshed release metadata. |
api/MODULE.bazel |
Updates toolshed and removes its separate jq module. |
api/bazel/deps.yaml |
Updates API-workspace toolshed metadata. |
api/.bazelrc |
Updates the registry and isolates CI settings. |
.gitignore |
Ignores Bazel outputs in test workspaces. |
.github/workflows/_check_build.yml |
Adds the execution-context build check. |
.github/config.yml |
Defines execution-context check triggers. |
.bazelrc |
Updates the registry and removes an obsolete flag. |
Review effort: Balanced
|
One or more custom setup steps configured for this repository failed during this Copilot code review run: Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review. Note You can configure setup steps for Copilot code review separately from Copilot cloud agent with a |
- `stack.c`: call `OPENSSL_sk_num` instead of the deprecated `sk_num`. - `SSL_get_min_proto_version` / `SSL_get_max_proto_version`: add handwritten wrappers that explicitly cast away const before calling OpenSSL's `SSL_ctrl`-based macros, matching the existing `SSL_CTX_get_*_proto_version` wrappers. - `EVP_PKEY_assign_RSA` / `EVP_PKEY_assign_EC_KEY`: add handwritten wrappers that call the deprecated `EVP_PKEY_assign` through the `ossl` function pointer, rather than the auto-generated macro expansion that triggers `-Wdeprecated-declarations`. No functional changes. Signed-off-by: Jonh Wendell <[email protected]> Co-authored-by: Copilot <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
This commit removes the use of the RTLD_DEEPBIND option when the compat layer loads the OpenSSL shared libraries. As a replacement, the compat layer is now built with the -fvisibility=hidden option instead. This has the same effect of preventing OpenSSL code linking against the compat layer symbols instead of it's own. This change has been made, in preparation for adding an ASAN build of the compat layer, because the dlopen() wrapper that ASAN injects, does not work with the RTLD_DEEPBIND option. Also added a test to confirm that compat layer symbols are not dynamically visible (preventing the subtle misresolution bugs that RTLD_DEEPBIND was originally introduced to solve). --------- Signed-off-by: Ted Poole <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
…envoyproxy#49150) The presubmit selects the affected tests with cquery and passes them to bazel test as explicit labels. cquery includes targets that are incompatible with the target platform, such as the Windows-only //test/exe:win32_scm_test (envoyproxy#48922), and Bazel only skips those for wildcard patterns: as explicit labels they abort the build with "command succeeded, but not all targets were analyzed", as on any PR touching test/exe/BUILD. The selection now drops them, by checking for IncompatiblePlatformProvider in the cquery starlark output. Signed-off-by: Ryan Northey <[email protected]>
…envoyproxy#48956) Commit Message: openssl: create SSL object once per thread in SSL_get_cipher_by_value Additional Description: OpenSSL can only look up a cipher through an SSL object. The compat implementation of SSL_get_cipher_by_value created and freed a new SSL_CTX and SSL on every call. Envoy calls it once per offered cipher suite during TLS 1.2 certificate selection, meaning a single handshake could create many SSL_CTX objects. This change creates one SSL object per thread on first use, with a `thread_local bssl::UniquePtr`, and reuses it for later lookups on that thread. OpenSSL does not guarantee that SSL_CIPHER_find() is thread safe, so threads do not share the object. It is freed when its thread exits. Fixes envoyproxy#48858 Risk Level: Low (only affects --config=openssl builds) Testing: ```bash bazel test --config=openssl //compat/openssl/test/... bazel test --config=openssl //test/common/tls:ssl_socket_test //test/common/tls:context_impl_test ``` Micro-benchmark (10,000 calls to SSL_get_cipher_by_value(0xC02B), --config=openssl): - before: 188.77 us/call - after: 0.34 us/call (~550x faster) *The thread_local version benchmarks about the same.* Docs Changes: N/A Release Notes: N/A AI Disclosure: Claude Code was used to help explain the codebase, simplify the implementation, write the throwaway benchmark, and draft this description. I have reviewed, tested, and understand all of the code in this PR. --------- Signed-off-by: NMJlam <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
- `rules_rust` -> 0.74.0.envoy.1 Signed-off-by: dependency-envoy[bot] <148525496+dependency-envoy[bot]@users.noreply.github.com> (cherry picked from commit 898c5ac) Signed-off-by: Ryan Northey <[email protected]>
…roxy#49136) - `protoc-gen-validate` -> 1.3.3.envoy.1 Signed-off-by: dependency-envoy[bot] <148525496+dependency-envoy[bot]@users.noreply.github.com> (cherry picked from commit ff32493) Signed-off-by: Ryan Northey <[email protected]>
…49138) - `envoy_toolshed` -> 0.5.20.envoy 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 d3fa9b7) Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: dependency-envoy[bot] <148525496+dependency-envoy[bot]@users.noreply.github.com> (cherry picked from commit 85aa7f0) Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]> Co-authored-by: Jonh Wendell <[email protected]> (cherry picked from commit 06e2361) Signed-off-by: Ryan Northey <[email protected]>
…#48840) The prefixer is an exec-config tool compiled against the gcc headers from envoy_toolshed's libstdcxx sysroot, so its objects reference that gcc's GLIBCXX symbol versions. Linking libstdc++ dynamically makes the tool require those versions from the build host's libstdc++.so.6 at runtime, so it aborts with "GLIBCXX_<ver> not found" on any host whose system libstdc++ is older than the sysroot's gcc. Link the matching static libstdc++.a (already shipped in the -L dir and already a linker input via @libstdcxx_sysroot_linux_amd64//:libs) so the tool is self-contained. libclang-cpp stays dynamic and resolves its own libstdc++ needs from the host. Signed-off-by: Jonh Wendell <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]> (cherry picked from commit 468dfec) Signed-off-by: Ryan Northey <[email protected]>
…roxy#48473) Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit ec0f57f) Signed-off-by: Ryan Northey <[email protected]>
Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit 96d580d) Signed-off-by: Ryan Northey <[email protected]>
`rbe_pool` pins one EngFlow pool for every action of a target in every
build. Measuring every compile, link and test of `//test/...` under opt,
asan, tsan, msan and gcc showed that the need is per configuration and
per kind of action: compiles over 3GiB are common under clang and more
so under gcc, the tsan and gcc links of the largest binaries run 9-12GB,
and tests fit the default pool everywhere except a few dozen under msan.
One pin for everything either over-provisions the test action and the
other configurations or under-provisions the one that needs it.
This makes the selection configuration- and action-aware, in a shared
`bazel/envoy_rbe.bzl`:
- `rbe_pool` still takes a pool name (every action, every configuration,
as before) and now also a dict keyed by
`default`/`asan`/`msan`/`tsan`/`coverage`/`gcc`; a configuration not
named uses `default`.
- each value is a pool name or `{"build": pool, "test": pool}`: `build`
covers compile and link (`Pool`), `test` the test action (`test.Pool`).
A build-only pin leaves the test action on the platform default; a
test-only pin leaves compiles and links there.
- the non-test macros (`envoy_cc_library`, `envoy_cc_binary`,
`envoy_cc_test_library`, `envoy_cc_test_binary`, a fuzz test's library)
ignore test pools; a fuzz test's library now gets the pin, previously
only its binary did.
- each configuration gets its own single-key `select()` in a fixed
precedence order, so configurations enabled together (fuzz coverage:
coverage + asan) never meet in one `select()`.
Existing string pins land every action on the pool they do today;
nothing changes until a pin uses the new forms. envoyproxy#49078 regenerates the
tree's pins from the measurement using them.
Signed-off-by: Ryan Northey <[email protected]>
… build of endpoint_keyed_filtering_test The GCC compile of this test does not fit the default RBE pool and is killed intermittently, failing the gcc check. This is the pin for this target from envoyproxy#49078, which cannot be picked to this branch as a whole. Signed-off-by: Ryan Northey <[email protected]>
…d of health_checker_impl_test The GCC compile of this test does not fit the default RBE pool: it ran until the 30 minute action timeout, failing the gcc check. This is the pin for this target from envoyproxy#49078, which cannot be picked to this branch as a whole. Signed-off-by: Ryan Northey <[email protected]>
envoyproxy#49180) envoyproxy#48471 made the fatal signal handler write fault descriptions and backtraces directly to stderr, so that it does not re-enter the logger. The release note describes that as a bug fix, but does not say that the output no longer reaches configured log sinks such as `--log-path`. State it explicitly as a minor behavior change, as it matters to anyone collecting crash backtraces from the log file, in particular when the fix is backported to a stable branch. Signed-off-by: Ryan Northey <[email protected]>
44985a2 to
e1bf01c
Compare
|
changelog pr added against main and picked here |
Is the original commit suitable for backport since it's a change in behavior? |
|
i think its a change in behaviour both places no? |
changes in behavior are ok in main, but are they in stable branches? Or only bug fixes should be backported? |
|
oh i see - yes - its a fix - and a minor behaviour change |
#49180) #48471 made the fatal signal handler write fault descriptions and backtraces directly to stderr, so that it does not re-enter the logger. Its release note describes that as a bug fix, but does not say that the output no longer reaches configured log sinks such as `--log-path`. This adds a `minor_behavior_changes` entry stating it explicitly, as it matters to anyone collecting crash backtraces from the log file. Raised from review of the 1.40 backport (#49174), where a patch release would otherwise change this silently. To be backported there. Signed-off-by: Ryan Northey <[email protected]>
I think this is a case where the only way to fix the bug is to have a behavior change, you can't have one without the other. So while ideally we wouldn't have the behavior change and would have the bugfix, that's not an option. I think explicitly calling out the behavior change in the release notes (as it now does) is the best we can realistically do, so my opinion is this is good. |
|
tracked this further - and it would appear to be a jemalloc issue not wasmtime - not sure i feel differently about it tbh - i think its still a fix - but its not a wasmtime blocker per se i think |


First part of #49053, split out so the backport can land gradually.
Standalone fixes plus the registry/toolshed foundation the rest of the stack builds on. The first three commits are the same prefix as #49053.
deps: Bump
bazel-registry-> 99aa31edeps: Bump
envoy_toolshed-> 0.5.4 (deps: Bumpenvoy_toolshed-> 0.5.4 #48389)deps: Bump
envoy_toolshed-> 0.5.17.envoybazel: Compat for bazel 9 (bazel: Compat for bazel 9 #48608)
ci: Re-enable wasmtime tests (and fix/cleanup) (ci: Re-enable wasmtime tests (and fix/cleanup) #48434)
ci: Move execution context test to standalone build check (ci: Move execution context test to standalone build check #48509)
bazel/deps: Rm
envoy_toolshed_jq(bazel/deps: Rmenvoy_toolshed_jq#48817)deps/cve: Ignore CVE-2026-72854 (msgpack-c unpacker, unused) (deps/cve: Ignore CVE-2026-72854 (msgpack-c unpacker, unused) #49052)
tests: Respect admin=disabled (tests: Respect admin=disabled #48465)
memory/jemalloc: Fix reserved memory accounting (memory/jemalloc: Fix reserved memory accounting #48472)
signal: Avoid allocation in fatal signal handler (signal: Avoid allocation in fatal signal handler #48471)
test: Use
linux_x64_smallRBE pool for heavy GCC compiles (test: Uselinux_x64_smallRBE pool for heavy GCC compiles #48880)test: Only build win32_scm_test on Windows (test: Only build win32_scm_test on Windows #48922)
bazel: add target_compatible_with to envoy_cc_test (bazel: add target_compatible_with to envoy_cc_test #48813)
Ignore some bazel files (Ignore some bazel files #48302)
openssl: Fix test under bazel 9 (openssl: Fix test under bazel 9 #48617)
openssl: fix compiler warnings in the compat layer (openssl: fix compiler warnings in the compat layer #48818)
compat/openssl: Remove the use of RTLD_DEEPBIND (compat/openssl: Remove the use of RTLD_DEEPBIND #48972)
ci/openssl: Leave incompatible targets out of the presubmit selection (ci/openssl: Leave incompatible targets out of the presubmit selection #49150)
openssl: create SSL object once per thread in SSL_get_cipher_by_value (openssl: create SSL object once per thread in SSL_get_cipher_by_value #48956)
Then brings the registry and toolshed up to date with
main(registry417c07d,envoy_toolshed0.5.20.envoy):bazel-registry-> 2308406 (+rules_rust) (deps: Bumpbazel-registry-> 2308406 (+rules_rust) #49132)bazel-registry-> e66ede8 (+protoc-gen-validate) (deps: Bumpbazel-registry-> e66ede8 (+protoc-gen-validate) #49136)bazel-registry-> 417c07d (+envoy_toolshed) (deps: Bumpbazel-registry-> 417c07d (+envoy_toolshed) #49138)And the changes that the toolshed and wasmtime commits above depend on:
envoy_toolshed-> 0.5.5.envoy #48653)And the RBE pool selection, for the GCC builds of two tests that do not fit the default pool:
linux_x64_smallRBE pool for the GCC build of endpoint_keyed_filtering_test (the pin for this target from test/bazel: Replace the RBE pool pins with measured per-configuration ones #49078, not a backport)linux_x64_smallRBE pool for the build of health_checker_impl_test (likewise the pin from test/bazel: Replace the RBE pool pins with measured per-configuration ones #49078)And a release note for the signal handler change, from review: