Skip to content

Commit 6ad5353

Browse files
tools: update gyp-next to 0.16.2
PR-URL: #52062 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 8824adb commit 6ad5353

8 files changed

+79
-159
lines changed

tools/gyp/.github/workflows/Python_tests.yml

-37
This file was deleted.

tools/gyp/.github/workflows/node-gyp.yml

-60
This file was deleted.

tools/gyp/.github/workflows/nodejs-windows.yml

-32
This file was deleted.

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

-16
This file was deleted.

tools/gyp/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.16.2](https://github.com/nodejs/gyp-next/compare/v0.16.1...v0.16.2) (2024-03-07)
4+
5+
6+
### Bug Fixes
7+
8+
* avoid quoting cflag name and parameter with space separator ([#223](https://github.com/nodejs/gyp-next/issues/223)) ([2b9703d](https://github.com/nodejs/gyp-next/commit/2b9703dbd5b3b8a935faf257c6103033b47bf8bf))
9+
310
## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)
411

512

tools/gyp/pylib/gyp/xcode_emulation.py

+17-12
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ def GetCflags(self, configname, arch=None):
579579

580580
sdk_root = self._SdkPath()
581581
if "SDKROOT" in self._Settings() and sdk_root:
582-
cflags.append("-isysroot %s" % sdk_root)
582+
cflags.append("-isysroot")
583+
cflags.append(sdk_root)
583584

584585
if self.header_map_path:
585586
cflags.append("-I%s" % self.header_map_path)
@@ -664,7 +665,8 @@ def GetCflags(self, configname, arch=None):
664665
# TODO: Supporting fat binaries will be annoying.
665666
self._WarnUnimplemented("ARCHS")
666667
archs = ["i386"]
667-
cflags.append("-arch " + archs[0])
668+
cflags.append("-arch")
669+
cflags.append(archs[0])
668670

669671
if archs[0] in ("i386", "x86_64"):
670672
if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"):
@@ -924,17 +926,15 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
924926
self._AppendPlatformVersionMinFlags(ldflags)
925927

926928
if "SDKROOT" in self._Settings() and self._SdkPath():
927-
ldflags.append("-isysroot " + self._SdkPath())
929+
ldflags.append("-isysroot")
930+
ldflags.append(self._SdkPath())
928931

929932
for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []):
930933
ldflags.append("-L" + gyp_to_build_path(library_path))
931934

932935
if "ORDER_FILE" in self._Settings():
933-
ldflags.append(
934-
"-Wl,-order_file "
935-
+ "-Wl,"
936-
+ gyp_to_build_path(self._Settings()["ORDER_FILE"])
937-
)
936+
ldflags.append("-Wl,-order_file")
937+
ldflags.append("-Wl," + gyp_to_build_path(self._Settings()["ORDER_FILE"]))
938938

939939
if not gyp.common.CrossCompileRequested():
940940
if arch is not None:
@@ -946,15 +946,18 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
946946
# TODO: Supporting fat binaries will be annoying.
947947
self._WarnUnimplemented("ARCHS")
948948
archs = ["i386"]
949-
ldflags.append("-arch " + archs[0])
949+
# Avoid quoting the space between -arch and the arch name
950+
ldflags.append("-arch")
951+
ldflags.append(archs[0])
950952

951953
# Xcode adds the product directory by default.
952954
# Rewrite -L. to -L./ to work around http://www.openradar.me/25313838
953955
ldflags.append("-L" + (product_dir if product_dir != "." else "./"))
954956

955957
install_name = self.GetInstallName()
956958
if install_name and self.spec["type"] != "loadable_module":
957-
ldflags.append("-install_name " + install_name.replace(" ", r"\ "))
959+
ldflags.append("-install_name")
960+
ldflags.append(install_name.replace(" ", r"\ "))
958961

959962
for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []):
960963
ldflags.append("-Wl,-rpath," + rpath)
@@ -971,7 +974,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
971974
platform_root = self._XcodePlatformPath(configname)
972975
if sdk_root and platform_root:
973976
ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/")
974-
ldflags.append("-framework XCTest")
977+
ldflags.append("-framework")
978+
ldflags.append("XCTest")
975979

976980
is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension()
977981
if sdk_root and is_extension:
@@ -987,7 +991,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
987991
+ "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit"
988992
)
989993
else:
990-
ldflags.append("-e _NSExtensionMain")
994+
ldflags.append("-e")
995+
ldflags.append("_NSExtensionMain")
991996
ldflags.append("-fapplication-extension")
992997

993998
self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python3
2+
3+
"""Unit tests for the xcode_emulation.py file."""
4+
5+
from gyp.xcode_emulation import XcodeSettings
6+
import sys
7+
import unittest
8+
9+
10+
class TestXcodeSettings(unittest.TestCase):
11+
def setUp(self):
12+
if sys.platform != "darwin":
13+
self.skipTest("This test only runs on macOS")
14+
15+
def test_GetCflags(self):
16+
target = {
17+
"type": "static_library",
18+
"configurations": {
19+
"Release": {},
20+
},
21+
}
22+
configuration_name = "Release"
23+
xcode_settings = XcodeSettings(target)
24+
cflags = xcode_settings.GetCflags(configuration_name, "arm64")
25+
26+
# Do not quote `-arch arm64` with spaces in one string.
27+
self.assertEqual(
28+
cflags,
29+
["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"],
30+
)
31+
32+
def GypToBuildPath(self, path):
33+
return path
34+
35+
def test_GetLdflags(self):
36+
target = {
37+
"type": "static_library",
38+
"configurations": {
39+
"Release": {},
40+
},
41+
}
42+
configuration_name = "Release"
43+
xcode_settings = XcodeSettings(target)
44+
ldflags = xcode_settings.GetLdflags(
45+
configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64"
46+
)
47+
48+
# Do not quote `-arch arm64` with spaces in one string.
49+
self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"])
50+
51+
52+
if __name__ == "__main__":
53+
unittest.main()

tools/gyp/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "gyp-next"
7-
version = "0.16.1"
7+
version = "0.16.2"
88
authors = [
99
{ name="Node.js contributors", email="ryzokuken@disroot.org" },
1010
]
@@ -29,7 +29,7 @@ classifiers = [
2929
]
3030

3131
[project.optional-dependencies]
32-
dev = ["flake8", "ruff", "pytest"]
32+
dev = ["flake8", "ruff == 0.3.0", "pytest"]
3333

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

0 commit comments

Comments
 (0)