From cf2fd0e5617d0bfe3da455685bcbba23e45a90c9 Mon Sep 17 00:00:00 2001 From: himself65 Date: Thu, 8 Jul 2021 00:19:00 +0800 Subject: [PATCH] build: add `library_files` to gyp variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- configure.py | 4 ++++ node.gyp | 2 +- tools/search_files.py | 22 ---------------------- 3 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 tools/search_files.py diff --git a/configure.py b/configure.py index 4bc790e2f24219..533849324d27ee 100755 --- a/configure.py +++ b/configure.py @@ -45,6 +45,7 @@ import getnapibuildversion import getsharedopensslhasquic from gyp_node import run_gyp +from utils import SearchFiles # parse our options parser = argparse.ArgumentParser() @@ -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': @@ -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) diff --git a/node.gyp b/node.gyp index 691ce22ff3d664..be50b280fc5946 100644 --- a/node.gyp +++ b/node.gyp @@ -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': [ - '