Skip to content

Commit 8705263

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 <targos@protonmail.com> PR-URL: #39293 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent 0e22115 commit 8705263

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
@@ -44,6 +44,7 @@
4444
import getmoduleversion
4545
import getnapibuildversion
4646
from gyp_node import run_gyp
47+
from utils import SearchFiles
4748

4849
# imports in deps/v8/tools/node
4950
sys.path.insert(0, os.path.join('deps', 'v8', 'tools', 'node'))
@@ -1062,6 +1063,8 @@ def gcc_version_ge(version_checked):
10621063
return False
10631064
return True
10641065

1066+
def configure_node_lib_files(o):
1067+
o['variables']['node_library_files'] = SearchFiles('lib', 'js')
10651068

10661069
def configure_node(o):
10671070
if options.dest_os == 'android':
@@ -1805,6 +1808,7 @@ def make_bin_override():
18051808
flavor = GetFlavor(flavor_params)
18061809

18071810
configure_node(output)
1811+
configure_node_lib_files(output)
18081812
configure_napi(output)
18091813
configure_library('zlib', output)
18101814
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.js',

tools/search_files.py

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

0 commit comments

Comments
 (0)