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

feat(gyp): update gyp to v0.14.0 #2749

Merged
merged 1 commit into from Oct 10, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 11 additions & 5 deletions gyp/.github/workflows/Python_tests.yml
Expand Up @@ -2,7 +2,12 @@
# TODO: Enable pytest --doctest-modules

name: Python_tests
on: [push, pull_request]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
Python_tests:
runs-on: ${{ matrix.os }}
Expand All @@ -11,17 +16,18 @@ jobs:
max-parallel: 8
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with flake8
run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics
- name: Test with pytest
Expand Down
13 changes: 8 additions & 5 deletions gyp/.github/workflows/node-gyp.yml
@@ -1,9 +1,12 @@
name: node-gyp integration

on: [push, pull_request]

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
integration:
strategy:
fail-fast: false
matrix:
Expand All @@ -24,7 +27,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 14.x
- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
Expand Down
9 changes: 7 additions & 2 deletions gyp/.github/workflows/nodejs-windows.yml
@@ -1,10 +1,15 @@
name: Node.js Windows integration

on: [push, pull_request]
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build-windows:
runs-on: windows-latest
runs-on: windows-2019
steps:
- name: Clone gyp-next
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions gyp/.github/workflows/release-please.yml
Expand Up @@ -8,9 +8,9 @@ jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
- uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
package-name: gyp-next
bump-minor-pre-major: Yes
bump-minor-pre-major: true
16 changes: 16 additions & 0 deletions gyp/CHANGELOG.md
@@ -1,5 +1,21 @@
# Changelog

## [0.14.0](https://github.com/nodejs/gyp-next/compare/v0.13.0...v0.14.0) (2022-10-08)


### Features

* 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))
* ninja build for iOS ([#174](https://github.com/nodejs/gyp-next/issues/174)) ([b6f2714](https://github.com/nodejs/gyp-next/commit/b6f271424e0033d7ed54d437706695af2ba7a1bf))
* **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))


### Bug Fixes

* lock windows env ([#163](https://github.com/nodejs/gyp-next/issues/163)) ([44bd0dd](https://github.com/nodejs/gyp-next/commit/44bd0ddc93ea0b5770a44dd326a2e4ae62c21442))
* move configuration information into pyproject.toml ([#176](https://github.com/nodejs/gyp-next/issues/176)) ([d69d8ec](https://github.com/nodejs/gyp-next/commit/d69d8ece6dbff7af4f2ea073c9fd170baf8cb7f7))
* 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))

## [0.13.0](https://www.github.com/nodejs/gyp-next/compare/v0.12.1...v0.13.0) (2022-05-11)


Expand Down
12 changes: 12 additions & 0 deletions gyp/pylib/gyp/__init__.py
Expand Up @@ -15,6 +15,7 @@
import traceback
from gyp.common import GypError


# Default debug modes for GYP
debug = {}

Expand Down Expand Up @@ -463,8 +464,19 @@ def gyp_main(args):
metavar="TARGET",
help="include only TARGET and its deep dependencies",
)
parser.add_argument(
"-V",
"--version",
dest="version",
action="store_true",
help="Show the version and exit.",
)

options, build_files_arg = parser.parse_args(args)
if options.version:
import pkg_resources
print(f"v{pkg_resources.get_distribution('gyp-next').version}")
return 0
build_files = build_files_arg

# Set up the configuration directory (defaults to ~/.gyp)
Expand Down
1 change: 1 addition & 0 deletions gyp/pylib/gyp/common.py
Expand Up @@ -470,6 +470,7 @@ def CopyTool(flavor, out_path, generator_flags={}):
"os400": "flock",
"solaris": "flock",
"mac": "mac",
"ios": "mac",
"win": "win",
}.get(flavor, None)
if not prefix:
Expand Down
46 changes: 40 additions & 6 deletions gyp/pylib/gyp/generator/make.py
Expand Up @@ -101,6 +101,7 @@ def CalculateVariables(default_variables, params):
default_variables.setdefault("SHARED_LIB_SUFFIX", ".a")
elif flavor == "zos":
default_variables.setdefault("SHARED_LIB_SUFFIX", ".x")
COMPILABLE_EXTENSIONS.update({".pli": "pli"})
else:
default_variables.setdefault("SHARED_LIB_SUFFIX", ".so")
default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)")
Expand Down Expand Up @@ -318,7 +319,7 @@ def CalculateGeneratorInputInfo(params):
cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)

quiet_cmd_solink = SOLINK($(TOOLSET)) $@
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
cmd_solink = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS)

quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS)
Expand Down Expand Up @@ -378,6 +379,7 @@ def CalculateGeneratorInputInfo(params):
LINK.target ?= %(LINK.target)s
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
PLI.target ?= %(PLI.target)s

# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)
Expand All @@ -391,6 +393,7 @@ def CalculateGeneratorInputInfo(params):
LINK.host ?= %(LINK.host)s
LDFLAGS.host ?= $(LDFLAGS_host)
AR.host ?= %(AR.host)s
PLI.host ?= %(PLI.host)s

# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
Expand Down Expand Up @@ -628,6 +631,15 @@ def WriteRootHeaderSuffixRules(writer):
writer.write("\n")


