Fix Python toolchain configuration in Bazel MODULE.bazel causing build failures #1603
Open
mmorel-35 wants to merge 1 commit intoemscripten-core:mainfrom
Open
Fix Python toolchain configuration in Bazel MODULE.bazel causing build failures #1603mmorel-35 wants to merge 1 commit intoemscripten-core:mainfrom
mmorel-35 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
…d failures Signed-off-by: Matthieu MOREL <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a Python toolchain configuration issue in the Bazel bzlmod setup that was causing build failures when emsdk is used as a dependency in other projects.
Problem
The build was failing with the error:
This occurred when building WebAssembly targets that depend on the
py_binaryrule in//emscripten_toolchain:wasm_binary. The error manifested in projects like envoyproxy/examples when they used emsdk as a Bazel module dependency.Root Cause
The emsdk's
MODULE.bazelwas not properly configuring the Python toolchain for bzlmod. The Python extension neededis_default = Trueand explicituse_repo()statements to properly expose the Python repositories to the build system.Solution
is_default = Truein the Python toolchain configurationuse_repo()to explicitly exposepython_3_13andpython_versionsrepositoriesThe configuration now follows the proper bzlmod pattern:
With the default toolchain properly configured, the
py_binaryrule can rely on the default Python toolchain without needing an explicitpython_versionattribute.