fix(macos): build Node 26 on macos-15 and disable LTO#176
Merged
Conversation
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
There was a problem hiding this comment.
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-ltofor macOS builds to avoid excessively long link phases on GitHub Actions runners. - Move macOS arm64 CI to
macos-15to pick up a newer Xcode/libc++ that supportsstd::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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The macOS Node 26 builds fail in
build-all.yml:macos-arm64 (26)fails fast in the compile step:std::atomic_refis a C++20 library feature that V8 in Node 26 now uses inatomicops.h. The job was pinned toruns-on: macos-14, whose newest available Xcode is 16.2 — its libc++ predatesstd::atomic_ref. Xcode 16.3+ (requires macOS 15) ships the libc++ that has it. Confirmed empirically: themacos-15-intelx64 job compiles straight pastatomicops.h.macos-x64 (24)and(26)hit GitHub Actions' 6h job limit.getConfigureArgsforce-enabled--enable-ltofor 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 runnermacos-14→macos-15(Xcode 16.4 → libc++ withstd::atomic_ref).lib/build.ts— skip--enable-ltofor macOS ingetConfigureArgs(Windows was already excluded).build-macos.yml— add ccache (actions/cache+PKG_BUILD_PATHunderCCACHE_BASEDIR) and GNU make v4 to both macOS jobs, so rebuilds stay fast andmake -jworks correctly.Notes
PKG_BUILD_PATHis already supported upstream (build.ts:18); pointing it under the workspace keeps ccache paths stable across runs.checkout@v6,setup-node@v6,upload-artifact@v7) and the[22, 24, 26]matrix are unchanged.Refs #170
🤖 Generated with Claude Code