diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d679a3157..7bbf6ea711 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,7 @@ on: pull_request: branches: [ main ] workflow_call: + workflow_dispatch: permissions: contents: read # to fetch code (actions/checkout) @@ -97,17 +98,17 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] python: ["3.10", "3.12", "3.14"] - node: [20.x, 22.x, 24.x] + node: [22.x, 24.x, 26.x] include: - os: macos-15-intel # macOS on Intel python: "3.14" - node: 24.x + node: 26.x - os: ubuntu-24.04-arm # Ubuntu on ARM python: "3.14" - node: 24.x + node: 26.x - os: windows-11-arm # Windows on ARM python: "3.14" - node: 24.x + node: 26.x name: ${{ matrix.os }} - ${{ matrix.python }} - ${{ matrix.node }} runs-on: ${{ matrix.os }} env: @@ -170,10 +171,10 @@ jobs: shell: bash run: npm test --python="${pythonLocation}/python" env: - FULL_TEST: ${{ (matrix.node == '24.x' && matrix.python == '3.14') && '1' || '0' }} + FULL_TEST: ${{ (matrix.node == '26.x' && matrix.python == '3.14') && '1' || '0' }} - name: Run Tests (Windows) if: runner.os == 'Windows' shell: bash # Building wasm on Windows requires using make generator, it only works in bash run: npm run test --python="${pythonLocation}\\python.exe" env: - FULL_TEST: ${{ (matrix.node == '24.x' && matrix.python == '3.14') && '1' || '0' }} + FULL_TEST: ${{ (matrix.node == '26.x' && matrix.python == '3.14') && '1' || '0' }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index af7e1d8db1..7cf5faf711 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.3.0" + ".": "12.4.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b02c2184a..83881ed2a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [12.4.0](https://github.com/nodejs/node-gyp/compare/v12.3.0...v12.4.0) (2026-05-15) + + +### Features + +* update gyp-next to v0.22.2 ([#3316](https://github.com/nodejs/node-gyp/issues/3316)) ([8ea71e5](https://github.com/nodejs/node-gyp/commit/8ea71e5a0d5577f8f780df7597fa1f94089e1be4)) + + +### Bug Fixes + +* retry downloads on retryable errors ([#3308](https://github.com/nodejs/node-gyp/issues/3308)) ([0793489](https://github.com/nodejs/node-gyp/commit/0793489b961c2cbf6c6b2182d968d0c262c3b573)) +* stop testing end-of-life Node.js v20 ([#3315](https://github.com/nodejs/node-gyp/issues/3315)) ([5c0ec47](https://github.com/nodejs/node-gyp/commit/5c0ec47797a18d3e65f0c4c83e5812289191cfe1)) +* test on Node.js v26 ([#3314](https://github.com/nodejs/node-gyp/issues/3314)) ([0e65639](https://github.com/nodejs/node-gyp/commit/0e65639baa8b64b5fecec3820a4f07dc7c4a42ad)) + + +### Miscellaneous + +* add workflow_dispatch trigger to tests workflow ([#3299](https://github.com/nodejs/node-gyp/issues/3299)) ([b2fcdcd](https://github.com/nodejs/node-gyp/commit/b2fcdcdd6aebdf0ab6d7d296fcabccf188883e01)) + ## [12.3.0](https://github.com/nodejs/node-gyp/compare/v12.2.0...v12.3.0) (2026-04-21) diff --git a/gyp/.github/workflows/python_tests.yml b/gyp/.github/workflows/python_tests.yml index 0d13e16387..47f6e5e77c 100644 --- a/gyp/.github/workflows/python_tests.yml +++ b/gyp/.github/workflows/python_tests.yml @@ -8,12 +8,13 @@ on: jobs: Python_lint: - runs-on: ubuntu-slim + runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Lint with ruff # See pyproject.toml for settings uses: astral-sh/ruff-action@v3 - run: ruff format --check --diff + - uses: wagoid/commitlint-github-action@v6 Python_tests: runs-on: ${{ matrix.os }} diff --git a/gyp/.release-please-manifest.json b/gyp/.release-please-manifest.json index 9242a4094d..762fc35f4c 100644 --- a/gyp/.release-please-manifest.json +++ b/gyp/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.22.1" + ".": "0.22.2" } diff --git a/gyp/CHANGELOG.md b/gyp/CHANGELOG.md index c7ddd862d1..c6686c4784 100644 --- a/gyp/CHANGELOG.md +++ b/gyp/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.22.2](https://github.com/nodejs/gyp-next/compare/v0.22.1...v0.22.2) (2026-04-22) + + +### Bug Fixes + +* **build:** Use SPDX license expression ([#310](https://github.com/nodejs/gyp-next/issues/310)) ([ce0da4a](https://github.com/nodejs/gyp-next/commit/ce0da4a6dc1068b73e55e6a58a236bf69f2fed4d)) + ## [0.22.1](https://github.com/nodejs/gyp-next/compare/v0.22.0...v0.22.1) (2026-04-21) diff --git a/gyp/pyproject.toml b/gyp/pyproject.toml index 239bef7844..487cb75002 100644 --- a/gyp/pyproject.toml +++ b/gyp/pyproject.toml @@ -4,20 +4,20 @@ build-backend = "setuptools.build_meta" [project] name = "gyp-next" -version = "0.22.1" +version = "0.22.2" authors = [ { name="Node.js contributors", email="ryzokuken@disroot.org" }, ] description = "A fork of the GYP build system for use in the Node.js projects" readme = "README.md" -license = { file="LICENSE" } +license = "BSD-3-Clause" +license-files = ["LICENSE"] requires-python = ">=3.9" -dependencies = ["packaging>=24.0", "setuptools>=69.5.1"] +dependencies = ["packaging>=24.0", "setuptools>=77.0.3"] classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", diff --git a/lib/download.js b/lib/download.js index a9866d8a63..dfaca798cf 100644 --- a/lib/download.js +++ b/lib/download.js @@ -1,5 +1,5 @@ const { Readable } = require('stream') -const { EnvHttpProxyAgent } = require('undici') +const { Agent, EnvHttpProxyAgent, RetryAgent, fetch } = require('undici') const { promises: fs } = require('graceful-fs') const log = require('./log') @@ -48,7 +48,7 @@ async function createDispatcher (gyp) { const env = process.env const hasProxyEnv = env.http_proxy || env.HTTP_PROXY || env.https_proxy || env.HTTPS_PROXY if (!gyp.opts.proxy && !gyp.opts.cafile && !hasProxyEnv) { - return undefined + return new RetryAgent(new Agent(), { maxRetries: 3 }) } const opts = {} @@ -69,7 +69,7 @@ async function createDispatcher (gyp) { if (gyp.opts.noproxy) { opts.noProxy = gyp.opts.noproxy } - return new EnvHttpProxyAgent(opts) + return new RetryAgent(new EnvHttpProxyAgent(opts), { maxRetries: 3 }) } async function readCAFile (filename) { diff --git a/package.json b/package.json index 29d95ad41b..7f579406da 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "bindings", "gyp" ], - "version": "12.3.0", + "version": "12.4.0", "installVersion": 11, "author": "Nathan Rajlich (http://tootallnate.net)", "repository": { diff --git a/test/test-download.js b/test/test-download.js index 4078efe5cd..756142f623 100644 --- a/test/test-download.js +++ b/test/test-download.js @@ -218,6 +218,32 @@ describe('download', function () { assert.notStrictEqual(cas[0], cas[1]) }) + it('download will retry on ECONNRESET', async function () { + let requestCount = 0 + const server = http.createServer((req, res) => { + requestCount++ + if (requestCount < 3) { + req.socket.destroy() + return + } + res.end('ok') + }) + + after(() => new Promise((resolve) => server.close(resolve))) + + const host = 'localhost' + await new Promise((resolve) => server.listen(0, host, resolve)) + const { port } = server.address() + const gyp = { + opts: {}, + version: '42' + } + const url = `http://${host}:${port}` + const res = await download(gyp, url) + assert.strictEqual(await res.text(), 'ok') + assert.ok(requestCount >= 2, `expected at least 2 requests but got ${requestCount}`) + }) + // only run this test if we are running a version of Node with predictable version path behavior it('download headers (actual)', async function () {