tools: update gyp-next to 0.16.2

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Node.js GitHub Bot authored and GitHub committed 2024-03-15 02:27:44 +00:00
1 parent 8824adb031
commit 6ad5353764
8 files changed
+79 -159

No files matched your search

-37
View File
@@ -1,37 +0,0 @@
# TODO: Enable os: windows-latest
# TODO: Enable pytest --doctest-modules
name: Python_tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
Python_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 5
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip install --editable ".[dev]"
- run: ./gyp -V && ./gyp --version && gyp -V && gyp --version
- name: Lint with ruff # See pyproject.toml for settings
run: ruff --output-format=github .
- name: Test with pytest # See pyproject.toml for settings
run: pytest
# - name: Run doctests with pytest
# run: pytest --doctest-modules
-60
View File
@@ -1,60 +0,0 @@
name: node-gyp integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
integration:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python: ["3.8", "3.10", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- name: Clone gyp-next
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node-gyp
uses: actions/checkout@v4
with:
repository: nodejs/node-gyp
path: node-gyp
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install Python dependencies
run: |
cd gyp-next
python -m pip install --upgrade pip setuptools
pip install --editable .
pip uninstall -y gyp-next
- name: Install Node.js dependencies
run: |
cd node-gyp
npm install --no-progress
- name: Replace gyp in node-gyp
shell: bash
run: |
rm -rf node-gyp/gyp
cp -r gyp-next node-gyp/gyp
- name: Run tests (macOS or Linux)
if: runner.os != 'Windows'
shell: bash
run: |
cd node-gyp
npm test --python="${pythonLocation}/python"
- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd node-gyp
npm run test --python="${env:pythonLocation}\\python.exe"
-32
View File
@@ -1,32 +0,0 @@
name: Node.js Windows integration
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Clone gyp-next
uses: actions/checkout@v4
with:
path: gyp-next
- name: Clone nodejs/node
uses: actions/checkout@v4
with:
repository: nodejs/node
path: node
- name: Install deps
run: choco install nasm
- name: Replace gyp in Node.js
run: |
rm -Recurse node/tools/gyp
cp -Recurse gyp-next node/tools/gyp
- name: Build Node.js
run: |
cd node
./vcbuild.bat
-16
View File
@@ -1,16 +0,0 @@
on:
push:
branches:
- main
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
package-name: gyp-next
bump-minor-pre-major: true
+7
View File
@@ -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)
+17 -12
View File
@@ -579,7 +579,8 @@ class XcodeSettings:
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)
@@ -664,7 +665,8 @@ class XcodeSettings:
# 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"):
@@ -924,17 +926,15 @@ class XcodeSettings:
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:
@@ -946,7 +946,9 @@ class XcodeSettings:
# 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
@@ -954,7 +956,8 @@ class XcodeSettings:
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)
@@ -971,7 +974,8 @@ class XcodeSettings:
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:
@@ -987,7 +991,8 @@ class XcodeSettings:
+ "/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")
@@ -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()
+2 -2
View File
@@ -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" },
]
@@ -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"