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
When I tried to run a py_test, the sh wrapper failed:
$ bazel test --action_env=RUNFILES_LIB_DEBUG=1 src_test==================== Test output for //:src_test:INFO[runfiles.bash]: rlocation(aspect_rules_py~override/py/tools/venv_bin/venv_bin): startINFO[runfiles.bash]: runfiles_current_repository(2): caller's path is (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test)INFO[runfiles.bash]: runfiles_current_repository(2): (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test) has path (_main/src_test) relative to the runfiles directory (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles)INFO[runfiles.bash]: runfiles_current_repository(2): (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test) corresponds to rlocation path (_main/src_test)INFO[runfiles.bash]: runfiles_current_repository(2): (_main/src_test) lies in the main repositoryINFO[runfiles.bash]: rlocation(aspect_rules_py~override/py/tools/venv_bin/venv_bin): looking up canonical name for (aspect_rules_py~override) from () in (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_repo_mapping)INFO[runfiles.bash]: rlocation(aspect_rules_py~override/py/tools/venv_bin/venv_bin): canonical name of target repo is ()INFO[runfiles.bash]: rlocation(aspect_rules_py~override/py/tools/venv_bin/venv_bin): found under RUNFILES_DIR (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles), returnINFO[runfiles.bash]: rlocation(_main//usr/bin/python): startERROR[runfiles.bash]: rlocation(_main//usr/bin/python): path is not normalized/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test: line 25: $1: unbound variableINFO[runfiles.bash]: rlocation(_main/src_test.venv.pth): startINFO[runfiles.bash]: runfiles_current_repository(2): caller's path is (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test)INFO[runfiles.bash]: runfiles_current_repository(2): (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test) has path (_main/src_test) relative to the runfiles directory (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles)INFO[runfiles.bash]: runfiles_current_repository(2): (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test) corresponds to rlocation path (_main/src_test)INFO[runfiles.bash]: runfiles_current_repository(2): (_main/src_test) lies in the main repositoryINFO[runfiles.bash]: rlocation(_main/src_test.venv.pth): looking up canonical name for (_main) from () in (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_repo_mapping)INFO[runfiles.bash]: rlocation(_main/src_test.venv.pth): canonical name of target repo is ()INFO[runfiles.bash]: rlocation(_main/src_test.venv.pth): found under RUNFILES_DIR (/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles), returnerror: a value is required for '--python <PYTHON>' but none was supplied
Version
Development (host) and target OS/architectures: linux x86-64
Output of bazel --version: bazel 7.0.2
Version of the Aspect rules: rules_py 6962d6a (also v0.7.1)
Language(s) and/or frameworks involved: Python 3.10.8 (happens with 3.9, 3.11 as well)
How to reproduce
After defining the python toolchain as shown above, trying to run any py_test or py_binary target will reproduce the problem.
ERROR[runfiles.bash]: rlocation(_main//usr/bin/python): path is not normalized
/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/src_test.runfiles/_main/src_test: line 25: $1: unbound variable
What happened?
I declared a custom toolchain that points at the system python interpreter.
I registered it in MODULE.bazel:
When I tried to run a
py_test
, the sh wrapper failed:Version
Development (host) and target OS/architectures: linux x86-64
Output of
bazel --version
: bazel 7.0.2Version of the Aspect rules: rules_py 6962d6a (also v0.7.1)
Language(s) and/or frameworks involved: Python 3.10.8 (happens with 3.9, 3.11 as well)
How to reproduce
After defining the python toolchain as shown above, trying to run any
py_test
orpy_binary
target will reproduce the problem.Min repro:
https://github.com/wade-arista/bazel-demo/tree/23ff2cebe6058a5e99535bd3f76c72b1b2b188ce
Test run:
https://github.com/wade-arista/bazel-demo/actions/runs/8209925408/job/22456408401#step:4:615
Any other information?
It's trying to resolve
{{ARG_PYTHON}}
inSee
rules_py/py/private/run.tmpl.sh
Lines 27 to 31 in 734070b
rules_py/py/private/py_binary.bzl
Line 72 in 734070b
The text was updated successfully, but these errors were encountered: