Closed
Description
🐞 bug report
Affected Rule
The issue is caused by the rule:Is this a regression?
Yes, the previous version in which this bug was not present was: ....MacOS 12.2.1
Description
A clear and concise description of the problem...🔬 Minimal Reproduction
OS: MacOS 12.3
Bazel: 5.0.0
bazel5 run //examples:py_import_example
🔥 Exception or Error
INFO: Analyzed 2 targets (24 packages loaded, 318 targets configured).
INFO: Found 1 target and 1 test target...
[0 / 5] [Prepa] BazelWorkspaceStatusAction stable-status.txt ... (4 actions, 0 running)
FAIL: //:py_import_test (see /private/var/tmp/***/execroot/py_import/bazel-out/darwin-fastbuild/testlogs/py_import_test/test.log)
INFO: From Testing //:py_import_test:
==================== Test output for //:py_import_test:
env: python: No such file or directory
================================================================================
INFO: Elapsed time: 93.025s, Critical Path: 2.22s
INFO: 6 processes: 4 internal, 2 darwin-sandbox.
INFO: Build completed, 1 test FAILED, 6 total actions
//:py_import_test FAILED in 0.8s
/private/var/tmp/***/execroot/py_import/bazel-out/darwin-fastbuild/testlogs/py_import_test/test.log
Executed 1 out of 1 test: 1 fails locally.
INFO: Build completed, 1 test FAILED, 6 total actions
copying workspace under test examples/py_import to /private/var/tmp/***/execroot/rules_python/_tmp/12d36418595ed21d10a139c999170d5f/tmp4adyy1pw/wksp
testlogs/py_import_test/test.log
:
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:py_import_test
-----------------------------------------------------------------------------
env: python: No such file or directory
🌍 Your Environment
Operating System:
MacOS 12.3
M1 pro
Output of bazel version
:
5.0.0
Rules_python version:
commit/e18e1a3bbd372fd0351277794155b5b9045fbe37
Anything else relevant?
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
thundergolfer commentedon Jun 14, 2022
Thanks for your issue report. Unfortunately, by default
rules_python
will lookuppython
on the system in its stub script.The workarounds are:
python
onto the system or alias an existingpython3
.python
in the stub script, similar to Add ability for Bazel >=5.0.0 users to use downloaded py interpreter in py_binary stub script #699.honwen commentedon Jul 12, 2022
Unfortunately, rules_apple does not seem to export the PATH set by the user (cf. run.use_default_shell_env)
so this can not work
groodt commentedon Jul 13, 2022
Same root cause as: #691
honwen commentedon Aug 16, 2022
A solution showcase
github-actions commentedon Oct 10, 2022
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"