Skip to content

NODE_GYP_FORCE_PYTHON doesn't affect gyp-mac-tool #2146

@cakoose

Description

@cakoose

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions