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
$ bazel run :hello
ERROR: /Users/laurent/code/repro-python/BUILD:4:10: in py_binary rule //:hello:
Traceback (most recent call last):
File "/Users/laurent/output_base/external/aspect_rules_py~/py/private/py_binary.bzl", line 18, column 51, in _py_binary_rule_impl
py_toolchain = _py_semantics.resolve_toolchain(ctx)
File "/Users/laurent/output_base/external/aspect_rules_py~/py/private/py_semantics.bzl", line 103, column 13, in _resolve_toolchain
fail(_MUST_SET_INTERPRETER_VERSION_FLAG)
Error in fail: ERROR: Prior to Bazel 7.x, the python interpreter version must be explicitly provided.
For example in `.bazelrc` with Bazel 6.4, add
common --@aspect_rules_py//py:interpreter_version=3.9.18
Bazel 6.3 and earlier didn't handle the `common` verb for custom flags.
Repeat the flag to avoid discarding the analysis cache:
build --@aspect_rules_py//py:interpreter_version=3.9.18
fetch --@aspect_rules_py//py:interpreter_version=3.9.18
query --@aspect_rules_py//py:interpreter_version=3.9.18
ERROR: /Users/laurent/code/repro-python/BUILD:4:10: Analysis of target '//:hello' failed
ERROR: Analysis of target '//:hello' failed; build aborted
INFO: Elapsed time: 0.152s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
$ bazel --version
bazel 7.2.1
### Any other information?
_No response_
The text was updated successfully, but these errors were encountered:
@laurentlb I think the error message was trying to tell you exactly what to do: upgrade to Bazel 7 or use one of the workaround flags.
LMK if that's still not working?
What happened?
When trying to define a Python toolchain, I get the error "_MUST_SET_INTERPRETER_VERSION_FLAG" which incorrectly complains about my Bazel version.
Version
Development (host) and target OS/architectures:
Output of
bazel --version
: 7.2.1Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: 0.7.3Language(s) and/or frameworks involved:
How to reproduce
The text was updated successfully, but these errors were encountered: