Skip to content

Commit 1f9d15a

Browse files
nodejs-github-botgengjiawen
authored andcommitted
feat: update gyp-next to v0.22.0
1 parent 393ec2b commit 1f9d15a

12 files changed

Lines changed: 70 additions & 33 deletions

File tree

gyp/.github/workflows/python_tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# TODO: Enable os: windows-latest
21
# TODO: Enable pytest --doctest-modules
32

43
name: Python_tests
@@ -14,11 +13,15 @@ jobs:
1413
fail-fast: false
1514
max-parallel: 5
1615
matrix:
17-
os: [macos-15-intel, macos-latest, ubuntu-latest] # , windows-latest]
16+
os: [macos-15-intel, macos-latest, ubuntu-latest, windows-latest]
1817
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1918
include:
2019
- os: macos-26
2120
python-version: 3.x
21+
- os: ubuntu-24.04-arm # Ubuntu on ARM
22+
python-version: "3.14"
23+
- os: windows-11-arm # Windows on ARM
24+
python-version: "3.14"
2225
steps:
2326
- uses: actions/checkout@v6
2427
- name: Set up Python ${{ matrix.python-version }}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Build a binary wheel and a source tarball
2929
run: pipx run build
3030
- name: Store the distribution packages
31-
uses: actions/upload-artifact@v6
31+
uses: actions/upload-artifact@v7
3232
with:
3333
name: python-package-distributions
3434
path: dist/
@@ -48,7 +48,7 @@ jobs:
4848
id-token: write # IMPORTANT: mandatory for trusted publishing
4949
steps:
5050
- name: Download all the dists
51-
uses: actions/download-artifact@v7
51+
uses: actions/download-artifact@v8
5252
with:
5353
name: python-package-distributions
5454
path: dist/
@@ -68,12 +68,12 @@ jobs:
6868
id-token: write # IMPORTANT: mandatory for sigstore
6969
steps:
7070
- name: Download all the dists
71-
uses: actions/download-artifact@v7
71+
uses: actions/download-artifact@v8
7272
with:
7373
name: python-package-distributions
7474
path: dist/
7575
- name: Sign the dists with Sigstore
76-
uses: sigstore/gh-action-sigstore-python@v3.2.0
76+
uses: sigstore/gh-action-sigstore-python@v3.3.0
7777
with:
7878
inputs: >-
7979
./dist/*.tar.gz

gyp/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@ static
144144

145145
test/fixtures/out
146146
*.actual
147+
*.sln
148+
*.vcproj
149+
!test/fixtures/expected-win32/**/*.sln
150+
!test/fixtures/expected-win32/**/*.vcproj

gyp/.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.21.1"
2+
".": "0.22.0"
33
}

gyp/CHANGELOG.md

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

