GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — build: allow build with system python 3 by forivall · Pull Request #16058 · nodejs/node Conversation
Contributor
When the system python is python 3, configure now creates a directory Checklist
Affected core subsystem(s)build
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
CI: https://ci.nodejs.org/job/node-test-commit/12832/ EDIT: CI was green. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc/ @nodejs/build @nodejs/python |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| raise e | ||
| os.symlink(sys.executable, python_link) | ||
|
|
||
| os.environ['PATH'] = bin_override + ':' + os.environ['PATH'] |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is a no-op as far as I can tell, it doesn't affect the parent shell.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
gyp does a "python -c" call, and this is required for it to work. Will add comment
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| bin_override = None | ||
|
|
||
| def setup_bin_overrides(): | ||
| global bin_override |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What is the reason you use a global instead of returning a value?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It mirrored what other stages were doing, with setting values in "o". Returning makes more sense, will change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| bin_override = os.path.abspath('out/tools/bin') | ||
| try: | ||
| os.makedirs(bin_override) | ||
| except os.error as e: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the rest of the file, can you use OSError in this function?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| setup_bin_overrides() | ||
| if bin_override: | ||
| config = 'export PATH:=' + bin_override + ':${PATH}\n' + config |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, why ${PATH} and not $(PATH)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's what was on the stack overflow answer. 😝 Will change if I can
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches
73bcd94 to
741a772
Compare
|
Updated for reviews. Diff @ forivall@528a99d |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in 2b5b423. Thanks for fixing this @forivall , and congrats on becoming a Contributor 🎉 . |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches PR-URL: #16058 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches PR-URL: #16058 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches PR-URL: nodejs/node#16058 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
|
This change made Node.js build need install distutils packages which is a dependency change, python3 won't break old build environment but distutils dependency will, maybe we can implement a less dependent method to find default python binary? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@hefangshi distutils is part of python's stdlib. Are you thinking of setuptools? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like @hefangshi what platform and version of Python are you on? Also this commit doesn't add the distutils dependency, it was there before (from the diff 2b5b423): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
+1 on landing on a future v6.x release, and it should land with #16241 (assuming that lands). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Yeah, i had assumed the distutils would be fine since it would be loaded if it was python 3 or <= 2.5. there's probably an alternative version of 'which' that doesn't depend on distutils, since that's the only thing it's used for. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
waiting for #16241 before landing this on v6.x. Please LMK if we don't need to wait |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches PR-URL: #16058 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches PR-URL: #16058 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
When the system python is python 3, configure now creates a directory with a symlink called 'python' to python2, uses it when it calls run_gyp, and puts it in config.mk so that it propagates to everything that make launches PR-URL: #16058 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Bryan English <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.