Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore mac arm64 build #46

Merged
merged 1 commit into from
Sep 16, 2024
Merged
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: 14 additions & 15 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ jobs:
path: dist/*

macos-arm64:
runs-on: macos-13 # macos-14 is arm64: https://github.com/actions/runner-images#available-images but not working
runs-on: macos-14 # macos-14 is arm64: https://github.com/actions/runner-images#available-images

strategy:
fail-fast: false
matrix:
target-node: [16, 18, 20] # disabled 22 for now because of resource issues with GH actions
target-node: [18, 20, 22]

steps:
- uses: actions/checkout@v4
Expand All @@ -75,10 +75,10 @@ jobs:
with:
node-version: 20

- name: Check arch is x64 # arm64
- name: Check arch is arm64
run: |
if [[ $(uname -m) != "x86_64" ]]; then
echo "This job should run on x64 architecture"
if [[ $(uname -m) != "arm64" ]]; then
echo "This job should run on arm64 architecture"
exit 1
fi

Expand All @@ -87,21 +87,20 @@ jobs:

# add missing distutils package to python 3.12
- name: Install distutils
run: brew install python-setuptools
Copy link
Member

Choose a reason for hiding this comment

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

Is this working both for nodejs 18 and 20 as well? I remember that during build it complains about missing distutils

Copy link
Author

Choose a reason for hiding this comment

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

I removed it because it didn't work on 18 with the old variant - maybe related to the runner change...


# Remove unneeded stuff to free up build space (from Node https://github.com/nodejs/build/issues/3878)
- name: Cleanup before build
run: |
if [[ ${{ matrix.target-node }} == 18 ]]; then
pip install setuptools
else
brew install python-setuptools
fi
sudo rm -rf /Users/runner/Library/Android/sdk
sudo rm -rf /Users/runner/Library/Developer/CoreSimulator/Caches
echo "::group::Free space after cleanup"
df -h
echo "::endgroup::"

- run: yarn start --node-range node${{ matrix.target-node }} --arch arm64 --output dist
env:
MAKE_JOB_COUNT: 2 # prevent to run out of memory
# uncomment the following lines to build x64
CC: clang -arch arm64
CXX: clang++ -arch arm64
CC_host: clang
CXX_host: clang++

- name: Check if binary is compiled
id: check_file
Expand Down