-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
P2We'll consider working on this in future. (Assignee optional)We'll consider working on this in future. (Assignee optional)team-Rules-PythonNative rules for PythonNative rules for Pythontype: bug
Description
Description of the problem / feature request:
On systems where "python" on the PATH is Python 3 (e.g. Arch Linux has /usr/bin/python = Python3, also some macOS Homebrew installations seem to have /usr/local/bin/python as Python3), Bazel doesn't realize that and believes it's using Python 2.
Thus py_binary's that use PY2 (which is still the default for Bazel, so that would be almost all binaries) and are not compatible with Python 3 will mysteriously fail to run.
Some examples of where this caused confusion:
- Make Python scripts in build_defs compatible with Python 3. intellij#452
- python SyntaxError: invalid syntax when building plugin intellij#453
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Bazel should detect the correct Python 2.x and 3.x versions from the PATH, by inspecting the version output of "python", "python2" and "python3" and then choosing appropriate binaries.
What operating system are you running Bazel on?
Arch Linux
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2We'll consider working on this in future. (Assignee optional)We'll consider working on this in future. (Assignee optional)team-Rules-PythonNative rules for PythonNative rules for Pythontype: bug