Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: update gyp-next to v0.13.0 #44605

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/gyp/.github/workflows/Python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions tools/gyp/.github/workflows/node-gyp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/gyp/.github/workflows/nodejs-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions tools/gyp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
14 changes: 9 additions & 5 deletions tools/gyp/pylib/gyp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
108 changes: 61 additions & 47 deletions tools/gyp/pylib/gyp/generator/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)."""
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand All @@ -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, (
Expand Down Expand Up @@ -1993,35 +2000,42 @@ 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],
installable_deps,
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,
Expand Down
2 changes: 1 addition & 1 deletion tools/gyp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down