3+
## [0.22.0](https://github.com/nodejs/gyp-next/compare/v0.21.1...v0.22.0) (2026-04-02)
4+
5+
6+
### Features
7+
8+
* Windows ARM64 target architecture support ([#331](https://github.com/nodejs/gyp-next/issues/331)) ([652a346](https://github.com/nodejs/gyp-next/commit/652a346bbd3b077a4b08a3c37d48100ce200758a))
9+
10+
11+
### Bug Fixes
12+
13+
* drop deprecated Python module pkg_resources ([#333](https://github.com/nodejs/gyp-next/issues/333)) ([5b180d5](https://github.com/nodejs/gyp-next/commit/5b180d52d03aff062bdea1ad0209b82271c7eb4a))
14+
315
## [0.21.1](https://github.com/nodejs/gyp-next/compare/v0.21.0...v0.21.1) (2026-01-24)
416

517

gyp/pylib/gyp/MSVSVersion.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def DefaultToolset(self):
8787
def _SetupScriptInternal(self, target_arch):
8888
"""Returns a command (with arguments) to be used to set up the
8989
environment."""
90-
assert target_arch in ("x86", "x64"), "target_arch not supported"
90+
assert target_arch in ("x86", "x64", "arm64"), "target_arch not supported"
9191
# If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the
9292
# depot_tools build tools and should run SetEnv.Cmd to set up the
9393
# environment. The check for WindowsSDKDir alone is not sufficient because
@@ -109,8 +109,16 @@ def _SetupScriptInternal(self, target_arch):
109109
)
110110

111111
# Always use a native executable, cross-compiling if necessary.
112-
host_arch = "amd64" if is_host_arch_x64 else "x86"
113-
msvc_target_arch = "amd64" if target_arch == "x64" else "x86"
112+
host_arch = (
113+
"amd64"
114+
if is_host_arch_x64
115+
else (
116+
"arm64"
117+
if os.environ.get("PROCESSOR_ARCHITECTURE") == "ARM64"
118+
else "x86"
119+
)
120+
)
121+
msvc_target_arch = {"x64": "amd64"}.get(target_arch, target_arch)
114122
arg = host_arch
115123
if host_arch != msvc_target_arch:
116124
arg += "_" + msvc_target_arch

gyp/pylib/gyp/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import shlex
1414
import sys
1515
import traceback
16+
from importlib.metadata import version
1617

1718
import gyp.input
1819
from gyp.common import GypError
@@ -491,9 +492,7 @@ def gyp_main(args):
491492

492493
options, build_files_arg = parser.parse_args(args)
493494
if options.version:
494-
import pkg_resources # noqa: PLC0415
495-
496-
print(f"v{pkg_resources.get_distribution('gyp-next').version}")
495+
print(f"v{version('gyp-next')}")
497496
return 0
498497
build_files = build_files_arg
499498

gyp/pylib/gyp/generator/ninja.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def __init__(
246246
if flavor == "win":
247247
# See docstring of msvs_emulation.GenerateEnvironmentFiles().
248248
self.win_env = {}
249-
for arch in ("x86", "x64"):
249+
for arch in ("x86", "x64", "arm64"):
250250
self.win_env[arch] = "environment." + arch
251251

252252
# Relative path from build output dir to base dir.
@@ -2339,6 +2339,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
23392339
master_ninja.variable("rc", "rc.exe")
23402340
master_ninja.variable("ml_x86", "ml.exe")
23412341
master_ninja.variable("ml_x64", "ml64.exe")
2342+
master_ninja.variable("ml_arm64", "armasm64.exe")
23422343
master_ninja.variable("mt", "mt.exe")
23432344
else:
23442345
master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld))

gyp/pylib/gyp/generator/ninja_test.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,36 @@
1111
from pathlib import Path
1212

1313
from gyp.generator import ninja
14+
from gyp.MSVSVersion import SelectVisualStudioVersion
15+
16+
17+
def _has_visual_studio():
18+
"""Check if Visual Studio can be detected by gyp's registry-based detection."""
19+
if not sys.platform.startswith("win"):
20+
return False
21+
try:
22+
SelectVisualStudioVersion("auto", allow_fallback=False)
23+
return True
24+
except ValueError:
25+
return False
1426

1527

1628
class TestPrefixesAndSuffixes(unittest.TestCase):
29+
@unittest.skipUnless(
30+
_has_visual_studio(),
31+
"requires Windows with a Visual Studio installation detected via the registry",
32+
)
1733
def test_BinaryNamesWindows(self):
18-
# These cannot run on non-Windows as they require a VS installation to
19-
# correctly handle variable expansion.
20-
if sys.platform.startswith("win"):
21-
writer = ninja.NinjaWriter(
22-
"foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "win"
23-
)
24-
spec = {"target_name": "wee"}
25-
self.assertTrue(
26-
writer.ComputeOutputFileName(spec, "executable").endswith(".exe")
27-
)
28-
self.assertTrue(
29-
writer.ComputeOutputFileName(spec, "shared_library").endswith(".dll")
30-
)
31-
self.assertTrue(
32-
writer.ComputeOutputFileName(spec, "static_library").endswith(".lib")
33-
)
34+
writer = ninja.NinjaWriter(
35+
"foo", "wee", ".", ".", "build.ninja", ".", "build.ninja", "win"
36+
)
37+
spec = {"target_name": "wee"}
38+
for key, ext in {
39+
"executable": ".exe",
40+
"shared_library": ".dll",
41+
"static_library": ".lib",
42+
}:
43+
self.assertTrue(writer.ComputeOutputFileName(spec, key).endswith(ext))
3444

3545
def test_BinaryNamesLinux(self):
3646
writer = ninja.NinjaWriter(

gyp/pylib/gyp/mac_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier):
545545
# If the user has multiple provisioning profiles installed that can be
546546
# used for ${bundle_identifier}, pick the most specific one (ie. the
547547
# provisioning profile whose pattern is the longest).
548-
selected_key = max(valid_provisioning_profiles, key=lambda v: len(v))
548+
selected_key = max(valid_provisioning_profiles, key=len)
549549
return valid_provisioning_profiles[selected_key]
550550

551551
def _LoadProvisioningProfile(self, profile_path):

0 commit comments

Comments
 (0)