From d31ea02a0161485e14f9c39adc844e56269e7a6e Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Wed, 14 Sep 2022 15:55:11 +0800 Subject: [PATCH] tools: update gyp-next to v0.13.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/44605 Reviewed-By: Michaƫl Zasso Reviewed-By: Ben Noordhuis Reviewed-By: Ujjwal Sharma Reviewed-By: Mohammed Keyvanzadeh --- tools/gyp/.github/workflows/Python_tests.yml | 4 +- tools/gyp/.github/workflows/node-gyp.yml | 6 +- .../gyp/.github/workflows/nodejs-windows.yml | 4 +- tools/gyp/CHANGELOG.md | 12 ++ tools/gyp/pylib/gyp/__init__.py | 14 ++- tools/gyp/pylib/gyp/generator/make.py | 108 ++++++++++-------- tools/gyp/setup.py | 2 +- 7 files changed, 90 insertions(+), 60 deletions(-) diff --git a/tools/gyp/.github/workflows/Python_tests.yml b/tools/gyp/.github/workflows/Python_tests.yml index 76e536826b9181..1cfa42f563ce5f 100644 --- a/tools/gyp/.github/workflows/Python_tests.yml +++ b/tools/gyp/.github/workflows/Python_tests.yml @@ -11,9 +11,9 @@ jobs: max-parallel: 8 matrix: os: [macos-latest, ubuntu-latest] # , windows-latest] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: diff --git a/tools/gyp/.github/workflows/node-gyp.yml b/tools/gyp/.github/workflows/node-gyp.yml index c8d2455f13e5eb..fc28a0b512e5a7 100644 --- a/tools/gyp/.github/workflows/node-gyp.yml +++ b/tools/gyp/.github/workflows/node-gyp.yml @@ -8,16 +8,16 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python: ["3.6", "3.10"] + python: ["3.7", "3.10"] runs-on: ${{ matrix.os }} steps: - name: Clone gyp-next - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: gyp-next - name: Clone nodejs/node-gyp - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: nodejs/node-gyp path: node-gyp diff --git a/tools/gyp/.github/workflows/nodejs-windows.yml b/tools/gyp/.github/workflows/nodejs-windows.yml index fffe96e33b815e..53bd7367274c12 100644 --- a/tools/gyp/.github/workflows/nodejs-windows.yml +++ b/tools/gyp/.github/workflows/nodejs-windows.yml @@ -7,11 +7,11 @@ jobs: runs-on: windows-latest steps: - name: Clone gyp-next - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: gyp-next - name: Clone nodejs/node - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: nodejs/node path: node diff --git a/tools/gyp/CHANGELOG.md b/tools/gyp/CHANGELOG.md index 09ceed8d41c245..a103250cd5399c 100644 --- a/tools/gyp/CHANGELOG.md +++ b/tools/gyp/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [0.13.0](https://www.github.com/nodejs/gyp-next/compare/v0.12.1...v0.13.0) (2022-05-11) + + +### Features + +* add PRODUCT_DIR_ABS variable ([#151](https://www.github.com/nodejs/gyp-next/issues/151)) ([80d2626](https://www.github.com/nodejs/gyp-next/commit/80d26263581db829b61b312a7bdb5cc791df7824)) + + +### Bug Fixes + +* execvp: printf: Argument list too long ([#147](https://www.github.com/nodejs/gyp-next/issues/147)) ([c4e14f3](https://www.github.com/nodejs/gyp-next/commit/c4e14f301673fadbac3ab7882d0b5f4d02530cb9)) + ### [0.12.1](https://www.github.com/nodejs/gyp-next/compare/v0.12.0...v0.12.1) (2022-04-06) diff --git a/tools/gyp/pylib/gyp/__init__.py b/tools/gyp/pylib/gyp/__init__.py index f44859d1b005ee..976d5b6aa88e09 100755 --- a/tools/gyp/pylib/gyp/__init__.py +++ b/tools/gyp/pylib/gyp/__init__.py @@ -104,12 +104,16 @@ def Load( default_variables.setdefault(key, val) output_dir = params["options"].generator_output or params["options"].toplevel_dir - if (default_variables['GENERATOR'] == 'ninja'): - default_variables.setdefault("PRODUCT_DIR_ABS", os.path.join(output_dir, - 'out', default_variables['build_type'])) + if default_variables["GENERATOR"] == "ninja": + default_variables.setdefault( + "PRODUCT_DIR_ABS", + os.path.join(output_dir, "out", default_variables["build_type"]), + ) else: - default_variables.setdefault("PRODUCT_DIR_ABS", os.path.join(output_dir, - default_variables['build_type'])) + default_variables.setdefault( + "PRODUCT_DIR_ABS", + os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]), + ) # Give the generator the opportunity to set additional variables based on # the params it will receive in the output phase. diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py index 97ca56075675f9..e225326e1d09b6 100644 --- a/tools/gyp/pylib/gyp/generator/make.py +++ b/tools/gyp/pylib/gyp/generator/make.py @@ -106,6 +106,7 @@ def CalculateVariables(default_variables, params): default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)") default_variables.setdefault("LIB_DIR", "$(obj).$(TOOLSET)") + def CalculateGeneratorInputInfo(params): """Calculate the generator specific info that gets fed to input (called by gyp).""" @@ -157,12 +158,12 @@ def CalculateGeneratorInputInfo(params): # Note: this does not handle spaces in paths define xargs - $(1) $(word 1,$(2)) + $(1) $(word 1,$(2)) $(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2)))) endef define write-to-file - @: >$(1) + @: >$(1) $(call xargs,@printf "%s\\n" >>$(1),$(2)) endef @@ -226,12 +227,12 @@ def CalculateGeneratorInputInfo(params): # Note: this does not handle spaces in paths define xargs - $(1) $(word 1,$(2)) + $(1) $(word 1,$(2)) $(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2)))) endef define write-to-file - @: >$(1) + @: >$(1) $(call xargs,@printf "%s\\n" >>$(1),$(2)) endef @@ -1858,35 +1859,35 @@ def WriteTarget( self.flavor not in ("mac", "openbsd", "netbsd", "win") and not self.is_standalone_static_library ): - if self.flavor in ('linux', 'android'): - self.WriteMakeRule( - [self.output_binary], - link_deps, - actions = ['$(call create_thin_archive,$@,$^)'] - ) + if self.flavor in ("linux", "android"): + self.WriteMakeRule( + [self.output_binary], + link_deps, + actions=["$(call create_thin_archive,$@,$^)"], + ) else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "alink_thin", - part_of_all, - postbuilds=postbuilds, - ) + self.WriteDoCmd( + [self.output_binary], + link_deps, + "alink_thin", + part_of_all, + postbuilds=postbuilds, + ) else: - if self.flavor in ('linux', 'android'): - self.WriteMakeRule( - [self.output_binary], - link_deps, - actions = ['$(call create_archive,$@,$^)'] - ) - else: - self.WriteDoCmd( - [self.output_binary], - link_deps, - "alink", - part_of_all, - postbuilds=postbuilds, - ) + if self.flavor in ("linux", "android"): + self.WriteMakeRule( + [self.output_binary], + link_deps, + actions=["$(call create_archive,$@,$^)"], + ) + else: + self.WriteDoCmd( + [self.output_binary], + link_deps, + "alink", + part_of_all, + postbuilds=postbuilds, + ) elif self.type == "shared_library": self.WriteLn( "%s: LD_INPUTS := %s" @@ -1904,9 +1905,15 @@ def WriteTarget( ) # z/OS has a .so target as well as a sidedeck .x target if self.flavor == "zos": - self.WriteLn('%s: %s' % ( - QuoteSpaces(self.GetSharedObjectFromSidedeck(self.output_binary)), - QuoteSpaces(self.output_binary))) + self.WriteLn( + "%s: %s" + % ( + QuoteSpaces( + self.GetSharedObjectFromSidedeck(self.output_binary) + ), + QuoteSpaces(self.output_binary), + ) + ) elif self.type == "loadable_module": for link_dep in link_deps: assert " " not in link_dep, ( @@ -1993,21 +2000,28 @@ def WriteTarget( ) if self.flavor != "zos": installable_deps.append(install_path) - if self.flavor == 'zos' and self.type == 'shared_library': + if self.flavor == "zos" and self.type == "shared_library": # lib.target/libnode.so has a dependency on $(obj).target/libnode.so - self.WriteDoCmd([self.GetSharedObjectFromSidedeck(install_path)], - [self.GetSharedObjectFromSidedeck(self.output)], 'copy', - comment='Copy this to the %s output path.' % - file_desc, part_of_all=part_of_all) + self.WriteDoCmd( + [self.GetSharedObjectFromSidedeck(install_path)], + [self.GetSharedObjectFromSidedeck(self.output)], + "copy", + comment="Copy this to the %s output path." % file_desc, + part_of_all=part_of_all, + ) # Create a symlink of libnode.x to libnode.version.x - self.WriteDoCmd([self.GetUnversionedSidedeckFromSidedeck(install_path)], - [install_path], 'symlink', - comment='Symlnk this to the %s output path.' % - file_desc, part_of_all=part_of_all) + self.WriteDoCmd( + [self.GetUnversionedSidedeckFromSidedeck(install_path)], + [install_path], + "symlink", + comment="Symlnk this to the %s output path." % file_desc, + part_of_all=part_of_all, + ) # Place libnode.version.so and libnode.x symlink in lib.target dir installable_deps.append(self.GetSharedObjectFromSidedeck(install_path)) installable_deps.append( - self.GetUnversionedSidedeckFromSidedeck(install_path)) + self.GetUnversionedSidedeckFromSidedeck(install_path) + ) if self.output != self.alias and self.alias != self.target: self.WriteMakeRule( [self.alias], @@ -2015,13 +2029,13 @@ def WriteTarget( comment="Short alias for building this %s." % file_desc, phony=True, ) - if self.flavor == 'zos' and self.type == 'shared_library': + if self.flavor == "zos" and self.type == "shared_library": # Make sure that .x symlink target is run self.WriteMakeRule( - ['all'], + ["all"], [ self.GetUnversionedSidedeckFromSidedeck(install_path), - self.GetSharedObjectFromSidedeck(install_path) + self.GetSharedObjectFromSidedeck(install_path), ], comment='Add %s to "all" target.' % file_desc, phony=True, diff --git a/tools/gyp/setup.py b/tools/gyp/setup.py index fa2eefe39f5312..1bb6908deaf8ce 100644 --- a/tools/gyp/setup.py +++ b/tools/gyp/setup.py @@ -15,7 +15,7 @@ setup( name="gyp-next", - version="0.12.1", + version="0.13.0", description="A fork of the GYP build system for use in the Node.js projects", long_description=long_description, long_description_content_type="text/markdown",