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 <targos@protonmail.com>
  • Loading branch information
himself65 and targos committed Jul 8, 2021
1 parent 4de6f20 commit cf2fd0e
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 @@ -45,6 +45,7 @@
import getnapibuildversion
import getsharedopensslhasquic
from gyp_node import run_gyp
from utils import SearchFiles

# parse our options
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -1148,6 +1149,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 @@ -1896,6 +1899,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.mjs',
Expand Down
22 changes: 0 additions & 22 deletions tools/search_files.py

This file was deleted.

0 comments on commit cf2fd0e

Please sign in to comment.