-
Notifications
You must be signed in to change notification settings - Fork 1.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
gyp should use Python 3 not Python #2660
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
|
||
set -e | ||
base=$(dirname "$0") | ||
exec python "${base}/gyp_main.py" "$@" | ||
exec python3 "${base}/gyp_main.py" "$@" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't this variable consider python-related settings described here?
https://github.com/nodejs/node-gyp#configuring-python-dependency
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.
My PR would effectively do what you're suggesting @biodranik. (I haven't re-reviewed my own PR in a while, so I'd want a chance to do that before/if it got merged.)
(For those familiar with the deep workings of this repo: My PR would make gyp run with the Python binary found by
find-python.js
...find-python.js
is the script that honors all those Python binary configuration options you linked to.)Granted, most users with a Python binary that can run gyp have it accessible on their PATH as
python
and/or aspython3
. (Or they have some compatible Python aspython
and/orpython3
on their PATH). So for most users, my PR is not needed.For those who don't; for the few who rely exclusively on those Python binary configuration options node-gyp offers to pass
find-python.js
, who don't have such a compatible-with-gyp Python binary on their PATH, it feels like the configs are a bit of a lie, and them not being used to actually run gyp is a bit of a broken promise (promise implied by the existence of the config options).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.
Actually... digging deeper and doing some quick testing... the file
gyp/gyp
modified by this PR is apparently never run by node-gyp. This file is a tiny bash script wrapper aroundgyp/gyp_main.py
. node-gyp skips the wrapper in favor of runninggyp/gyp_main.py
directly.It does so here:
I also modified the
gyp/gyp
script to echo some stuff andtouch
a file at an absolute path, then rannode-gyp rebuild
to see if anything happened. Nothing was echoed fromgyp/gyp
, and the file was nottouch
ed/was not present on my disk. So... I conclude thegyp/gyp
script was not run bynode-gyp
.(end of expanded info)
Given the above, I think this PR is fully unnecessary for the
node-gyp
repo, should make zero difference, as this is in a file that is not ever being run. (Might be of some use at https://github.com/nodejs/gyp-next??)