Skip to content

Commit 3482bca

Browse files
legendecastargos
authored andcommitted
build: override python executable path on configure
PR-URL: #39465 Fixes: #39408 Fixes: #39456 Reviewed-By: Zeyu Yang <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 61b4a98 commit 3482bca

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ out/Makefile: config.gypi common.gypi node.gyp \
152152
# and included in config.gypi
153153
config.gypi: configure configure.py src/node_version.h
154154
@if [ -x config.status ]; then \
155-
./config.status; \
155+
export PATH="$(NO_BIN_OVERRIDE_PATH)" && ./config.status; \
156156
else \
157157
echo Missing or stale $@, please run ./$<; \
158158
exit 1; \

configure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,10 @@ def make_bin_override():
19051905
if options.compile_commands_json:
19061906
gyp_args += ['-f', 'compile_commands_json']
19071907

1908+
# override the variable `python` defined in common.gypi
1909+
if bin_override is not None:
1910+
gyp_args += ['-Dpython=' + sys.executable]
1911+
19081912
# pass the leftover positional arguments to GYP
19091913
gyp_args += args
19101914

node.gyp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@
745745
'outputs': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'],
746746
'process_outputs_as_sources': 1,
747747
'action': [
748-
'python',
748+
'<(python)',
749749
'tools/mkssldef.py',
750750
'<@(mkssldef_flags)',
751751
'-o',
@@ -771,7 +771,7 @@
771771
'<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
772772
],
773773
'action': [
774-
'python',
774+
'<(python)',
775775
'tools/js2c.py',
776776
'--directory',
777777
'lib',

0 commit comments

Comments
 (0)