Skip to content

Commit fbafff3

Browse files
committed
Really use cross only when cross-compiling on Linux
1 parent 8f43a92 commit fbafff3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,32 @@ jobs:
7575
- build: linux
7676
os: ubuntu-latest
7777
rust: stable
78+
cargo: cargo
7879
target: x86_64-unknown-linux-musl
7980
- build: linux-arm
8081
os: ubuntu-latest
8182
rust: nightly
83+
cargo: cross
8284
target: arm-unknown-linux-gnueabihf
8385
- build: macos
8486
os: macos-latest
8587
rust: stable
88+
cargo: cargo
8689
target: x86_64-apple-darwin
8790
- build: win-msvc
8891
os: windows-latest
8992
rust: nightly
93+
cargo: cargo
9094
target: x86_64-pc-windows-msvc
9195
- build: win-gnu
9296
os: windows-latest
9397
rust: nightly-x86_64-gnu
98+
cargo: cargo
9499
target: x86_64-pc-windows-gnu
95100
- build: win32-msvc
96101
os: windows-latest
97102
rust: nightly
103+
cargo: cargo
98104
target: i686-pc-windows-msvc
99105
# on linux we build with musl which causes trouble with open-ssl. For now, just build max-pure there
100106
# even though we could also build with `--features max-control,http-client-reqwest,gitoxide-core-blocking-client,gix-features/fast-sha1` for fast hashing.
@@ -116,14 +122,10 @@ jobs:
116122
runs-on: ${{ matrix.os }}
117123

118124
env:
119-
# For some builds, we use cross to test on 32-bit, and maybe later big-endian, systems.
120-
CARGO: cargo
121-
# Whether CARGO is `cargo` or `cross`, TARGET_FLAGS will be set to `--target matrix.target`.
125+
CARGO: ${{ matrix.cargo }}
122126
TARGET_FLAGS: --target=${{ matrix.target }}
123-
# Whether CARGO is `cargo` or `cross`, TARGET_DIR will include matrix.target.
124127
TARGET_DIR: ./target/${{ matrix.target }}
125-
# Emit backtraces on panics.
126-
RUST_BACKTRACE: 1
128+
RUST_BACKTRACE: 1 # Emit backtraces on panics.
127129

128130
steps:
129131
- name: Checkout repository
@@ -142,11 +144,9 @@ jobs:
142144
toolchain: ${{ matrix.rust }}
143145
targets: ${{ matrix.target }}
144146

145-
- name: Use Cross
146-
if: matrix.os == 'ubuntu-latest'
147-
run: |
148-
cargo install cross
149-
echo 'CARGO=cross' >> "$GITHUB_ENV"
147+
- name: Install Cross
148+
if: matrix.cargo == 'cross'
149+
run: cargo install cross
150150

151151
- name: Show command used for Cargo
152152
run: |

0 commit comments

Comments
 (0)