Skip to content

Commit cf2fd0e

Browse files
himself65targos
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]>
1 parent 4de6f20 commit cf2fd0e

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()
@@ -1148,6 +1149,8 @@ def gcc_version_ge(version_checked):
11481149
return False
11491150
return True
11501151

1152+
def configure_node_lib_files(o):
1153+
o['variables']['node_library_files'] = SearchFiles('lib', 'js')
11511154

11521155
def configure_node(o):
11531156
if options.dest_os == 'android':
@@ -1896,6 +1899,7 @@ def make_bin_override():
18961899
flavor = GetFlavor(flavor_params)
18971900

18981901
configure_node(output)
1902+
configure_node_lib_files(output)
18991903
configure_napi(output)
19001904
configure_library('zlib', output)
19011905
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)