Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: update gyp-next to 0.16.2 #52062

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions tools/gyp/.github/workflows/Python_tests.yml

This file was deleted.

60 changes: 0 additions & 60 deletions tools/gyp/.github/workflows/node-gyp.yml

This file was deleted.

32 changes: 0 additions & 32 deletions tools/gyp/.github/workflows/nodejs-windows.yml

This file was deleted.

16 changes: 0 additions & 16 deletions tools/gyp/.github/workflows/release-please.yml

This file was deleted.

7 changes: 7 additions & 0 deletions tools/gyp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.16.2](https://github.com/nodejs/gyp-next/compare/v0.16.1...v0.16.2) (2024-03-07)


### Bug Fixes

* 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))

## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25)


Expand Down
29 changes: 17 additions & 12 deletions tools/gyp/pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ def GetCflags(self, configname, arch=None):

sdk_root = self._SdkPath()
if "SDKROOT" in self._Settings() and sdk_root:
cflags.append("-isysroot %s" % sdk_root)
cflags.append("-isysroot")
cflags.append(sdk_root)

if self.header_map_path:
cflags.append("-I%s" % self.header_map_path)
Expand Down Expand Up @@ -664,7 +665,8 @@ def GetCflags(self, configname, arch=None):
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
cflags.append("-arch " + archs[0])
cflags.append("-arch")
cflags.append(archs[0])

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

if "SDKROOT" in self._Settings() and self._SdkPath():
ldflags.append("-isysroot " + self._SdkPath())
ldflags.append("-isysroot")
ldflags.append(self._SdkPath())

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

if "ORDER_FILE" in self._Settings():
ldflags.append(
"-Wl,-order_file "
+ "-Wl,"
+ gyp_to_build_path(self._Settings()["ORDER_FILE"])
)
ldflags.append("-Wl,-order_file")
ldflags.append("-Wl," + gyp_to_build_path(self._Settings()["ORDER_FILE"]))

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

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

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

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

is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension()
if sdk_root and is_extension:
Expand All @@ -987,7 +991,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
+ "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit"
)
else:
ldflags.append("-e _NSExtensionMain")
ldflags.append("-e")
ldflags.append("_NSExtensionMain")
ldflags.append("-fapplication-extension")

self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s")
Expand Down
53 changes: 53 additions & 0 deletions tools/gyp/pylib/gyp/xcode_emulation_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3

"""Unit tests for the xcode_emulation.py file."""

from gyp.xcode_emulation import XcodeSettings
import sys
import unittest


class TestXcodeSettings(unittest.TestCase):
def setUp(self):
if sys.platform != "darwin":
self.skipTest("This test only runs on macOS")

def test_GetCflags(self):
target = {
"type": "static_library",
"configurations": {
"Release": {},
},
}
configuration_name = "Release"
xcode_settings = XcodeSettings(target)
cflags = xcode_settings.GetCflags(configuration_name, "arm64")

# Do not quote `-arch arm64` with spaces in one string.
self.assertEqual(
cflags,
["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"],
)

def GypToBuildPath(self, path):
return path

def test_GetLdflags(self):
target = {
"type": "static_library",
"configurations": {
"Release": {},
},
}
configuration_name = "Release"
xcode_settings = XcodeSettings(target)
ldflags = xcode_settings.GetLdflags(
configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64"
)

# Do not quote `-arch arm64` with spaces in one string.
self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"])


if __name__ == "__main__":
unittest.main()
4 changes: 2 additions & 2 deletions tools/gyp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "gyp-next"
version = "0.16.1"
version = "0.16.2"
authors = [
{ name="Node.js contributors", email="ryzokuken@disroot.org" },
]
Expand All @@ -29,7 +29,7 @@ classifiers = [
]

[project.optional-dependencies]
dev = ["flake8", "ruff", "pytest"]
dev = ["flake8", "ruff == 0.3.0", "pytest"]

[project.scripts]
gyp = "gyp:script_main"
Expand Down