Skip to content

Commit 7ec46b5

Browse files
committed
github: only pass --target to Cargo when necessary
Otherwise, the Rust flag settings are ignored for host tools, which means that things like build scripts don’t get linker flags applied. See: * <https://doc.rust-lang.org/1.84.1/cargo/reference/config.html#buildrustflags> * <rust-lang/cargo#4423>
1 parent e3a9b2b commit 7ec46b5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

.github/workflows/ci.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,23 @@ jobs:
2323
include:
2424
- build: linux-x86_64-gnu
2525
os: ubuntu-24.04
26-
target: x86_64-unknown-linux-gnu
2726
cargo_flags: "--all-features"
2827
- build: 'linux-x86_64-gnu, no git2'
2928
os: ubuntu-24.04
30-
target: x86_64-unknown-linux-gnu
3129
cargo_flags: "--no-default-features --features git"
3230
# Ensure we don’t link to `libgit2`.
3331
LIBGIT2_NO_VENDOR: 1
3432
- build: linux-aarch64-gnu
3533
os: ubuntu-24.04-arm
36-
target: aarch64-unknown-linux-gnu
3734
cargo_flags: "--all-features"
3835
- build: macos-x86_64
3936
os: macos-14
40-
target: x86_64-apple-darwin
41-
cargo_flags: "--features vendored-openssl"
37+
cargo_flags: "--target x86_64-apple-darwin --features vendored-openssl"
4238
- build: macos-aarch64
4339
os: macos-14
44-
target: aarch64-apple-darwin
4540
cargo_flags: ""
4641
- build: windows-x86_64
4742
os: windows-2022
48-
target: x86_64-pc-windows-msvc
4943
cargo_flags: ""
5044
runs-on: ${{ matrix.os }}
5145

@@ -81,7 +75,6 @@ jobs:
8175
run: >-
8276
cargo build
8377
--config .cargo/config-ci.toml
84-
--target ${{ matrix.target }}
8578
--workspace
8679
--all-targets
8780
--verbose
@@ -92,7 +85,6 @@ jobs:
9285
run: >-
9386
cargo nextest run
9487
--config .cargo/config-ci.toml
95-
--target ${{ matrix.target }}
9688
--workspace
9789
--all-targets
9890
--verbose

0 commit comments

Comments
 (0)