From 9e5a10c87f37b15b1a2de7479efe25b5da34616e Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 29 Jul 2024 23:05:40 -0400 Subject: [PATCH 1/4] Update comment about CARGO env var in release workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68f8b6ea7bb..09bb9b86d69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -116,7 +116,7 @@ jobs: runs-on: ${{ matrix.os }} env: - CARGO: cargo # Sometimes changes to `cross` later (such as when building linux-arm). + CARGO: cargo # On Linux, this will be changed to `cross` later. TARGET_FLAGS: --target=${{ matrix.target }} TARGET_DIR: ./target/${{ matrix.target }} RUST_BACKTRACE: 1 # Emit backtraces on panics. From 076c262106934f752aeb0d513c94c89c4f3724d2 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 29 Jul 2024 23:18:40 -0400 Subject: [PATCH 2/4] Don't use `build` in the matrix, just use `target` They corresponded one-to-one, with `build` holding short names. But the short names were: - Not needed, not having appeared in releases. - Misleading, e.g. by not carrying an architecture, the short name `macos` may have obscured that a major architecture wasn't covered. - Limiting, in that short names are harder to come up with when more architectures on the same operating systems are built for, as will be done soon. --- .github/workflows/release.yml | 52 +++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09bb9b86d69..6282c47ada8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,48 +69,52 @@ jobs: strategy: matrix: - build: [ linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc ] - feature: [ small, lean, max, max-pure ] + target: + - x86_64-unknown-linux-musl + - arm-unknown-linux-gnueabihf + - x86_64-apple-darwin + - x86_64-pc-windows-msvc + - x86_64-pc-windows-gnu + - i686-pc-windows-msvc + feature: + - small + - lean + - max + - max-pure include: - - build: linux + - target: x86_64-unknown-linux-musl os: ubuntu-latest rust: stable - target: x86_64-unknown-linux-musl - - build: linux-arm + - target: arm-unknown-linux-gnueabihf os: ubuntu-latest rust: nightly - target: arm-unknown-linux-gnueabihf - - build: macos + - target: x86_64-apple-darwin os: macos-latest rust: stable - target: x86_64-apple-darwin - - build: win-msvc + - target: x86_64-pc-windows-msvc os: windows-latest rust: nightly - target: x86_64-pc-windows-msvc - - build: win-gnu + - target: x86_64-pc-windows-gnu os: windows-latest rust: nightly-x86_64-gnu - target: x86_64-pc-windows-gnu - - build: win32-msvc + - target: i686-pc-windows-msvc os: windows-latest rust: nightly - target: i686-pc-windows-msvc # on linux we build with musl which causes trouble with open-ssl. For now, just build max-pure there # even though we could also build with `--features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/fast-sha1` for fast hashing. # It's a TODO. exclude: - - build: linux + - target: x86_64-unknown-linux-musl feature: small - - build: linux + - target: x86_64-unknown-linux-musl feature: lean - - build: linux + - target: x86_64-unknown-linux-musl feature: max - - build: linux-arm + - target: arm-unknown-linux-gnueabihf feature: small - - build: linux-arm + - target: arm-unknown-linux-gnueabihf feature: lean - - build: linux-arm + - target: arm-unknown-linux-gnueabihf feature: max runs-on: ${{ matrix.os }} @@ -165,12 +169,12 @@ jobs: run: | "$CARGO" build --verbose --release "$TARGET_FLAGS" --no-default-features --features ${{ matrix.feature }} - - name: Strip release binary (linux and macos) - if: matrix.build == 'linux' || matrix.build == 'macos' + - name: Strip release binary (x86-64 Linux, and macOS) + if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'x86_64-apple-darwin' run: strip "$TARGET_DIR"/release/{ein,gix} - - name: Strip release binary (arm) - if: matrix.build == 'linux-arm' + - name: Strip release binary (ARM Linux) + if: matrix.target == 'arm-unknown-linux-gnueabihf' run: | docker run --rm -v \ "$PWD/target:/target:Z" \ From 9da63eb8bb6862c5c0863a062957d873860032a5 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 29 Jul 2024 23:35:33 -0400 Subject: [PATCH 3/4] Add aarch64-apple-darwin target in release workflow This should be broadly useful, but see #1478 for specific context. --- .github/workflows/release.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6282c47ada8..9afaa7b4356 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,6 +73,7 @@ jobs: - x86_64-unknown-linux-musl - arm-unknown-linux-gnueabihf - x86_64-apple-darwin + - aarch64-apple-darwin - x86_64-pc-windows-msvc - x86_64-pc-windows-gnu - i686-pc-windows-msvc @@ -91,6 +92,9 @@ jobs: - target: x86_64-apple-darwin os: macos-latest rust: stable + - target: aarch64-apple-darwin + os: macos-latest + rust: stable - target: x86_64-pc-windows-msvc os: windows-latest rust: nightly @@ -169,8 +173,8 @@ jobs: run: | "$CARGO" build --verbose --release "$TARGET_FLAGS" --no-default-features --features ${{ matrix.feature }} - - name: Strip release binary (x86-64 Linux, and macOS) - if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'x86_64-apple-darwin' + - name: Strip release binary (x86-64 Linux, and all macOS) + if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.os == 'macos-latest' run: strip "$TARGET_DIR"/release/{ein,gix} - name: Strip release binary (ARM Linux) From e9cb26b928a1096e4b65e589982759fd1c302528 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 29 Jul 2024 23:37:41 -0400 Subject: [PATCH 4/4] Add aarch64-pc-windows-msvc target in release workflow --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9afaa7b4356..b8dae654380 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,6 +77,7 @@ jobs: - x86_64-pc-windows-msvc - x86_64-pc-windows-gnu - i686-pc-windows-msvc + - aarch64-pc-windows-msvc feature: - small - lean @@ -104,6 +105,9 @@ jobs: - target: i686-pc-windows-msvc os: windows-latest rust: nightly + - target: aarch64-pc-windows-msvc + os: windows-latest + rust: nightly # on linux we build with musl which causes trouble with open-ssl. For now, just build max-pure there # even though we could also build with `--features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/fast-sha1` for fast hashing. # It's a TODO.