Skip to content

CI: download the Node.js headers once, with retries, before building - #10

Merged
cinderblock merged 3 commits into
masterfrom
ci-prebuild-retry
Nov 11, 2026
Merged

cinderblock merged 3 commits into
masterfrom
ci-prebuild-retry

Conversation

@cinderblock

Copy link
Copy Markdown
Owner

Why

The 2.0.0 release's first attempt (run 42939713843, attempt 1) failed in Prebuild linux-armv7-glibc: node-gyp's download of the Node.js 22.12.0 headers was cut off under QEMU (gyp ERR! configure error, TypeError: terminated). node-gyp downloads them mid-build, once, with no retry, and release.yml publishes only if every CI job passes.

What

  • scripts/fetch-node-headers.sh downloads the headers for the version build:native targets (read from package.json) on the runner itself, with curl --retry, checks them against SHASUMS256.txt, and sets npm_package_config_node_gyp_tarball. node-gyp then extracts that file into the same cache as before ($TMPDIR/prebuildify/node/<version>), so the build makes no network request, and scripts/clang-tidy.mjs's header search doesn't change.
  • Every job that builds runs it first: checks, test, freebsd, and all the prebuild jobs. Docker containers get the path remapped to /repo/...; the FreeBSD VMs get it through envs:.
  • scripts/ci-install-node.sh (s390x/ppc64le containers) gets apt retries, a retrying download loop and a checksum check of the Node.js tarball.
  • No retry around the build itself: with the network out of it, a failing build is a real failure.

Verified

In WSL with node-gyp's dist_url pointed at a dead port: a build without the tarball fails, and builds with it succeed under both npm run and bun run. Lint and tests unchanged. Details in plans/ci-prebuild-network-resilience.md.

🤖 Generated with Claude Code

cinderblock and others added 3 commits November 10, 2026 18:20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
node-gyp downloaded the headers mid-build, once, with no retry. Under
QEMU that download was cut off and failed the 2.0.0 release's armv7
prebuild (run 42939713843, attempt 1).

scripts/fetch-node-headers.sh now downloads the headers for the version
build:native targets on the runner itself (curl with retries), checks
them against SHASUMS256.txt, and hands the file to node-gyp through
npm_package_config_node_gyp_tarball. node-gyp extracts it into the same
cache as before, so the build makes no network request and clang-tidy's
header search is unchanged. Every job that builds uses it, including the
Docker containers and the FreeBSD VMs.

scripts/ci-install-node.sh (s390x, ppc64le) gets apt and curl retries
and checks the Node.js tarball's checksum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cinderblock
cinderblock merged commit fa39c0f into master Nov 11, 2026
84 checks passed
cinderblock added a commit that referenced this pull request Nov 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cinderblock cinderblock mentioned this pull request Nov 12, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant