Skip to content

Commit 713b8dc

Browse files
authored
feat(gyp): update gyp to v0.14.0 (#2749)
1 parent 131d1a4 commit 713b8dc

File tree

13 files changed

+141
-67
lines changed

13 files changed

+141
-67
lines changed

gyp/.github/workflows/Python_tests.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
# TODO: Enable pytest --doctest-modules
33

44
name: Python_tests
5-
on: [push, pull_request]
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
workflow_dispatch:
611
jobs:
712
Python_tests:
813
runs-on: ${{ matrix.os }}
@@ -11,17 +16,18 @@ jobs:
1116
max-parallel: 8
1217
matrix:
1318
os: [macos-latest, ubuntu-latest] # , windows-latest]
14-
python-version: ["3.7", "3.8", "3.9", "3.10"]
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
1520
steps:
1621
- uses: actions/checkout@v3
1722
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v3
23+
uses: actions/setup-python@v4
1924
with:
2025
python-version: ${{ matrix.python-version }}
2126
- name: Install dependencies
2227
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r requirements_dev.txt
28+
python -m pip install --upgrade pip setuptools
29+
pip install --editable ".[dev]"
30+
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
2531
- name: Lint with flake8
2632
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
2733
- name: Test with pytest

gyp/.github/workflows/node-gyp.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: node-gyp integration
2-
3-
on: [push, pull_request]
4-
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
workflow_dispatch:
58
jobs:
6-
test:
9+
integration:
710
strategy:
811
fail-fast: false
912
matrix:
@@ -24,7 +27,7 @@ jobs:
2427
- uses: actions/setup-node@v3
2528
with:
2629
node-version: 14.x
27-
- uses: actions/setup-python@v3
30+
- uses: actions/setup-python@v4
2831
with:
2932
python-version: ${{ matrix.python }}
3033
- name: Install dependencies

gyp/.github/workflows/nodejs-windows.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
name: Node.js Windows integration
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
49

510
jobs:
611
build-windows:
7-
runs-on: windows-latest
12+
runs-on: windows-2019
813
steps:
914
- name: Clone gyp-next
1015
uses: actions/checkout@v3

gyp/.github/workflows/release-please.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ jobs:
88
release-please:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: GoogleCloudPlatform/release-please-action@v2
11+
- uses: google-github-actions/release-please-action@v3
1212
with:
1313
token: ${{ secrets.GITHUB_TOKEN }}
1414
release-type: python
1515
package-name: gyp-next
16-
bump-minor-pre-major: Yes
16+
bump-minor-pre-major: true

gyp/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)
4+
5+
6+
### Features
7+
8+
* Add command line argument for `gyp --version` ([#164](https://github.com/nodejs/gyp-next/issues/164)) ([5c9f4d0](https://github.com/nodejs/gyp-next/commit/5c9f4d05678dd855e18ed2327219e5d18e5374db))
9+
* ninja build for iOS ([#174](https://github.com/nodejs/gyp-next/issues/174)) ([b6f2714](https://github.com/nodejs/gyp-next/commit/b6f271424e0033d7ed54d437706695af2ba7a1bf))
10+
* **zos:** support IBM Open XL C/C++ & PL/I compilers on z/OS ([#178](https://github.com/nodejs/gyp-next/issues/178)) ([43a7211](https://github.com/nodejs/gyp-next/commit/43a72110ae3fafb13c9625cc7a969624b27cda47))
11+
12+
13+
### Bug Fixes
14+
15+
* lock windows env ([#163](https://github.com/nodejs/gyp-next/issues/163)) ([44bd0dd](https://github.com/nodejs/gyp-next/commit/44bd0ddc93ea0b5770a44dd326a2e4ae62c21442))
16+
* move configuration information into pyproject.toml ([#176](https://github.com/nodejs/gyp-next/issues/176)) ([d69d8ec](https://github.com/nodejs/gyp-next/commit/d69d8ece6dbff7af4f2ea073c9fd170baf8cb7f7))
17+
* node.js debugger adds stderr (but exit code is 0) -> shouldn't throw ([#179](https://github.com/nodejs/gyp-next/issues/179)) ([1a457d9](https://github.com/nodejs/gyp-next/commit/1a457d9ed08cfd30c9fa551bc5cf0d90fb583787))
18+
319
## [0.13.0](https://www.github.com/nodejs/gyp-next/compare/v0.12.1...v0.13.0) (2022-05-11)
420

521

gyp/pylib/gyp/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import traceback
1616
from gyp.common import GypError
1717

18+
1819
# Default debug modes for GYP
1920
debug = {}
2021

@@ -463,8 +464,19 @@ def gyp_main(args):
463464
metavar="TARGET",
464465
help="include only TARGET and its deep dependencies",
465466
)
467+
parser.add_argument(
468+
"-V",
469+
"--version",
470+
dest="version",
471+
action="store_true",
472+
help="Show the version and exit.",
473+
)
466474

467475
options, build_files_arg = parser.parse_args(args)
476+
if options.version:
477+
import pkg_resources
478+
print(f"v{pkg_resources.get_distribution('gyp-next').version}")
479+
return 0
468480
build_files = build_files_arg
469481

470482
# Set up the configuration directory (defaults to ~/.gyp)

gyp/pylib/gyp/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ def CopyTool(flavor, out_path, generator_flags={}):
470470
"os400": "flock",
471471
"solaris": "flock",
472472
"mac": "mac",
473+
"ios": "mac",
473474
"win": "win",
474475
}.get(flavor, None)
475476
if not prefix:

gyp/pylib/gyp/generator/make.py

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def CalculateVariables(default_variables, params):
101101
default_variables.setdefault("SHARED_LIB_SUFFIX", ".a")
102102
elif flavor == "zos":
103103
default_variables.setdefault("SHARED_LIB_SUFFIX", ".x")
104+
COMPILABLE_EXTENSIONS.update({".pli": "pli"})
104105
else:
105106
default_variables.setdefault("SHARED_LIB_SUFFIX", ".so")
106107
default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)")
@@ -318,7 +319,7 @@ def CalculateGeneratorInputInfo(params):
318319
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
319320
320321
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
321-
cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,DLL -o $(patsubst %.x,%.so,$@) $(LD_INPUTS) $(LIBS) && if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi
322+
cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)
322323
323324
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
324325
cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
@@ -378,6 +379,7 @@ def CalculateGeneratorInputInfo(params):
378379
LINK.target ?= %(LINK.target)s
379380
LDFLAGS.target ?= $(LDFLAGS)
380381
AR.target ?= $(AR)
382+
PLI.target ?= %(PLI.target)s
381383
382384
# C++ apps need to be linked with g++.
383385
LINK ?= $(CXX.target)
@@ -391,6 +393,7 @@ def CalculateGeneratorInputInfo(params):
391393
LINK.host ?= %(LINK.host)s
392394
LDFLAGS.host ?= $(LDFLAGS_host)
393395
AR.host ?= %(AR.host)s
396+
PLI.host ?= %(PLI.host)s
394397
395398
# Define a dir function that can handle spaces.
396399
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
@@ -628,6 +631,15 @@ def WriteRootHeaderSuffixRules(writer):
628631
writer.write("\n")
629632

630633

634+
SHARED_HEADER_OS390_COMMANDS = """
635+
PLIFLAGS.target ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS)
636+
PLIFLAGS.host ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS)
637+
638+
quiet_cmd_pli = PLI($(TOOLSET)) $@
639+
cmd_pli = $(PLI.$(TOOLSET)) $(GYP_PLIFLAGS) $(PLIFLAGS.$(TOOLSET)) -c $< && \
640+
if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi
641+
"""
642+
631643
SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\
632644
# Suffix rules, putting all outputs into $(obj).
633645
"""
@@ -2450,10 +2462,12 @@ def CalculateMakefilePath(build_file, base_name):
24502462
"AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"),
24512463
"CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"),
24522464
"LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"),
2465+
"PLI.target": GetEnvironFallback(("PLI_target", "PLI"), "pli"),
24532466
"CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"),
24542467
"AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"),
24552468
"CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"),
24562469
"LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"),
2470+
"PLI.host": GetEnvironFallback(("PLI_host", "PLI"), "pli"),
24572471
}
24582472
if flavor == "mac":
24592473
flock_command = "./gyp-mac-tool flock"
@@ -2469,16 +2483,36 @@ def CalculateMakefilePath(build_file, base_name):
24692483
header_params.update({"link_commands": LINK_COMMANDS_ANDROID})
24702484
elif flavor == "zos":
24712485
copy_archive_arguments = "-fPR"
2472-
makedep_arguments = "-qmakedep=gcc"
2486+
CC_target = GetEnvironFallback(("CC_target", "CC"), "njsc")
2487+
makedep_arguments = "-MMD"
2488+
if CC_target == "clang":
2489+
CC_host = GetEnvironFallback(("CC_host", "CC"), "clang")
2490+
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "clang++")
2491+
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "clang++")
2492+
elif CC_target == "ibm-clang64":
2493+
CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang64")
2494+
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++64")
2495+
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++64")
2496+
elif CC_target == "ibm-clang":
2497+
CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang")
2498+
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++")
2499+
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++")
2500+
else:
2501+
# Node.js versions prior to v18:
2502+
makedep_arguments = "-qmakedep=gcc"
2503+
CC_host = GetEnvironFallback(("CC_host", "CC"), "njsc")
2504+
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "njsc++")
2505+
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "njsc++")
24732506
header_params.update(
24742507
{
24752508
"copy_archive_args": copy_archive_arguments,
24762509
"makedep_args": makedep_arguments,
24772510
"link_commands": LINK_COMMANDS_OS390,
2478-
"CC.target": GetEnvironFallback(("CC_target", "CC"), "njsc"),
2479-
"CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "njsc++"),
2480-
"CC.host": GetEnvironFallback(("CC_host", "CC"), "njsc"),
2481-
"CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "njsc++"),
2511+
"extra_commands": SHARED_HEADER_OS390_COMMANDS,
2512+
"CC.target": CC_target,
2513+
"CXX.target": CXX_target,
2514+
"CC.host": CC_host,
2515+
"CXX.host": CXX_host,
24822516
}
24832517
)
24842518
elif flavor == "solaris":

gyp/pylib/gyp/generator/ninja.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
15831583
elif spec["type"] == "static_library":
15841584
self.target.binary = self.ComputeOutput(spec)
15851585
if (
1586-
self.flavor not in ("mac", "openbsd", "netbsd", "win")
1586+
self.flavor not in ("ios", "mac", "netbsd", "openbsd", "win")
15871587
and not self.is_standalone_static_library
15881588
):
15891589
self.ninja.build(
@@ -2496,7 +2496,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
24962496
),
24972497
)
24982498

2499-
if flavor != "mac" and flavor != "win":
2499+
if flavor not in ("ios", "mac", "win"):
25002500
master_ninja.rule(
25012501
"alink",
25022502
description="AR $out",

gyp/pylib/gyp/xcodeproj_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2990,7 +2990,7 @@ def AddOrGetProjectReference(self, other_pbxproject):
29902990
# Xcode seems to sort this list case-insensitively
29912991
self._properties["projectReferences"] = sorted(
29922992
self._properties["projectReferences"],
2993-
key=lambda x: x["ProjectRef"].Name().lower
2993+
key=lambda x: x["ProjectRef"].Name().lower()
29942994
)
29952995
else:
29962996
# The link already exists. Pull out the relevnt data.

0 commit comments

Comments
 (0)