SHARED_HEADER_OS390_COMMANDS = """
PLIFLAGS.target ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS)
PLIFLAGS.host ?= -qlp=64 -qlimits=extname=31 $(PLIFLAGS)

quiet_cmd_pli = PLI($(TOOLSET)) $@
cmd_pli = $(PLI.$(TOOLSET)) $(GYP_PLIFLAGS) $(PLIFLAGS.$(TOOLSET)) -c $< && \
if [ -f $(notdir $@) ]; then /bin/cp $(notdir $@) $@; else true; fi
"""

SHARED_HEADER_SUFFIX_RULES_COMMENT1 = """\
# Suffix rules, putting all outputs into $(obj).
"""
Expand Down Expand Up @@ -2450,10 +2462,12 @@ def CalculateMakefilePath(build_file, base_name):
"AR.target": GetEnvironFallback(("AR_target", "AR"), "$(AR)"),
"CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "$(CXX)"),
"LINK.target": GetEnvironFallback(("LINK_target", "LINK"), "$(LINK)"),
"PLI.target": GetEnvironFallback(("PLI_target", "PLI"), "pli"),
"CC.host": GetEnvironFallback(("CC_host", "CC"), "gcc"),
"AR.host": GetEnvironFallback(("AR_host", "AR"), "ar"),
"CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "g++"),
"LINK.host": GetEnvironFallback(("LINK_host", "LINK"), "$(CXX.host)"),
"PLI.host": GetEnvironFallback(("PLI_host", "PLI"), "pli"),
}
if flavor == "mac":
flock_command = "./gyp-mac-tool flock"
Expand All @@ -2469,16 +2483,36 @@ def CalculateMakefilePath(build_file, base_name):
header_params.update({"link_commands": LINK_COMMANDS_ANDROID})
elif flavor == "zos":
copy_archive_arguments = "-fPR"
makedep_arguments = "-qmakedep=gcc"
CC_target = GetEnvironFallback(("CC_target", "CC"), "njsc")
makedep_arguments = "-MMD"
if CC_target == "clang":
CC_host = GetEnvironFallback(("CC_host", "CC"), "clang")
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "clang++")
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "clang++")
elif CC_target == "ibm-clang64":
CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang64")
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++64")
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++64")
elif CC_target == "ibm-clang":
CC_host = GetEnvironFallback(("CC_host", "CC"), "ibm-clang")
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "ibm-clang++")
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "ibm-clang++")
else:
# Node.js versions prior to v18:
makedep_arguments = "-qmakedep=gcc"
CC_host = GetEnvironFallback(("CC_host", "CC"), "njsc")
CXX_target = GetEnvironFallback(("CXX_target", "CXX"), "njsc++")
CXX_host = GetEnvironFallback(("CXX_host", "CXX"), "njsc++")
header_params.update(
{
"copy_archive_args": copy_archive_arguments,
"makedep_args": makedep_arguments,
"link_commands": LINK_COMMANDS_OS390,
"CC.target": GetEnvironFallback(("CC_target", "CC"), "njsc"),
"CXX.target": GetEnvironFallback(("CXX_target", "CXX"), "njsc++"),
"CC.host": GetEnvironFallback(("CC_host", "CC"), "njsc"),
"CXX.host": GetEnvironFallback(("CXX_host", "CXX"), "njsc++"),
"extra_commands": SHARED_HEADER_OS390_COMMANDS,
"CC.target": CC_target,
"CXX.target": CXX_target,
"CC.host": CC_host,
"CXX.host": CXX_host,
}
)
elif flavor == "solaris":
Expand Down
4 changes: 2 additions & 2 deletions gyp/pylib/gyp/generator/ninja.py
Expand Up @@ -1583,7 +1583,7 @@ def WriteTarget(self, spec, config_name, config, link_deps, compile_deps):
elif spec["type"] == "static_library":
self.target.binary = self.ComputeOutput(spec)
if (
self.flavor not in ("mac", "openbsd", "netbsd", "win")
self.flavor not in ("ios", "mac", "netbsd", "openbsd", "win")
and not self.is_standalone_static_library
):
self.ninja.build(
Expand Down Expand Up @@ -2496,7 +2496,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
),
)

if flavor != "mac" and flavor != "win":
if flavor not in ("ios", "mac", "win"):
master_ninja.rule(
"alink",
description="AR $out",
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/xcodeproj_file.py
Expand Up @@ -2990,7 +2990,7 @@ def AddOrGetProjectReference(self, other_pbxproject):
# Xcode seems to sort this list case-insensitively
self._properties["projectReferences"] = sorted(
self._properties["projectReferences"],
key=lambda x: x["ProjectRef"].Name().lower
key=lambda x: x["ProjectRef"].Name().lower()
)
else:
# The link already exists. Pull out the relevnt data.
Expand Down
41 changes: 41 additions & 0 deletions gyp/pyproject.toml
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "gyp-next"
version = "0.14.0"
authors = [
{ name="Node.js contributors", email="ryzokuken@disroot.org" },
]
description = "A fork of the GYP build system for use in the Node.js projects"
readme = "README.md"
license = { file="LICENSE" }
requires-python = ">=3.6"
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]

[project.optional-dependencies]
dev = ["flake8", "pytest"]

[project.scripts]
gyp = "gyp:script_main"

[project.urls]
"Homepage" = "https://github.com/nodejs/gyp-next"

[tool.setuptools]
package-dir = {"" = "pylib"}
packages = ["gyp", "gyp.generator"]
2 changes: 0 additions & 2 deletions gyp/requirements_dev.txt

This file was deleted.

42 changes: 0 additions & 42 deletions gyp/setup.py

This file was deleted.