Skip to content

Commit

Permalink
Bump macOS builds to 15.x, default to ARM64.
Browse files Browse the repository at this point in the history
GHA macOS runners are now ARM64-default, and this required a few changes to
make it work.

We're almost at the release of the M4 processor, which means the Mac
platform is now ~4 years into the move to ARM64, which means we need to
start assuming this as the default.
  • Loading branch information
StarWitch committed Oct 14, 2024
1 parent 7c55e9a commit fa97cac
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 29 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
env:
MESON_VERSION: '0.63.3'
EM_VERSION: '3.1.68'
PYTHON_VERSION: '3.11.8'
PYTHON_VERSION: '3.11'
EM_CACHE_FOLDER: 'emsdk'
TAISEI_NOPRELOAD: 0
TAISEI_PRELOAD_REQUIRED: 1
Expand Down Expand Up @@ -102,9 +102,9 @@ jobs:
if-no-files-found: warn

macos-test-build:
name: macOS (x64)
name: macOS (ARM64)
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-12
runs-on: macos-15
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
meson setup build/
--native-file misc/ci/common-options.ini
--native-file misc/ci/nofallback.ini
--native-file misc/ci/macos-x86_64-build-test-ci.ini
--native-file misc/ci/macos-aarch64-build-test-ci.ini
--prefix=$(pwd)/build-test
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ env:
REF: ${{ github.event.inputs.custom-ref || github.ref || 'master' }}
MESON_VERSION: '0.63.3'
EM_VERSION: '3.1.68'
PYTHON_VERSION: '3.11.8'
PYTHON_VERSION: '3.11'
EM_CACHE_FOLDER: 'emsdk'
TAISEI_NOPRELOAD: 0
TAISEI_PRELOAD_REQUIRED: 1
Expand Down Expand Up @@ -199,7 +199,7 @@ jobs:
macos-release-build-universal:
name: macOS (Universal)
if: ${{ (github.event.inputs.macos-x64-arm64 || 'true') == 'true' }}
runs-on: macos-12
runs-on: macos-15
steps:
- name: Install Tools
run: >
Expand Down
11 changes: 1 addition & 10 deletions misc/ci/macos-aarch64-build-release.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
[constants]
# apple silicon only supports macOS >=11.x, so just use that
macos_min = '11.1'
cflags = ['-mmacosx-version-min='+macos_min, '-arch', 'arm64', '-mcpu=apple-m1']
cflags = ['-mmacosx-version-min='+macos_min, '-mcpu=apple-m1']
ldflags = cflags

[host_machine]
cpu_family = 'aarch64'
cpu = 'apple-m1'
system = 'darwin'
endian = 'little'

[binaries]
c = 'clang'
cpp = 'clang++'
objc = 'clang'
strip = 'strip'
pkgconfig = 'pkg-config'

[properties]
needs_exe_wrapper = true

[project options]
install_angle = true
r_gles30 = 'enabled'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
[constants]
macos_min = '10.15'
cflags = ['-mmacosx-version-min='+macos_min, '-arch', 'x86_64']
macos_min = '11.1'
cflags = ['-mmacosx-version-min='+macos_min, '-mcpu=apple-m1']
# NOTE: might need to pass -sdk_version to the linker as well, not sure how that works...
ldflags = cflags

[host_machine]
cpu_family = 'x86_64'
system = 'darwin'

[binaries]
c = 'clang'
cpp = 'clang++'
Expand Down
7 changes: 6 additions & 1 deletion misc/ci/macos-x86_64-build-release.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ cflags = ['-mmacosx-version-min='+macos_min, '-arch', 'x86_64']
ldflags = cflags

[host_machine]
cpu_family = 'x86_64'
system = 'darwin'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

[properties]
needs_exe_wrapper = true

[binaries]
c = 'clang'
Expand Down
1 change: 1 addition & 0 deletions scripts/macos_build_universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ cp -a "$MESON_BUILD_ROOT_MACOS_X64_COMPILED/" "$MESON_BUILD_ROOT_MACOS_COMBINED"
printf -- "Combining x64 and AArch64 binaries...\n\n"
lipo -create -output "$MESON_BUILD_ROOT_MACOS_COMBINED/$TAISEI_BIN_PATH" "$MESON_BUILD_ROOT_MACOS_X64_COMPILED/$TAISEI_BIN_PATH" "$MESON_BUILD_ROOT_MACOS_AARCH64_COMPILED/$TAISEI_BIN_PATH"

printf -- "Generating macOS .dmg...\n\n"
"$TAISEI_ROOT/scripts/macos-gen-dmg.py" "$MAC_BUILD_DIR/compiled/Taisei-$VERSION-universal.dmg" "$MESON_BUILD_ROOT_MACOS_X64" "$MESON_BUILD_ROOT_MACOS_COMBINED" "$@"
12 changes: 6 additions & 6 deletions scripts/macos_setup_universal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ lipo "$TAISEI_ROOT/angle-compiled/lib/macOS-arm64-dylib/libGLESv2.dylib" "$TAISE
meson setup \
-Dangle_libegl=$TAISEI_ROOT/angle-compiled/lib/macOS-universal-dylib/libEGL.dylib \
-Dangle_libgles=$TAISEI_ROOT/angle-compiled/lib/macOS-universal-dylib/libGLESv2.dylib \
--native-file "$TAISEI_ROOT/misc/ci/common-options.ini" \
--native-file "$TAISEI_ROOT/misc/ci/forcefallback.ini" \
--native-file "$TAISEI_ROOT/misc/ci/macos-x86_64-build-release.ini" \
--cross-file "$TAISEI_ROOT/misc/ci/common-options.ini" \
--cross-file "$TAISEI_ROOT/misc/ci/forcefallback.ini" \
--cross-file "$TAISEI_ROOT/misc/ci/macos-x86_64-build-release.ini" \
--prefix "$MESON_BUILD_ROOT_MACOS_X64_COMPILED" \
"$MESON_BUILD_ROOT_MACOS_X64" \
"$TAISEI_ROOT" "$@"

meson setup \
-Dangle_libegl=$TAISEI_ROOT/angle-compiled/lib/macOS-universal-dylib/libEGL.dylib \
-Dangle_libgles=$TAISEI_ROOT/angle-compiled/lib/macOS-universal-dylib/libGLESv2.dylib \
--cross-file "$TAISEI_ROOT/misc/ci/common-options.ini" \
--cross-file "$TAISEI_ROOT/misc/ci/forcefallback.ini" \
--cross-file "$TAISEI_ROOT/misc/ci/macos-aarch64-build-release.ini" \
--native-file "$TAISEI_ROOT/misc/ci/common-options.ini" \
--native-file "$TAISEI_ROOT/misc/ci/forcefallback.ini" \
--native-file "$TAISEI_ROOT/misc/ci/macos-aarch64-build-release.ini" \
--prefix "$MESON_BUILD_ROOT_MACOS_AARCH64_COMPILED" \
"$MESON_BUILD_ROOT_MACOS_AARCH64" \
"$TAISEI_ROOT" "$@"

0 comments on commit fa97cac

Please sign in to comment.