Skip to content

Emscripten upgrade breaks Envoy #1273

@martijneken

Description

@martijneken

There are at least two issues upgrading Envoy to v3.1.44 (seen in envoyproxy/envoy#29118), and I suspect both are related to Bazel toolchain resolution since #1036.

  1. Inability to build cmake targets, such as zlib. The error is CMAKE_C_COMPILER not set (details).

    When I try to add an emcmake toolchain (draft), I run into toolchain resolution issues (details). The issue is that the regular cmake toolchain uses exec_compatible_with qualifiers, rather than target_compatible_with which would skip this choice for wasm targets.

    I suspect there are 2 possible roads to fix cmake support:

    • use regular cmake, but configure it properly to use the emcc compiler
    • use a custom toolchain to invoke emcmake, fix above toolchain resolution issues
  2. Improper cpp toolchain resolution. Envoy uses Rust to build Wasm plugins, and Rust registers a dummy cc toolchain. For reasons I don't understand, the Rust dummy toolchain is selected ahead of the real emcc toolchain, causing compilation failures like DUMMY_GCC_TOOL failed (it's not intended to actually build anything). It seems like emsdk needs a way to force its toolchain after the emscripten transition.

P.S. The above issues pop up when setting incompatible_use_toolchain_transition (or flags like --incompatible_enable_cc_toolchain_resolution), which many projects and targets already rely on.

Metadata

Metadata

Labels

bazelIssues related to Bazel toolchain

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions