NODE_GYP_FORCE_PYTHON doesn't affect gyp-mac-tool
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.7k
- Forks
- 1.9k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 5
Description
Node 12.14.1
macOS 10.15.5
node-gyp 5.1.1
Setting the environment variable NODE_GYP_FORCE_PYTHON seems to work for most things, but it doesn't change the Python version used by "gyp-mac-tool". I think the problem is that even though "gyp-mac-tool" is a Python program, it is just run as a generic executable with a shebang line:
#!/usr/bin/env python
So it ends up using whatever "python" is in the PATH, instead of what PythonFinder returns.
I'm not sure how to fix this...
- Maybe run "gyp-mac-tool" as "$PYTHON gyp-mac-tool" instead of as a generic executable? Does this require changes to gyp?
- Maybe node-gyp can do some temporary symlink/PATH stuff to ensure the right Python gets run?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing PythonFinder in lib/find-python.js and how gyp-mac-tool is invoked during the macOS build. Reproduce the issue with NODE_GYP_FORCE_PYTHON on the reported Node.js and node-gyp versions, then confirm that gyp-mac-tool uses the selected Python interpreter.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, python
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100