From 0e2a1b6fe0639518ba483c2ce12849039cbbc761 Mon Sep 17 00:00:00 2001 From: Ruben Nogueira <40404708+rubnogueira@users.noreply.github.com> Date: Tue, 19 May 2026 18:42:52 +0100 Subject: [PATCH] ci: fix darwin-x64 + win32-x64 build, drop Node 20 action runtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - darwin-x64: cross-compile from a macos-14 (arm64) runner with --arch x64 instead of waiting on the capacity-starved macos-13 runner pool. Verified locally that the produced binary is "Mach-O 64-bit bundle x86_64". - win32-x64: drop the --strip flag on Windows. prebuild --strip spawns binutils' `strip` which is not on the Windows runner PATH; the spawn failure was what made every Windows build exit 2. Symbols stay in the .node binary (a few KB larger, functionally identical). - Bump actions/upload-artifact@v4 → v7 and actions/download-artifact@v4 → v8 so we stop pulling in the Node 20 action runtime. Both new majors share the same artifact storage backend and interoperate. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/prebuild.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 4cbf438..e3ea197 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -26,8 +26,12 @@ jobs: fail-fast: false matrix: include: + # darwin-x64 is cross-compiled from a macos-14 (arm64) runner because + # macos-13 runners have very limited capacity. Apple Silicon clang + # produces x86_64 binaries natively when asked with --arch x64. - id: darwin-x64 - runner: macos-13 + runner: macos-14 + arch: x64 - id: darwin-arm64 runner: macos-14 - id: linux-x64-glibc @@ -59,16 +63,30 @@ jobs: - name: Build prebuilds for all target ABIs (non-musl) if: ${{ !matrix.musl }} shell: bash + env: + MATRIX_ARCH: ${{ matrix.arch }} run: | set -euo pipefail args="" for v in $NODE_TARGETS; do args="$args -t $v" done - # --strip removes debug symbols. --tag-libc tags linux assets with - # glibc/musl so prebuild-install can request the right one on the - # consumer side. - npx prebuild $args --strip --tag-libc + # --tag-libc adds glibc/musl suffix on linux assets so prebuild-install + # can pick the right one on the consumer side. On other platforms it + # is a no-op. + args="$args --tag-libc" + # --strip relies on the binutils `strip` tool which isn't shipped on + # Windows runners. Skip it there; debug symbols stay in the .node + # binary, which is fine functionally (just larger). + if [ "${RUNNER_OS:-}" != "Windows" ]; then + args="$args --strip" + fi + # When MATRIX_ARCH is set (e.g. cross-compiling darwin-x64 from an + # arm64 runner), forward it to node-gyp via prebuild's --arch. + if [ -n "${MATRIX_ARCH:-}" ]; then + args="$args --arch $MATRIX_ARCH" + fi + npx prebuild $args # Musl path runs inside docker rather than using `container:`, because # GitHub Actions JavaScript actions can't run in Alpine containers on @@ -110,7 +128,7 @@ jobs: tar -tzf "$f" | grep -q '\.node$' || { echo "ERROR: no .node file in $f" >&2; exit 1; } done - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: prebuilds-${{ matrix.id }} path: prebuilds/*.tar.gz @@ -155,7 +173,7 @@ jobs: - uses: actions/checkout@v5 - name: Download all prebuild artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: pattern: prebuilds-* path: artifacts