From 71c8e5206b98c904f7587d93791eeaf7241986bb Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 18:29:13 +0200 Subject: [PATCH 1/7] Specify min macos version when building --- .github/workflows/main.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1100119..787f527 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,18 +37,35 @@ jobs: Compress-Archive -Path tmp_build/roast-win-console-32.exe -Destination out/roast-win-console-32.exe.zip Compress-Archive -Path tmp_build/roast-win-no-gpu-64.exe -Destination out/roast-win-no-gpu-64.exe.zip Compress-Archive -Path tmp_build/roast-win-no-gpu-32.exe -Destination out/roast-win-no-gpu-32.exe.zip - - name: Build MacOS + - name: Build MacOS (setup) if: matrix.os == 'macos-latest' + run: rustup target add aarch64-apple-darwin + - name: Build MacOS (x86_64) + if: matrix.os == 'macos-latest' + env: + MACOSX_DEPLOYMENT_TARGET: '10.12' run: | - rustup target add aarch64-apple-darwin cargo build --release + - name: Build MacOS (aarch64) + if: matrix.os == 'macos-latest' + env: + MACOSX_DEPLOYMENT_TARGET: '11.0' + run: | cargo build --target aarch64-apple-darwin --release + - name: Build MacOS (release) + if: matrix.os == 'macos-latest' + run: | mkdir -p out mv target/release/roast ./roast-macos-x86_64 mv target/aarch64-apple-darwin/release/roast ./roast-macos-aarch64 chmod +x ./roast-macos-x86_64 ./roast-macos-aarch64 zip out/roast-macos-x86_64.zip ./roast-macos-x86_64 zip out/roast-macos-aarch64.zip ./roast-macos-aarch64 + - name: Build MacOS (verify min version) + if: matrix.os == 'macos-latest' + run: | + otool -l ./roast-macos-x86_64 | rg LC_BUILD_VERSION -A4 | rg minos | sort | uniq -c + otool -l ./roast-macos-aarch64 | rg LC_BUILD_VERSION -A4 | rg minos | sort | uniq -c - name: Build Linux if: matrix.os == 'ubuntu-latest' run: | From 181e2d5de863acf5a1f025ac2e85b40ba83af88b Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 18:30:52 +0200 Subject: [PATCH 2/7] Use fgrep instead of rg --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 787f527..c85292d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,8 +64,8 @@ jobs: - name: Build MacOS (verify min version) if: matrix.os == 'macos-latest' run: | - otool -l ./roast-macos-x86_64 | rg LC_BUILD_VERSION -A4 | rg minos | sort | uniq -c - otool -l ./roast-macos-aarch64 | rg LC_BUILD_VERSION -A4 | rg minos | sort | uniq -c + otool -l ./roast-macos-x86_64 | fgrep LC_BUILD_VERSION -A4 | fgrep minos | sort | uniq -c + otool -l ./roast-macos-aarch64 | fgrep LC_BUILD_VERSION -A4 | fgrep minos | sort | uniq -c - name: Build Linux if: matrix.os == 'ubuntu-latest' run: | From 8f5a0384e157c8774d94855989724f9126ab966f Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 18:54:19 +0200 Subject: [PATCH 3/7] Print deployment target --- .github/workflows/main.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c85292d..2ceae3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,15 +42,13 @@ jobs: run: rustup target add aarch64-apple-darwin - name: Build MacOS (x86_64) if: matrix.os == 'macos-latest' - env: - MACOSX_DEPLOYMENT_TARGET: '10.12' run: | + rustc --print deployment-target cargo build --release - name: Build MacOS (aarch64) if: matrix.os == 'macos-latest' - env: - MACOSX_DEPLOYMENT_TARGET: '11.0' run: | + rustc --print deployment-target --target aarch64-apple-darwin cargo build --target aarch64-apple-darwin --release - name: Build MacOS (release) if: matrix.os == 'macos-latest' From e23604d46c8dda6c781fe713b4d0fb3205fb8b97 Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 18:58:52 +0200 Subject: [PATCH 4/7] Specify target for x86_64 manually --- .github/workflows/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2ceae3d..5be2eb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,12 +39,14 @@ jobs: Compress-Archive -Path tmp_build/roast-win-no-gpu-32.exe -Destination out/roast-win-no-gpu-32.exe.zip - name: Build MacOS (setup) if: matrix.os == 'macos-latest' - run: rustup target add aarch64-apple-darwin + run: | + rustup target add x86_64-apple-darwin + rustup target add aarch64-apple-darwin - name: Build MacOS (x86_64) if: matrix.os == 'macos-latest' run: | - rustc --print deployment-target - cargo build --release + rustc --print deployment-target --target x86_64-apple-darwin + cargo build --target x86_64-apple-darwin --release - name: Build MacOS (aarch64) if: matrix.os == 'macos-latest' run: | @@ -54,7 +56,7 @@ jobs: if: matrix.os == 'macos-latest' run: | mkdir -p out - mv target/release/roast ./roast-macos-x86_64 + mv target/x86_64-apple-darwin/release/roast ./roast-macos-x86_64 mv target/aarch64-apple-darwin/release/roast ./roast-macos-aarch64 chmod +x ./roast-macos-x86_64 ./roast-macos-aarch64 zip out/roast-macos-x86_64.zip ./roast-macos-x86_64 From 8815aa7f3ed5c1ac19a345150bf23a91f5cae826 Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 19:02:04 +0200 Subject: [PATCH 5/7] Specify target via env --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5be2eb6..da975df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,11 +44,15 @@ jobs: rustup target add aarch64-apple-darwin - name: Build MacOS (x86_64) if: matrix.os == 'macos-latest' + env: + MACOSX_DEPLOYMENT_TARGET: '10.12' run: | rustc --print deployment-target --target x86_64-apple-darwin cargo build --target x86_64-apple-darwin --release - name: Build MacOS (aarch64) if: matrix.os == 'macos-latest' + env: + MACOSX_DEPLOYMENT_TARGET: '11.0' run: | rustc --print deployment-target --target aarch64-apple-darwin cargo build --target aarch64-apple-darwin --release From be5a7f5a9b2c50c6d3068b26258c3d1eb015f64d Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 19:05:51 +0200 Subject: [PATCH 6/7] Remove last line --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da975df..126ab2a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,8 +68,7 @@ jobs: - name: Build MacOS (verify min version) if: matrix.os == 'macos-latest' run: | - otool -l ./roast-macos-x86_64 | fgrep LC_BUILD_VERSION -A4 | fgrep minos | sort | uniq -c - otool -l ./roast-macos-aarch64 | fgrep LC_BUILD_VERSION -A4 | fgrep minos | sort | uniq -c + otool -l ./roast-macos-x86_64 - name: Build Linux if: matrix.os == 'ubuntu-latest' run: | From 927dff7ad346acccf8dafbd50958205fa7a95bbf Mon Sep 17 00:00:00 2001 From: Daniele Conti Date: Tue, 30 Apr 2024 19:33:16 +0200 Subject: [PATCH 7/7] Remove debug output --- .github/workflows/main.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 126ab2a..7e299e9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,14 +47,12 @@ jobs: env: MACOSX_DEPLOYMENT_TARGET: '10.12' run: | - rustc --print deployment-target --target x86_64-apple-darwin cargo build --target x86_64-apple-darwin --release - name: Build MacOS (aarch64) if: matrix.os == 'macos-latest' env: MACOSX_DEPLOYMENT_TARGET: '11.0' run: | - rustc --print deployment-target --target aarch64-apple-darwin cargo build --target aarch64-apple-darwin --release - name: Build MacOS (release) if: matrix.os == 'macos-latest' @@ -65,10 +63,6 @@ jobs: chmod +x ./roast-macos-x86_64 ./roast-macos-aarch64 zip out/roast-macos-x86_64.zip ./roast-macos-x86_64 zip out/roast-macos-aarch64.zip ./roast-macos-aarch64 - - name: Build MacOS (verify min version) - if: matrix.os == 'macos-latest' - run: | - otool -l ./roast-macos-x86_64 - name: Build Linux if: matrix.os == 'ubuntu-latest' run: |