From 2060568320f0ce7fbc99dbdbc13be5719ffe05a5 Mon Sep 17 00:00:00 2001 From: Daiki AMINAKA <1991.daiki@gmail.com> Date: Tue, 5 Nov 2024 00:29:36 -0800 Subject: [PATCH] Update MacOS version as macos-12 was deprecated. (#4645) --- .../build-reuse-darwin-framework.yml | 24 +++++++++---------- .github/workflows/build-reuse-unix.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/cargo.yml | 2 +- .github/workflows/dotnet-test.yml | 2 +- .github/workflows/stress.yml | 8 +++---- scripts/build.ps1 | 4 ++-- scripts/build.rs | 8 +++++-- 8 files changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-reuse-darwin-framework.yml b/.github/workflows/build-reuse-darwin-framework.yml index 86891dab94..10816ee3f8 100644 --- a/.github/workflows/build-reuse-darwin-framework.yml +++ b/.github/workflows/build-reuse-darwin-framework.yml @@ -42,7 +42,7 @@ jobs: ref: ${{ inputs.ref }} config: ${{ inputs.config }} plat: ${{ matrix.plat }} - os: macos-12 + os: macos-13 arch: ${{ matrix.arch }} tls: ${{ inputs.tls }} static: ${{ inputs.static }} @@ -50,7 +50,7 @@ jobs: build-darwin-universal: name: Build Universal Binaries needs: [build-darwin] - runs-on: macos-12 + runs-on: macos-13 steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -60,12 +60,12 @@ jobs: - name: Download Build Artifacts (x64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: - name: ${{ inputs.config }}-macos-macos-12-x64-${{ inputs.tls }}${{ inputs.static }} + name: ${{ inputs.config }}-macos-macos-13-x64-${{ inputs.tls }}${{ inputs.static }} path: artifacts - name: Download Build Artifacts (arm64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: - name: ${{ inputs.config }}-macos-macos-12-arm64-${{ inputs.tls }}${{ inputs.static }} + name: ${{ inputs.config }}-macos-macos-13-arm64-${{ inputs.tls }}${{ inputs.static }} path: artifacts - name: Build Package shell: pwsh @@ -73,7 +73,7 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b with: - name: ${{ inputs.config }}-macos-macos-12-universal-${{ inputs.tls }}${{ inputs.static }} + name: ${{ inputs.config }}-macos-macos-13-universal-${{ inputs.tls }}${{ inputs.static }} path: artifacts build-darwin-framework: @@ -87,7 +87,7 @@ jobs: { plat: "ios", arch: "arm64" }, { plat: "macos", arch: "universal" }, ] - runs-on: macos-12 + runs-on: macos-13 steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -97,7 +97,7 @@ jobs: - name: Download Build Artifacts (x64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: - name: ${{ inputs.config }}-${{ matrix.vec.plat }}-macos-12-${{ matrix.vec.arch }}-${{ inputs.tls }}${{ inputs.static }} + name: ${{ inputs.config }}-${{ matrix.vec.plat }}-macos-13-${{ matrix.vec.arch }}-${{ inputs.tls }}${{ inputs.static }} path: artifacts - name: Build Framework shell: pwsh @@ -105,13 +105,13 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b with: - name: Framework-${{ inputs.config }}-${{ matrix.vec.plat }}-macos-12-${{ matrix.vec.arch }}-${{ inputs.tls }}${{ inputs.static }} + name: Framework-${{ inputs.config }}-${{ matrix.vec.plat }}-macos-13-${{ matrix.vec.arch }}-${{ inputs.tls }}${{ inputs.static }} path: artifacts build-darwin-xcframework: name: Build Darwin XCFramework needs: [build-darwin-framework] - runs-on: macos-12 + runs-on: macos-13 steps: - name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -121,17 +121,17 @@ jobs: - name: Download Build Artifacts (iOS x64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: - name: Framework-${{ inputs.config }}-ios-macos-12-x64-openssl + name: Framework-${{ inputs.config }}-ios-macos-13-x64-openssl path: artifacts - name: Download Build Artifacts (iOS arm64) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: - name: Framework-${{ inputs.config }}-ios-macos-12-arm64-openssl + name: Framework-${{ inputs.config }}-ios-macos-13-arm64-openssl path: artifacts - name: Download Build Artifacts (MacOS Universal) uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 with: - name: Framework-${{ inputs.config }}-macos-macos-12-universal-openssl + name: Framework-${{ inputs.config }}-macos-macos-13-universal-openssl path: artifacts - name: Build XCFramework shell: pwsh diff --git a/.github/workflows/build-reuse-unix.yml b/.github/workflows/build-reuse-unix.yml index 8aab91ceb8..81b804e8e9 100644 --- a/.github/workflows/build-reuse-unix.yml +++ b/.github/workflows/build-reuse-unix.yml @@ -33,7 +33,7 @@ on: # - ubuntu-20.04 # - ubuntu-22.04 # - ubuntu-24.04 - # - macos-12 + # - macos-13 arch: required: false default: 'x64' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0610d695f3..c173b18eeb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -186,7 +186,7 @@ jobs: matrix: config: ['Debug', 'Release'] plat: [macos, ios] - os: ['macos-12'] + os: ['macos-13'] arch: [x64, arm64] tls: [openssl, openssl3] static: ['', '-Static'] diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index 251c915a4f..b48e3f1942 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -16,7 +16,7 @@ jobs: cargo: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-xlarge] runs-on: ${{ matrix.os }} name: Cargo steps: diff --git a/.github/workflows/dotnet-test.yml b/.github/workflows/dotnet-test.yml index 3bde02a0c4..89f33c2dde 100644 --- a/.github/workflows/dotnet-test.yml +++ b/.github/workflows/dotnet-test.yml @@ -76,7 +76,7 @@ jobs: { plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl" }, { plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3" }, { plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", xdp: "-UseXdp" }, - { plat: "macos", os: "macos-12", arch: "universal", tls: "openssl" }, + { plat: "macos", os: "macos-13", arch: "universal", tls: "openssl" }, ] runs-on: ${{ matrix.vec.os }} steps: diff --git a/.github/workflows/stress.yml b/.github/workflows/stress.yml index 7b4d71e6f1..4df63a18a5 100644 --- a/.github/workflows/stress.yml +++ b/.github/workflows/stress.yml @@ -47,8 +47,8 @@ jobs: fail-fast: false matrix: vec: [ - { config: "Debug", plat: "macos", os: "macos-12", arch: "x64", tls: "openssl", build: "-Test" }, - { config: "Debug", plat: "macos", os: "macos-12", arch: "x64", tls: "openssl3", build: "-Test" }, + { config: "Debug", plat: "macos", os: "macos-13", arch: "x64", tls: "openssl", build: "-Test" }, + { config: "Debug", plat: "macos", os: "macos-13", arch: "x64", tls: "openssl3", build: "-Test" }, { config: "Debug", plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl", sanitize: "-Sanitize", build: "-Test" }, { config: "Debug", plat: "linux", os: "ubuntu-20.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" }, { config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" }, @@ -79,8 +79,8 @@ jobs: { config: "Debug", plat: "linux", os: "ubuntu-22.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" }, { config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", sanitize: "-Sanitize", build: "-Test" }, { config: "Debug", plat: "linux", os: "ubuntu-24.04", arch: "x64", tls: "openssl3", build: "-Test", xdp: "-UseXdp" }, - { config: "Debug", plat: "macos", os: "macos-12", arch: "x64", tls: "openssl", build: "-Test" }, - { config: "Debug", plat: "macos", os: "macos-12", arch: "x64", tls: "openssl3", build: "-Test" }, + { config: "Debug", plat: "macos", os: "macos-13", arch: "x64", tls: "openssl", build: "-Test" }, + { config: "Debug", plat: "macos", os: "macos-13", arch: "x64", tls: "openssl3", build: "-Test" }, { config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", sanitize: "-Sanitize", build: "-Test" }, { config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", xdp: "-UseXdp", sanitize: "-Sanitize", build: "-Test" }, { config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "openssl", build: "-Test" }, diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 7b676862bb..1869011ce5 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -386,8 +386,8 @@ function CMake-Generate { } if ($Platform -eq "macos") { switch ($Arch) { - "x64" { $Arguments += " -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=""12"""} - "arm64" { $Arguments += " -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=""11.0"""} + "x64" { $Arguments += " -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET=""13"""} + "arm64" { $Arguments += " -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=""13"""} } } if ($Platform -eq "linux") { diff --git a/scripts/build.rs b/scripts/build.rs index 355d263d65..2881cb0001 100644 --- a/scripts/build.rs +++ b/scripts/build.rs @@ -21,13 +21,17 @@ fn main() { .define("QUIC_TLS", "openssl") .define("QUIC_OUTPUT_DIR", "../lib"); + // macos-latest's cargo automatically specify --target=${ARCH}-apple-macosx14.5 + // which conflicts with -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}. + // Different value than 14.5 will cause the build to fail. + // This hardcoded 14.5 is workaround for this issue. match target.as_str() { "x86_64-apple-darwin" => config .define("CMAKE_OSX_ARCHITECTURES", "x86_64") - .define("CMAKE_OSX_DEPLOYMENT_TARGET", "10.15"), + .define("CMAKE_OSX_DEPLOYMENT_TARGET", "14.5"), "aarch64-apple-darwin" => config .define("CMAKE_OSX_ARCHITECTURES", "arm64") - .define("CMAKE_OSX_DEPLOYMENT_TARGET", "11.0"), + .define("CMAKE_OSX_DEPLOYMENT_TARGET", "14.5"), _ => &mut config };