Skip to content

[bp/1.40] Fixes and deps foundation stack - #49174

Merged
jwendell merged 32 commits into
envoyproxy:release/v1.40from
phlax:bp-1.40-fixes-deps
Nov 11, 2026
Merged

jwendell merged 32 commits into
envoyproxy:release/v1.40from
phlax:bp-1.40-fixes-deps

Conversation

@phlax

@phlax phlax commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

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.

Then brings the registry and toolshed up to date with main (registry 417c07d, envoy_toolshed 0.5.20.envoy):

And the changes that the toolshed and wasmtime commits above depend on:

And the RBE pool selection, for the GCC builds of two tests that do not fit the default pool:

And a release note for the signal handler change, from review:

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Install deps

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 copilot-code-review.yml file. Read the docs for details.

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

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

Comment thread MODULE.bazel Resolved
Comment thread bazel/extensions.bzl Resolved
Comment thread compat/openssl/prefixer/BUILD Resolved

Copilot AI commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Install deps

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 copilot-code-review.yml file. Read the docs for details.

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

Both dependency manifests record an incorrect release date for Toolshed 0.5.20.envoy; they need to use 2026-11-10 to keep dependency reports accurate.

2 open issues
3 resolved since last review

Review effort: Balanced

Comment thread bazel/deps.yaml Resolved
jwendell and others added 16 commits November 11, 2026 17:29
- `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]>
@phlax
phlax force-pushed the bp-1.40-fixes-deps branch from 44985a2 to e1bf01c Compare November 11, 2026 17:29
@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

changelog pr added against main and picked here

@jwendell

Copy link
Copy Markdown
Member

changelog pr added against main and picked here

Is the original commit suitable for backport since it's a change in behavior?

@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

i think its a change in behaviour both places no?

@jwendell

Copy link
Copy Markdown
Member

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?

@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

oh i see - yes - its a fix - and a minor behaviour change

phlax added a commit that referenced this pull request Nov 11, 2026
#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]>
@ravenblackx

Copy link
Copy Markdown
Contributor

changes in behavior are ok in main, but are they in stable branches? Or only bug fixes should be backported?

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.

@phlax

phlax commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

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

@jwendell
jwendell merged commit 1835c1a into envoyproxy:release/v1.40 Nov 11, 2026
15 of 18 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.

7 participants