| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b844c24 commit 757cd21
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -144,3 +144,7 @@ static | |||
| 144 | 144 | ||
| 145 | 145 | test/fixtures/out | |
| 146 | 146 | *.actual | |
| 147 | + *.sln | ||
| 148 | + *.vcproj | ||
| 149 | + !test/fixtures/expected-win32/**/*.sln | ||
| 150 | + !test/fixtures/expected-win32/**/*.vcproj | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,17 @@ | |||
| 1 | 1 | # Changelog | |
| 2 | 2 | ||
| 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 | + | ||
| 3 | 15 | ## [0.21.1](https://github.com/nodejs/gyp-next/compare/v0.21.0...v0.21.1) (2026-01-24) | |
| 4 | 16 | ||
| 5 | 17 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,7 +87,7 @@ def DefaultToolset(self): | |||
| 87 | 87 | def _SetupScriptInternal(self, target_arch): | |
| 88 | 88 | """Returns a command (with arguments) to be used to set up the | |
| 89 | 89 | environment.""" | |
| 90 | - assert target_arch in ("x86", "x64"), "target_arch not supported" | ||
| 90 | + assert target_arch in ("x86", "x64", "arm64"), "target_arch not supported" | ||
| 91 | 91 | # If WindowsSDKDir is set and SetEnv.Cmd exists then we are using the | |
| 92 | 92 | # depot_tools build tools and should run SetEnv.Cmd to set up the | |
| 93 | 93 | # environment. The check for WindowsSDKDir alone is not sufficient because | |
@@ -109,8 +109,16 @@ def _SetupScriptInternal(self, target_arch): | |||
| 109 | 109 | ) | |
| 110 | 110 | ||
| 111 | 111 | # 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) | ||
| 114 | 122 | arg = host_arch | |
| 115 | 123 | if host_arch != msvc_target_arch: | |
| 116 | 124 | arg += "_" + msvc_target_arch | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,6 +13,7 @@ | |||
| 13 | 13 | import shlex | |
| 14 | 14 | import sys | |
| 15 | 15 | import traceback | |
| 16 | + from importlib.metadata import version | ||
| 16 | 17 | ||
| 17 | 18 | import gyp.input | |
| 18 | 19 | from gyp.common import GypError | |
@@ -491,9 +492,7 @@ def gyp_main(args): | |||
| 491 | 492 | ||
| 492 | 493 | options, build_files_arg = parser.parse_args(args) | |
| 493 | 494 | 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')}") | ||
| 497 | 496 | return 0 | |
| 498 | 497 | build_files = build_files_arg | |
| 499 | 498 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -246,7 +246,7 @@ def __init__( | |||
| 246 | 246 | if flavor == "win": | |
| 247 | 247 | # See docstring of msvs_emulation.GenerateEnvironmentFiles(). | |
| 248 | 248 | self.win_env = {} | |
| 249 | - for arch in ("x86", "x64"): | ||
| 249 | + for arch in ("x86", "x64", "arm64"): | ||
| 250 | 250 | self.win_env[arch] = "environment." + arch | |
| 251 | 251 | ||
| 252 | 252 | # Relative path from build output dir to base dir. | |
@@ -2339,6 +2339,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name | |||
| 2339 | 2339 | master_ninja.variable("rc", "rc.exe") | |
| 2340 | 2340 | master_ninja.variable("ml_x86", "ml.exe") | |
| 2341 | 2341 | master_ninja.variable("ml_x64", "ml64.exe") | |
| 2342 | + master_ninja.variable("ml_arm64", "armasm64.exe") | ||
| 2342 | 2343 | master_ninja.variable("mt", "mt.exe") | |
| 2343 | 2344 | else: | |
| 2344 | 2345 | master_ninja.variable("ld", CommandWithWrapper("LINK", wrappers, ld)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,26 +11,36 @@ | |||
| 11 | 11 | from pathlib import Path | |
| 12 | 12 | ||
| 13 | 13 | 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 | ||
| 14 | 26 | ||
| 15 | 27 | ||
| 16 | 28 | class TestPrefixesAndSuffixes(unittest.TestCase): | |
| 29 | + @unittest.skipUnless( | ||
| 30 | + _has_visual_studio(), | ||
| 31 | + "requires Windows with a Visual Studio installation detected via the registry", | ||
| 32 | + ) | ||
| 17 | 33 | 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)) | ||
| 34 | 44 | ||
| 35 | 45 | def test_BinaryNamesLinux(self): | |
| 36 | 46 | writer = ninja.NinjaWriter( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -545,7 +545,7 @@ def _FindProvisioningProfile(self, profile, bundle_identifier): | |||
| 545 | 545 | # If the user has multiple provisioning profiles installed that can be | |
| 546 | 546 | # used for ${bundle_identifier}, pick the most specific one (ie. the | |
| 547 | 547 | # 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) | ||
| 549 | 549 | return valid_provisioning_profiles[selected_key] | |
| 550 | 550 | ||
| 551 | 551 | def _LoadProvisioningProfile(self, profile_path): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1174,7 +1174,7 @@ def GenerateEnvironmentFiles( | |||
| 1174 | 1174 | meet your requirement (e.g. for custom toolchains), you can pass | |
| 1175 | 1175 | "-G ninja_use_custom_environment_files" to the gyp to suppress file | |
| 1176 | 1176 | generation and use custom environment files prepared by yourself.""" | |
| 1177 | - archs = ("x86", "x64") | ||
| 1177 | + archs = ("x86", "x64", "arm64") | ||
| 1178 | 1178 | if generator_flags.get("ninja_use_custom_environment_files", 0): | |
| 1179 | 1179 | cl_paths = {} | |
| 1180 | 1180 | for arch in archs: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |||
| 4 | 4 | ||
| 5 | 5 | [project] | |
| 6 | 6 | name = "gyp-next" | |
| 7 | - version = "0.21.1" | ||
| 7 | + version = "0.22.0" | ||
| 8 | 8 | authors = [ | |
| 9 | 9 | { name="Node.js contributors", email="ryzokuken@disroot.org" }, | |
| 10 | 10 | ] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,16 @@ | |||
| 1 | + Microsoft Visual Studio Solution File, Format Version 9.00 | ||
| 2 | + # Visual Studio 2005 | ||
| 3 | + Project("{*}") = "test", "test.vcproj", "{*}" | ||
| 4 | + EndProject | ||
| 5 | + Global | ||
| 6 | + GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| 7 | + Default|Win32 = Default|Win32 | ||
| 8 | + EndGlobalSection | ||
| 9 | + GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| 10 | + {*}.Default|Win32.ActiveCfg = Default|Win32 | ||
| 11 | + {*}.Default|Win32.Build.0 = Default|Win32 | ||
| 12 | + EndGlobalSection | ||
| 13 | + GlobalSection(SolutionProperties) = preSolution | ||
| 14 | + HideSolutionNode = FALSE | ||
| 15 | + EndGlobalSection | ||
| 16 | + EndGlobal | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments