-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-93759: fix python-config.py generation in Makefile.pre.in #93760
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
Conversation
BINDIR might be bigger than the max shebang size and lead to failures. Let us assume we have python in the $PATH and let env resolve it
Most changes to Python require a NEWS entry. Please add it using the blurb_it web app or the blurb command-line tool. |
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.
You can neither safely assume that the interpreter is on PATH nor that the interpreter is installed as python3
. It might be an altinstall that does not install the python3
alias.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@tiran would a wrapper in bash that execs the script a viable alternative? |
We already have a pure shell script version of |
@ # BINDIR might be bigger than the max shebang size and lead to failures. Let us assume we have | ||
@ # python in the $PATH and let env resolve it | ||
sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py |
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.
Assuming "a python" is on PATH isn't good enough, python-config.py uses the sysconfig and reports values for the interpreter actually used.
The script should really be interpreted by the correct interpreter, even using "#!/usr/bin/env python3.11" wouldn't be good enough because a user may have multiple installs (for example both homebrew and anaconda).
The python version is only used for macOS because the pure shell script version is broken there, in particular it doesn't apply the finetuning for CFLAGS/LDFLAGS/.... that's performed by |
Sounds to me like this PR and its issue can be closed as wont-fix or invalid? |
oki please close as wont fix. :) |
BINDIR might be bigger than the max shebang size and lead to failures.
Let us assume we have python in the $PATH and let env resolve it.