Skip to content

Commit

Permalink
build: add library_files to gyp variables
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
himself65 authored and targos committed Sep 4, 2021
1 parent 0e22115 commit 8705263
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
4 changes: 4 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import getmoduleversion
import getnapibuildversion
from gyp_node import run_gyp
from utils import SearchFiles

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

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

def configure_node(o):
if options.dest_os == 'android':
Expand Down Expand Up @@ -1805,6 +1808,7 @@ def make_bin_override():
flavor = GetFlavor(flavor_params)

configure_node(output)
configure_node_lib_files(output)
configure_napi(output)
configure_library('zlib', output)
configure_library('http_parser', output)
Expand Down
2 changes: 1 addition & 1 deletion node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# Windows command length limit or there would be an error.
# See https://docs.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
'library_files': [
'<!@(python tools/search_files.py --ext js lib)',
'<@(node_library_files)',
],
'deps_files': [
'deps/v8/tools/splaytree.js',
Expand Down
22 changes: 0 additions & 22 deletions tools/search_files.py

This file was deleted.

0 comments on commit 8705263

Please sign in to comment.