-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: prefer python 3 over 2 for configure #30091
Conversation
could you do it also for windows? the logic is in https://github.com/nodejs/node/blob/master/tools/msvs/find_python.cmd |
See the comment node/tools/msvs/find_python.cmd Lines 6 to 7 in 5a042a6
|
Ok. The 5th block didn't have a clear end, I removed node/tools/msvs/find_python.cmd Lines 85 to 97 in 5a042a6
PTAL @targos |
If someone can tell me exactly what this needs to be on Windows, I'll add it, but otherwise, I won't have the time for now, and I'll leave it (EDIT: meaning "abandon this PR") for others to pick it up. cc: @MylesBorins |
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 -- This is music to my ears!!! The mod to configure
looks appropriate to me.
I will let others judge the validity of the Windows changes but my choice would have been to simplify by first trying py
on Windows.
Given the various issues with macOS Catalina
in Node and in Node-gyp and given the fact that Catalina is not yet testable on Travis or GitHub Actions or Jenkins, I am not in a rush that we land this PR.
@sam-github I pushed a fixup to your branch with the Windows changes, feel free to remove or change as needed. This won't prefer Python 3, but I don't think we need to do that. This uses Python from PATH if it is there, as has always(?) been the Windows behavior. @cclauss adding a check for |
Change python search order to python3*, then python, then python2*.
vcbuild now searches for the first python.exe found, and uses it, where it used to look for Python 2 first.
0404d76
to
5cbec36
Compare
@joaocgreis Thanks for the commit. I detangled it from my fixup, so the first commit is pure Please take another look to ensure I got the commit description correct. |
Landed in 11275dc...d1d571e |
I think calling this major may be incorrect. If we support both py2 and py3, then it shouldn't matter which is found since they both work. But, I'm not sure how we get that kind of confidence. But, on the other hand, this only applies to builds of node from source, so perhaps its not so risky? I'd like some folks from @nodejs/tsc to weigh in. Can we land this on 13.x? Its easily revertible if it causes problems, and also probably easily fixable. In the meantime, I labelled it |
Change python search order to python3*, then python, then python2*. PR-URL: #30091 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
vcbuild now searches for the first python.exe found, and uses it, where it used to look for Python 2 first. PR-URL: #30091 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
If this is considered a semver major, does that mean it wouldn't go out in a release until after python 2 is EOL? |
yes |
But to be clear, WITHOUT this change, a build host that has only py3 would use py3. In other words, if someone builds 12.x and 13.x and is disturbed to find it used Py2 to run gyp... they should uninstall Py2. I should also say: Unless any concerns are raised, I'm personally in favour of landing on 13.x after its been on master a week or so, just to make sure no one pulling master is affected. And if after its been on 13.x for a month or 2, it would be considered stable enough for 12.x by @nodejs/lts (I think). |
I would prefer to try it in Node 13 as well due to the Python 2 EOL timing... in a way, that's kind of what the Current branch is for. |
OK, 3 votes for 13.x, none against, so I removed |
We have a |
Change python search order to python3*, then python, then python2*. PR-URL: #30091 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
vcbuild now searches for the first python.exe found, and uses it, where it used to look for Python 2 first. PR-URL: #30091 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: João Reis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
Change python search order to python3*, then python, then python2*.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes