Skip to content

fix(macos): build Node 26 on macos-15 and disable LTO#176

Merged
robertsLando merged 1 commit into
mainfrom
fix/macos-node26-build
May 22, 2026
Merged

fix(macos): build Node 26 on macos-15 and disable LTO#176
robertsLando merged 1 commit into
mainfrom
fix/macos-node26-build

Conversation

@robertsLando
Copy link
Copy Markdown
Member

Problem

The macOS Node 26 builds fail in build-all.yml:

  • macos-arm64 (26) fails fast in the compile step:

    ../deps/v8/src/base/atomicops.h:90: error: no member named 'atomic_ref' in namespace 'std'
    

    std::atomic_ref is a C++20 library feature that V8 in Node 26 now uses in atomicops.h. The job was pinned to runs-on: macos-14, whose newest available Xcode is 16.2 — its libc++ predates std::atomic_ref. Xcode 16.3+ (requires macOS 15) ships the libc++ that has it. Confirmed empirically: the macos-15-intel x64 job compiles straight past atomicops.h.

  • macos-x64 (24) and (26) hit GitHub Actions' 6h job limit. getConfigureArgs force-enabled --enable-lto for every non-Windows build, and the LTO link phase is enormously slow on the Intel runner.

Both are the macOS issues described in #170.

Changes

  • build-macos.yml — bump the arm64 runner macos-14macos-15 (Xcode 16.4 → libc++ with std::atomic_ref).
  • lib/build.ts — skip --enable-lto for macOS in getConfigureArgs (Windows was already excluded).
  • build-macos.yml — add ccache (actions/cache + PKG_BUILD_PATH under CCACHE_BASEDIR) and GNU make v4 to both macOS jobs, so rebuilds stay fast and make -j works correctly.

Notes

  • PKG_BUILD_PATH is already supported upstream (build.ts:18); pointing it under the workspace keeps ccache paths stable across runs.
  • The first run after this lands has no warm cache, so it relies on the LTO removal alone to fit within 6h; subsequent runs benefit from ccache.
  • Action versions (checkout@v6, setup-node@v6, upload-artifact@v7) and the [22, 24, 26] matrix are unchanged.

Refs #170

🤖 Generated with Claude Code

The macos-arm64 job was pinned to `runs-on: macos-14`, whose newest
Xcode (16.2) ships a libc++ without `std::atomic_ref` — a C++20 feature
V8 in Node 26 now uses in `deps/v8/src/base/atomicops.h`, failing the
compile with "no member named 'atomic_ref' in namespace 'std'". Bump the
arm64 runner to macos-15 (Xcode 16.4), which provides it; the
macos-15-intel x64 runner already has it.

Separately, the macOS x64 build was hitting GitHub Actions' 6h job
limit. `getConfigureArgs` force-enabled `--enable-lto` for every
non-Windows build; LTO makes the link phase enormously slow. Skip it for
macOS, and add ccache + GNU make v4 to the macOS jobs to keep rebuilds
fast and `make -j` effective.

Refs #170
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes macOS build failures/timeouts when building newer Node.js versions (notably Node 26) in CI by updating the macOS runner image/toolchain and reducing macOS build time.

Changes:

  • Disable --enable-lto for macOS builds to avoid excessively long link phases on GitHub Actions runners.
  • Move macOS arm64 CI to macos-15 to pick up a newer Xcode/libc++ that supports std::atomic_ref (needed by V8 in Node 26).
  • Add ccache + GNU Make v4 to macOS CI jobs and cache the compiler cache to speed up rebuilds.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/build.ts Skips enabling LTO when the target platform is macOS to reduce CI build time.
.github/workflows/build-macos.yml Updates macOS runner selection and adds ccache/GNU Make setup + caching for faster, more reliable CI builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robertsLando robertsLando merged commit 9c2687b into main May 22, 2026
4 checks passed
@robertsLando robertsLando deleted the fix/macos-node26-build branch May 22, 2026 07:33
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.

2 participants