-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
build: try “python3” as a last resort for 3.x #35983
Conversation
So that Xcode's Python 3 gets picked up.
This could cause us to launch with a Python 3.{0,1,2,3,4} that is not tested and would probably fail. There are tons of macOS users that are using this code as is. Please try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could cause untested versions of Python 3 to run.
Why would that be a bad thing? I think as a fallback this should be perfectly acceptable. |
Why take the support risk for a change that is not needed? |
@@ -10,6 +10,7 @@ command -v python3.8 >/dev/null && exec python3.8 "$0" "$@" | |||
command -v python3.7 >/dev/null && exec python3.7 "$0" "$@" | |||
command -v python3.6 >/dev/null && exec python3.6 "$0" "$@" | |||
command -v python3.5 >/dev/null && exec python3.5 "$0" "$@" | |||
command -v python3 >/dev/null && exec python3 "$0" "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cclauss Would this be acceptable?
command -v python3 >/dev/null && exec python3 "$0" "$@" | |
command -v python3 >/dev/null && python3 -c 'import sys; assert sys.version_info >= (3,5)' > /dev/null && exec python3 "$0" "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I guess I kind of wonder if this actually covers anything we don't already cover.
@oleavr It would be very useful to know the output of python3 --version
on your system (assuming this PR is a bug fix for your own setup).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also just print a warning from configure.py
itself, right? We’re already doing that for a the compiler/assembler/etc. versions as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Trott The output is:
% python3 --version
Python 3.8.2
This is the Xcode-provided Python 3 on a macOS system. Xcode doesn't create a python-3.8
symlink in /usr/bin
, there's only /usr/bin/python3
(which is not a symlink, but a magic forwarder program that locates the Xcode installation and pivots to the appropriate binary there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM... All my Macs use brew
so I did not properly understand the issue. Thanks for clarifying.
Landed in 0ed9961...fb24f6e |
So that Xcode's Python 3 gets picked up. PR-URL: #35983 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rich Trott <[email protected]>
So that Xcode's Python 3 gets picked up. PR-URL: #35983 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rich Trott <[email protected]>
So that Xcode's Python 3 gets picked up. PR-URL: #35983 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rich Trott <[email protected]>
So that Xcode's Python 3 gets picked up. PR-URL: #35983 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rich Trott <[email protected]>
So that Xcode's Python 3 gets picked up. PR-URL: #35983 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Rich Trott <[email protected]>
So that Xcode's Python 3 gets picked up.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes