deps: node-gyp@12.3.0 · npm/cli@799866f · GitHub
Skip to content

Commit 799866f

Browse files
committed
deps: node-gyp@12.3.0
1 parent 79d394e commit 799866f

155 files changed

Lines changed: 32202 additions & 109 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

DEPENDENCIES.md

Lines changed: 1 addition & 1 deletion

node_modules/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
!/tinyglobby/node_modules/picomatch
142142
!/treeverse
143143
!/tuf-js
144+
!/undici
144145
!/util-deprecate
145146
!/validate-npm-package-name
146147
!/walk-up-path
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "12.2.0"
2+
".": "12.3.0"
33
}
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.1"
33
}

node_modules/node-gyp/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

node_modules/node-gyp/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

node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ def _EscapeCommandLineArgumentForMSBuild(s):
857857
"""Escapes a Windows command-line argument for use by MSBuild."""
858858

859859
def _Replace(match):
860-
return (len(match.group(1)) / 2 * 4) * "\\" + '\\"'
860+
return (len(match.group(1)) // 2 * 4) * "\\" + '\\"'
861861

862862
# Escape all quotes so that they are interpreted literally.
863863
s = quote_replacer_regex2.sub(_Replace, s)

node_modules/node-gyp/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))

node_modules/node-gyp/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+
}.items():
43+
self.assertTrue(writer.ComputeOutputFileName(spec, key).endswith(ext))
3444

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

node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)