You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is caused by the rule: Specific version-related `py_binary`
Is this a regression?
No, does not work as far back as 0.18.0, and repro does not work on 0.17.0.
Description
Enabling the --experimental_enable_bzlmod flag (even with an empty MODULE.bazel) causes Bazel to use the system Python interpreter, not the one specified in WORKSPACE.
This has a Python 3.9 toolchain set up in WORKSPACE. My system interpreter is 3.10.6. The bazelmod enable flag can be enabled with --config=bzlmod if you want. You should see two different versions (assuming your system interpreter is not 3.9).
This seems to be similar to bazelbuild/bazel#17289, but different, since the suggested fix (adding bazel_dep(name = "platforms", version = "0.0.5")) does not fix this one.
Enabling the --experimental_enable_bzlmod flag (even with an empty MODULE.bazel) causes Bazel to use the system Python interpreter, not the one specified in WORKSPACE.
So with bzlmod the configurations in the workspace file are not used. You need bzlmod configurations in the MODULE.bazel file, and also have an empty WORKSPACE.bzlmod file.
You can use WORKSPACE like configurations in the WORKSPACE.bzlmod file. But it is better to use the bzlmod configuration.
🐞 bug report
Affected Rule
The issue is caused by the rule: Specific version-related `py_binary`Is this a regression?
No, does not work as far back as 0.18.0, and repro does not work on 0.17.0.Description
Enabling the
--experimental_enable_bzlmod
flag (even with an emptyMODULE.bazel
) causes Bazel to use the system Python interpreter, not the one specified in WORKSPACE.🔬 Minimal Reproduction
https://github.com/tervay-bdai/pyexample
This has a Python 3.9 toolchain set up in WORKSPACE. My system interpreter is 3.10.6. The bazelmod enable flag can be enabled with
--config=bzlmod
if you want. You should see two different versions (assuming your system interpreter is not 3.9).🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
The text was updated successfully, but these errors were encountered: