Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions configure
Expand Up @@ -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" "$@"
Copy link
Member

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?

Suggested change
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" "$@"

Copy link
Member

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).

Copy link
Member

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

Copy link
Contributor Author

@oleavr oleavr Nov 14, 2020

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).

command -v python2.7 >/dev/null && exec python2.7 "$0" "$@"
exec python "$0" "$@"
''' "$0" "$@"
Expand Down