From fbf0ad98afe4e5e51f968a7442a2c8258cb25d05 Mon Sep 17 00:00:00 2001 From: Peter Ammon Date: Sun, 13 Oct 2024 12:30:00 -0700 Subject: [PATCH] Build macOS x86-64 with Rust 1.73.0 in make_pkg.sh This retains compatibility with macOS 10.9. Note that Apple Silicon Macs shipped with 10.15, so compatibility for Apple Silicon is not a concern. --- .github/workflows/mac_codesign.yml | 9 +++++++-- build_tools/make_pkg.sh | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mac_codesign.yml b/.github/workflows/mac_codesign.yml index 728c92bc2..e1b5c7c03 100644 --- a/.github/workflows/mac_codesign.yml +++ b/.github/workflows/mac_codesign.yml @@ -9,9 +9,14 @@ jobs: environment: macos-codesign steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.79 + - name: Install Rust 1.73.0 + uses: dtolnay/rust-toolchain@1.73.0 with: - targets: aarch64-apple-darwin,x86_64-apple-darwin + targets: x86_64-apple-darwin + - name: Install Rust 1.79 + uses: dtolnay/rust-toolchain@1.79 + with: + targets: aarch64-apple-darwin - name: build-and-codesign run: | cargo install apple-codesign diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 8f06e2dbc..a6ee416f0 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -26,6 +26,12 @@ NOTARIZE= ARM64_DEPLOY_TARGET='MACOSX_DEPLOYMENT_TARGET=11.0' X86_64_DEPLOY_TARGET='MACOSX_DEPLOYMENT_TARGET=10.9' +# As of this writing, the most recent Rust release supports macOS back to 10.12. +# The first supported version of macOS on arm64 is 10.15, so any Rust is fine for arm64. +# We wish to support back to 10.9 on x86-64; the last version of Rust to support that is +# version 1.73.0. +RUST_VERSION_X86_64=1.73.0 + while getopts "sf:i:p:e:nj:" opt; do case $opt in s) SIGN=1;; @@ -83,11 +89,13 @@ mkdir -p "$PKGDIR/build_x86_64" "$PKGDIR/build_arm64" "$PKGDIR/root" "$PKGDIR/in } # Build for x86-64 but do not install; instead we will make some fat binaries inside the root. +# Set RUST_VERSION_X86_64 to the last version of Rust that supports macOS 10.9. { cd "$PKGDIR/build_x86_64" \ && cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,-ld_classic" \ -DWITH_GETTEXT=OFF \ + -DRust_TOOLCHAIN="$RUST_VERSION_X86_64" \ -DRust_CARGO_TARGET=x86_64-apple-darwin \ -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' \ -DFISH_USE_SYSTEM_PCRE2=OFF "$SRC_DIR" \