Problem
bazel-registry/modules/emsdk/4.0.23.envoy/patches/emsdk_bzlmod.patch hardcodes a specific hermetic Python (python_3_13) and a fragile interpreter path. This currently fails the build on x86_64 (and would likely fail on arm too — but the observed failure is x86):
- The emscripten toolchain shell scripts hardcode
external/rules_python~~python~python_3_13_x86_64-unknown-linux-gnu/bin/python3. This uses the stale ~~ canonical-repo separator — current Bazel uses ++/+ (e.g. rules_python++python+python_3_13), so this path does not resolve.
- Root
MODULE.bazel / envoy standardize on Python 3.12. The patch forcing python_3_13 drags in a python_3_13 toolchain repo that is not visible / does not resolve from @@emsdk+:
ERROR: no such package '@@[unknown repo 'python_3_13' requested from @@emsdk+ ...]//':
No repository visible as '@python_3_13' from repository '@@emsdk+'
... referenced by '@@emsdk+//emscripten_toolchain:common_files_emscripten_linux'
These are arch-independent failures (stale repo syntax + non-resolving python_3_13 repo), not arm-specific.
Hardcoded spots in the current patch
bazel/MODULE.bazel: adds use_repo(python, "python_3_13") — should not be in the patch at all (see below).
bazel/remote_emscripten_repository.bzl: adds "@python_3_13//:files" to toolchain srcs.
bazel/emscripten_toolchain/emar.sh, emcc.sh, emcc_link.sh: replace python3 with the hardcoded external/rules_python~~python~python_3_13_x86_64-.../bin/python3 path.
Required changes (confined to bazel-registry/modules/emsdk/)
- Switch to Python 3.12 (match root/envoy default); remove all
python_3_13 references.
- No hardcoding: resolve the interpreter from the resolved rules_python toolchain / runfiles rather than a literal
external/... path with a baked-in repo-name/separator/arch — so it is robust to Bazel canonical-repo syntax (~~ vs ++), python minor version, and architecture. Preserve the original hermetic intent (bazel-provided python, not system python3), just make it resolve correctly and tie it to 3.12.
- Patch must not touch
bazel/MODULE.bazel. Python config (python.toolchain / use_repo) belongs in the registry MODULE.bazel (bazel-registry/modules/emsdk/4.0.23.envoy/MODULE.bazel), not injected into upstream bazel/MODULE.bazel. Rem
Problem
bazel-registry/modules/emsdk/4.0.23.envoy/patches/emsdk_bzlmod.patchhardcodes a specific hermetic Python (python_3_13) and a fragile interpreter path. This currently fails the build on x86_64 (and would likely fail on arm too — but the observed failure is x86):external/rules_python~~python~python_3_13_x86_64-unknown-linux-gnu/bin/python3. This uses the stale~~canonical-repo separator — current Bazel uses++/+(e.g.rules_python++python+python_3_13), so this path does not resolve.MODULE.bazel/ envoy standardize on Python 3.12. The patch forcingpython_3_13drags in apython_3_13toolchain repo that is not visible / does not resolve from@@emsdk+:These are arch-independent failures (stale repo syntax + non-resolving
python_3_13repo), not arm-specific.Hardcoded spots in the current patch
bazel/MODULE.bazel: addsuse_repo(python, "python_3_13")— should not be in the patch at all (see below).bazel/remote_emscripten_repository.bzl: adds"@python_3_13//:files"to toolchain srcs.bazel/emscripten_toolchain/emar.sh,emcc.sh,emcc_link.sh: replacepython3with the hardcodedexternal/rules_python~~python~python_3_13_x86_64-.../bin/python3path.Required changes (confined to
bazel-registry/modules/emsdk/)python_3_13references.external/...path with a baked-in repo-name/separator/arch — so it is robust to Bazel canonical-repo syntax (~~vs++), python minor version, and architecture. Preserve the original hermetic intent (bazel-provided python, not systempython3), just make it resolve correctly and tie it to 3.12.bazel/MODULE.bazel. Python config (python.toolchain/use_repo) belongs in the registryMODULE.bazel(bazel-registry/modules/emsdk/4.0.23.envoy/MODULE.bazel), not injected into upstreambazel/MODULE.bazel. Rem