Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
macos-x64:
runs-on: macos-15-intel
runs-on: macos-26-intel

strategy:
fail-fast: false
Expand Down Expand Up @@ -41,9 +41,22 @@ jobs:
df -h
echo "::endgroup::"

# install GNU make v4 to fix make -j N option https://github.com/nodejs/node/issues/53176#issuecomment-2134740862
- name: Install build tools
run: brew install ninja make

- name: Put new GNU Make binary first in PATH
run: echo "$(brew --prefix)/opt/make/libexec/gnubin" >> "$GITHUB_PATH"

- name: Check make
run: |
which make
make --version

- run: yarn start --node-range node${{ matrix.target-node }} --arch x64 --output dist
env:
MAKE_JOB_COUNT: 4 # prevent to run out of memory
NODE_CONFIGURE_ARGS: --ninja # speed up compilation

- name: Check if binary is compiled, skip if download only
id: check_file
Expand All @@ -58,7 +71,7 @@ jobs:
path: dist/*

macos-arm64:
runs-on: macos-14 # macos-14 is arm64: https://github.com/actions/runner-images#available-images
runs-on: macos-26 # is arm64: https://github.com/actions/runner-images#available-images

strategy:
fail-fast: false
Expand Down Expand Up @@ -87,8 +100,17 @@ jobs:
- run: yarn install --ignore-engines

# add missing distutils package to python 3.12
# install GNU make v4 to fix make -j N option https://github.com/nodejs/node/issues/53176#issuecomment-2134740862
- name: Install distutils
run: brew install python-setuptools
run: brew install python-setuptools ninja make

- name: Put new GNU Make binary first in PATH
run: echo "$(brew --prefix)/opt/make/libexec/gnubin" >> "$GITHUB_PATH"

- name: Check make
run: |
which make
make --version

# Remove unneeded stuff to free up build space (from Node https://github.com/nodejs/build/issues/3878)
- name: Cleanup before build
Expand All @@ -102,6 +124,7 @@ jobs:
- run: yarn start --node-range node${{ matrix.target-node }} --arch arm64 --output dist
env:
MAKE_JOB_COUNT: 2 # prevent to run out of memory
NODE_CONFIGURE_ARGS: --ninja # speed up compilation

- name: Check if binary is compiled
id: check_file
Expand Down
4 changes: 4 additions & 0 deletions lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ async function compileOnUnix(

args.push(...getConfigureArgs(getMajor(nodeVersion), targetPlatform, targetArch));

// Accept extra configuration coming from github action like "--ninja" to speed up macos build
const extraConfigureArgs = (process.env.NODE_CONFIGURE_ARGS || '').split(/\s+/).filter(Boolean);
args.push(...extraConfigureArgs);

log.info("Running configure with: ", args.join(" "));
// TODO same for windows?
await spawn('/bin/sh', ['./configure', ...args], {
Expand Down