Skip to content

Commit a747257

Browse files
himself65targos
authored andcommitted
build: add library_files to gyp variables
GYP uses the system path when parsing node.gyp; However, if system python is different from our gyp runtime python, like '2.7', gyp would crash. Co-authored-by: Michaël Zasso <[email protected]> PR-URL: #39293 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent d0fb02c commit a747257

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

configure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import getnapibuildversion
4646
import getsharedopensslhasquic
4747
from gyp_node import run_gyp
48+
from utils import SearchFiles
4849

4950
# parse our options
5051
parser = argparse.ArgumentParser()
@@ -1155,6 +1156,8 @@ def gcc_version_ge(version_checked):
11551156
return False
11561157
return True
11571158

1159+
def configure_node_lib_files(o):
1160+
o['variables']['node_library_files'] = SearchFiles('lib', 'js')
11581161

11591162
def configure_node(o):
11601163
if options.dest_os == 'android':
@@ -1903,6 +1906,7 @@ def make_bin_override():
19031906
flavor = GetFlavor(flavor_params)
19041907

19051908
configure_node(output)
1909+
configure_node_lib_files(output)
19061910
configure_napi(output)
19071911
configure_library('zlib', output)
19081912
configure_library('http_parser', output)

node.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# Windows command length limit or there would be an error.
3434
# See https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
3535
'library_files': [
36-
'<!@(python tools/search_files.py --ext js lib)',
36+
'<@(node_library_files)',
3737
],
3838
'deps_files': [
3939
'deps/v8/tools/splaytree.mjs',

tools/search_files.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)