Skip to content

Commit

Permalink
build: override python executable path on configure
Browse files Browse the repository at this point in the history
PR-URL: #39465
Fixes: #39408
Fixes: #39456
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
legendecas authored and targos committed Aug 2, 2021
1 parent 869ced9 commit a8961bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ out/Makefile: config.gypi common.gypi node.gyp \
# and included in config.gypi
config.gypi: configure configure.py src/node_version.h
@if [ -x config.status ]; then \
./config.status; \
export PATH="$(NO_BIN_OVERRIDE_PATH)" && ./config.status; \
else \
echo Missing or stale $@, please run ./$<; \
exit 1; \
Expand Down
4 changes: 4 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,10 @@ def make_bin_override():
if options.compile_commands_json:
gyp_args += ['-f', 'compile_commands_json']

# override the variable `python` defined in common.gypi
if bin_override is not None:
gyp_args += ['-Dpython=' + sys.executable]

# pass the leftover positional arguments to GYP
gyp_args += args

Expand Down
4 changes: 2 additions & 2 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
'outputs': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(python)',
'tools/mkssldef.py',
'<@(mkssldef_flags)',
'-o',
Expand All @@ -816,7 +816,7 @@
'<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
],
'action': [
'python',
'<(python)',
'tools/js2c.py',
'--directory',
'lib',
Expand Down

0 comments on commit a8961bc

Please sign in to comment.