-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix locating Python interpreter when it isn't "python" #18197
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
The "python" interpreter is specified by PEP-394. In it, an OS can decide not to ship a "python" executable, and instead only ship python2/3, providing some ambiguity for scripts that are version-neutral, like the one Mono uses. This uses an automake macro to locate a suitable Python, and changes the makefile to use the located Python, whatever it may be.
|
Python2 or 3? |
|
It will look for any Python it can, which is fine for the one script that needs it. (You could specify a minimum version as an argument, AFAIK.) |
|
Another choice is usr/bin/env. |
|
env won't save you when the system lacks |
|
@monojenkins squash |
Fix locating Python interpreter when it isn't "python" The "python" interpreter is specified by PEP-394. In it, an OS can decide not to ship a "python" executable, and instead only ship python2/3, providing some ambiguity for scripts that are version-neutral, like the one Mono uses. This uses an automake macro to locate a suitable Python, and changes the makefile to use the located Python, whatever it may be. Commit migrated from mono/mono@84221f0
Fix locating Python interpreter when it isn't "python" The "python" interpreter is specified by PEP-394. In it, an OS can decide not to ship a "python" executable, and instead only ship python2/3, providing some ambiguity for scripts that are version-neutral, like the one Mono uses. This uses an automake macro to locate a suitable Python, and changes the makefile to use the located Python, whatever it may be. (cherry picked from commit 84221f0)
* Force Python 3.x from env in shebang lines * Fix byte/string incompatiblity in Python 3 * Fix locating Python interpreter when it isn't "python" (#18197) Fix locating Python interpreter when it isn't "python" The "python" interpreter is specified by PEP-394. In it, an OS can decide not to ship a "python" executable, and instead only ship python2/3, providing some ambiguity for scripts that are version-neutral, like the one Mono uses. This uses an automake macro to locate a suitable Python, and changes the makefile to use the located Python, whatever it may be. (cherry picked from commit 84221f0) * More disambiguation of Python in makefiles (#18284) (cherry picked from commit b3ce5bf) * [build] Check for Python 3 in configure.ac (#18625) I fear this causing packaging problems, but as-is we require Python 3 for most of our Python files but don't actually check for that in configure. We should be consistent about this. Some projects (notably wasm) also use the Python version detected here, so bumping this will also bump the version used in those cases (a good thing, since there are some known bugs when using the scripts with Python 2). (cherry picked from commit 0f47ea5) Co-authored-by: Calvin Buckley <[email protected]> Co-authored-by: Ryan Lucia <[email protected]>
Fix locating Python interpreter when it isn't "python" The "python" interpreter is specified by PEP-394. In it, an OS can decide not to ship a "python" executable, and instead only ship python2/3, providing some ambiguity for scripts that are version-neutral, like the one Mono uses. This uses an automake macro to locate a suitable Python, and changes the makefile to use the located Python, whatever it may be.
Fix locating Python interpreter when it isn't "python" The "python" interpreter is specified by PEP-394. In it, an OS can decide not to ship a "python" executable, and instead only ship python2/3, providing some ambiguity for scripts that are version-neutral, like the one Mono uses. This uses an automake macro to locate a suitable Python, and changes the makefile to use the located Python, whatever it may be.
The "python" interpreter is specified by PEP-394. In it, an OS
can decide not to ship a "python" executable, and instead only
ship python2/3, providing some ambiguity for scripts that are
version-neutral, like the one Mono uses.
This uses an automake macro to locate a suitable Python, and
changes the makefile to use the located Python, whatever it may be.