Context
toolchains_llvm/1.9.1.envoy was added in 81606e3 and is being rolled out via envoyproxy/envoy#47658. Both Envoy patches (allow_nonroot.patch, x_compile.patch) were reviewed against the upstream v1.9.0…v1.9.1 diff and are still required and correctly rebased. This gap fell out of that review.
x_compile.patch does not cover C++20 module actions
x_compile.patch adds cxx_cross_lib and injects per-target -nostdinc++ -isystem <libc++ include> via extra_cxx_flags. Upstream only wires extra_cxx_flags to @rules_cc//cc/toolchains/actions:cpp_compile_actions. The new cpp_modules feature in v1.9.1 adds CPP_MODULE_ACTIONS to the msan/nomsan cc_args, but our cross-lib flags are not applied to:
cpp20_module_compile
cpp20_module_codegen
cpp_module_deps_scanning
Consequence: cross-compiling with --experimental_cpp_modules --features=cpp_modules would fail to find libc++ headers for PCM/scan actions. Not a problem for Envoy today (we don't enable C++20 named modules), but it needs to be recorded so it doesn't bite later.
Action:
References
Context
toolchains_llvm/1.9.1.envoywas added in 81606e3 and is being rolled out via envoyproxy/envoy#47658. Both Envoy patches (allow_nonroot.patch,x_compile.patch) were reviewed against the upstream v1.9.0…v1.9.1 diff and are still required and correctly rebased. This gap fell out of that review.x_compile.patchdoes not cover C++20 module actionsx_compile.patchaddscxx_cross_liband injects per-target-nostdinc++ -isystem <libc++ include>viaextra_cxx_flags. Upstream only wiresextra_cxx_flagsto@rules_cc//cc/toolchains/actions:cpp_compile_actions. The newcpp_modulesfeature in v1.9.1 addsCPP_MODULE_ACTIONSto the msan/nomsancc_args, but our cross-lib flags are not applied to:cpp20_module_compilecpp20_module_codegencpp_module_deps_scanningConsequence: cross-compiling with
--experimental_cpp_modules --features=cpp_moduleswould fail to find libc++ headers for PCM/scan actions. Not a problem for Envoy today (we don't enable C++20 named modules), but it needs to be recorded so it doesn't bite later.Action:
MODULE.bazeland/or a preamble inx_compile.patchdocumenting the gap (text before the firstdiffline is ignored bypatch;source.jsonpatch sha must be regenerated).extra_cxx_flagscc_argsalso targetCPP_MODULE_ACTIONS, and re-check thestdlib = "libc"auto-fallback for cross targets against the module actions.References
cc_toolchain_config.bzlCPP_MODULE_ACTIONS: https://github.com/bazel-contrib/toolchains_llvm/blob/v1.9.1/toolchain/cc_toolchain_config.bzl@toolchains_llvm-> 1.9.1.envoy envoy#47658