-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py_binary always use python as the interpreter when PY3 is specified #200
Comments
PY3 or PY3ONLY is used as the version. This is needed because /usr/bin/python is an ambigous symlink on most Linux distrubtions, some distro links it to python2.7, some distro likes gentoo may link it to python3. Given python2 and python3 are not fully compatible, we should choose the interpreter explicitly based on the version specified in py_binary rule. This should fix issue bazelbuild#200 Change-Id: I6f62b080b795112b1945ada5bb2ad7e58f956c2c
PY3 or PY3ONLY is used as the version. This is needed because /usr/bin/python is an ambigous symlink on most Linux distrubtions, some distro links it to python2.7, some distro likes gentoo may link it to python3. Given python2 and python3 are not fully compatible, we should choose the interpreter explicitly based on the version specified in py_binary rule. This should fix issue bazelbuild#200 Change-Id: I6f62b080b795112b1945ada5bb2ad7e58f956c2c
should be fixed by |
I just tried with a small rule:
And it properly exec()s python3. The shebang line is |
Was the fix merged into bazel? My only workaround is setting the python_path flag to /usr/local/bin/python3 |
/cc @brandjon |
FYI I believe this was fixed and regressed, and is now a dup of #4815. |
My build rule:
I expect the generated wrapper script would use python3 as the interpreter but actual it still uses python:
Is there any way to have some knob to control which python interpreter to use?
The text was updated successfully, but these errors were encountered: