From 33ff3068bbd49a00fff37c4d395d8f84c0534a45 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 5 Oct 2021 12:19:59 +0200 Subject: [PATCH 1/7] test: Add Python 3.10 to GitHub Actions (#127) --- .github/workflows/Python_tests.yml | 2 +- .github/workflows/node-gyp.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Python_tests.yml b/.github/workflows/Python_tests.yml index 92303b63..40ff521a 100644 --- a/.github/workflows/Python_tests.yml +++ b/.github/workflows/Python_tests.yml @@ -11,7 +11,7 @@ jobs: max-parallel: 8 matrix: os: [macos-latest, ubuntu-latest] # , windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/node-gyp.yml b/.github/workflows/node-gyp.yml index bd7c85ff..0c26a3d7 100644 --- a/.github/workflows/node-gyp.yml +++ b/.github/workflows/node-gyp.yml @@ -8,7 +8,7 @@ jobs: fail-fast: false matrix: os: [macos-latest, ubuntu-latest, windows-latest] - python: [3.6, 3.9] + python: ["3.6", "3.10"] runs-on: ${{ matrix.os }} steps: From f463a77705973289ea38fec1b244c922ac438e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 24 Nov 2021 11:12:45 +0100 Subject: [PATCH 2/7] fix(make): only generate makefile for multiple toolsets if requested (#133) It's already like this in the msvs and ninja generators. Refs: https://github.com/nodejs/node/pull/40934 --- pylib/gyp/generator/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index c595f20f..05e1f26a 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -50,7 +50,7 @@ } # Make supports multiple toolsets -generator_supports_multiple_toolsets = True +generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested() # Request sorted dependencies in the order from dependents to dependencies. generator_wants_sorted_dependencies = False From bb50155dd703aa6d86b792ff6ba69e230cf9ca2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Nov 2021 11:22:35 +0100 Subject: [PATCH 3/7] chore: release 0.10.1 (#134) --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d55ed6..57d691c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [0.10.1](https://www.github.com/nodejs/gyp-next/compare/v0.10.0...v0.10.1) (2021-11-24) + + +### Bug Fixes + +* **make:** only generate makefile for multiple toolsets if requested ([#133](https://www.github.com/nodejs/gyp-next/issues/133)) ([f463a77](https://www.github.com/nodejs/gyp-next/commit/f463a77705973289ea38fec1b244c922ac438e26)) + ## [0.10.0](https://www.github.com/nodejs/gyp-next/compare/v0.9.6...v0.10.0) (2021-08-26) diff --git a/setup.py b/setup.py index cf9d7d2e..576880a7 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( name="gyp-next", - version="0.10.0", + version="0.10.1", 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", From aa1a925435fc2a9ec81f0ba91f7555d9c40b7ecc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 20 Dec 2021 16:39:12 +0000 Subject: [PATCH 4/7] chore: refactor regular expression I don't think there are any tests for this but I did some command-line tests and, at least for the things I tested, this preserves the code behavior while avoiding backtracking issues in the regular expression. Closes: https://github.com/nodejs/gyp-next/issues/135 --- tools/pretty_gyp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pretty_gyp.py b/tools/pretty_gyp.py index 4ffa4445..6eef3a1b 100755 --- a/tools/pretty_gyp.py +++ b/tools/pretty_gyp.py @@ -90,7 +90,7 @@ def count_braces(line): """ open_braces = ["[", "(", "{"] close_braces = ["]", ")", "}"] - closing_prefix_re = re.compile(r"(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$") + closing_prefix_re = re.compile(r"[^\s\]\}\)]\s*[\]\}\)]+,?\s*$") cnt = 0 stripline = COMMENT_RE.sub(r"", line) stripline = QUOTE_RE.sub(r"''", stripline) From 35305d66b4f377e0f00e52d0426164a592779f17 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 2 Mar 2022 02:25:21 +0100 Subject: [PATCH 5/7] test: Update GitHub Actions (#139) --- .github/workflows/Python_tests.yml | 2 +- .github/workflows/node-gyp.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Python_tests.yml b/.github/workflows/Python_tests.yml index 40ff521a..76e53682 100644 --- a/.github/workflows/Python_tests.yml +++ b/.github/workflows/Python_tests.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/node-gyp.yml b/.github/workflows/node-gyp.yml index 0c26a3d7..c8d2455f 100644 --- a/.github/workflows/node-gyp.yml +++ b/.github/workflows/node-gyp.yml @@ -21,10 +21,10 @@ jobs: with: repository: nodejs/node-gyp path: node-gyp - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: 14.x - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} - name: Install dependencies From fdda4a3038b8a7042ad960ce7a223687c24a21b1 Mon Sep 17 00:00:00 2001 From: Kevin Adler Date: Thu, 3 Mar 2022 23:44:03 -0600 Subject: [PATCH 6/7] feat: Add proper support for IBM i (#140) Python 3.9 on IBM i now properly returns "os400" for sys.platform instead of claiming to be AIX as it did previously. While the IBM i PASE environment is compatible with AIX, it is a subset and has numerous differences which makes it beneficial to distinguish, however this means that it now needs explicit support here. --- pylib/gyp/common.py | 12 +++++++++--- pylib/gyp/flock_tool.py | 2 +- pylib/gyp/generator/make.py | 28 ++++++++++++++++++++++++++++ test_gyp.py | 1 + 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/pylib/gyp/common.py b/pylib/gyp/common.py index 9213fcc5..0847cdab 100644 --- a/pylib/gyp/common.py +++ b/pylib/gyp/common.py @@ -454,6 +454,8 @@ def GetFlavor(params): return "aix" if sys.platform.startswith(("os390", "zos")): return "zos" + if sys.platform == "os400": + return "os400" return "linux" @@ -463,9 +465,13 @@ def CopyTool(flavor, out_path, generator_flags={}): to |out_path|.""" # aix and solaris just need flock emulation. mac and win use more complicated # support scripts. - prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get( - flavor, None - ) + prefix = { + "aix": "flock", + "os400": "flock", + "solaris": "flock", + "mac": "mac", + "win": "win", + }.get(flavor, None) if not prefix: return diff --git a/pylib/gyp/flock_tool.py b/pylib/gyp/flock_tool.py index 1cb98152..0754aff2 100755 --- a/pylib/gyp/flock_tool.py +++ b/pylib/gyp/flock_tool.py @@ -41,7 +41,7 @@ def ExecFlock(self, lockfile, *cmd_list): # with EBADF, that's why we use this F_SETLK # hack instead. fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666) - if sys.platform.startswith("aix"): + if sys.platform.startswith("aix") or sys.platform == "os400": # Python on AIX is compiled with LARGEFILE support, which changes the # struct size. op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) diff --git a/pylib/gyp/generator/make.py b/pylib/gyp/generator/make.py index 05e1f26a..6ee56f95 100644 --- a/pylib/gyp/generator/make.py +++ b/pylib/gyp/generator/make.py @@ -237,6 +237,24 @@ def CalculateGeneratorInputInfo(params): """ # noqa: E501 +LINK_COMMANDS_OS400 = """\ +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X64 crs $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) +""" # noqa: E501 + + LINK_COMMANDS_OS390 = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) @@ -2351,6 +2369,16 @@ def CalculateMakefilePath(build_file, base_name): "flock_index": 2, } ) + elif flavor == "os400": + copy_archive_arguments = "-pPRf" + header_params.update( + { + "copy_archive_args": copy_archive_arguments, + "link_commands": LINK_COMMANDS_OS400, + "flock": "./gyp-flock-tool flock", + "flock_index": 2, + } + ) build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) make_global_settings_array = data[build_file].get("make_global_settings", []) diff --git a/test_gyp.py b/test_gyp.py index 9ba26417..b7bb956b 100755 --- a/test_gyp.py +++ b/test_gyp.py @@ -116,6 +116,7 @@ def main(argv=None): else: format_list = { "aix5": ["make"], + "os400": ["make"], "freebsd7": ["make"], "freebsd8": ["make"], "openbsd5": ["make"], From 181f2e2834dad1655e4055b261eb691619704631 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 08:59:12 +0100 Subject: [PATCH 7/7] chore: release 0.11.0 (#141) --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d691c1..18f3375f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.11.0](https://www.github.com/nodejs/gyp-next/compare/v0.10.1...v0.11.0) (2022-03-04) + + +### Features + +* Add proper support for IBM i ([#140](https://www.github.com/nodejs/gyp-next/issues/140)) ([fdda4a3](https://www.github.com/nodejs/gyp-next/commit/fdda4a3038b8a7042ad960ce7a223687c24a21b1)) + ### [0.10.1](https://www.github.com/nodejs/gyp-next/compare/v0.10.0...v0.10.1) (2021-11-24) diff --git a/setup.py b/setup.py index 576880a7..a2b774f6 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( name="gyp-next", - version="0.10.1", + version="0.11.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",