Skip to content

Commit 97637c3

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 97637c3

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,24 @@ 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+
targets: x86_64-apple-darwin
38+
cargo_flags: "--target x86_64-apple-darwin --features vendored-openssl"
4239
- build: macos-aarch64
4340
os: macos-14
44-
target: aarch64-apple-darwin
4541
cargo_flags: ""
4642
- build: windows-x86_64
4743
os: windows-2022
48-
target: x86_64-pc-windows-msvc
4944
cargo_flags: ""
5045
runs-on: ${{ matrix.os }}
5146

@@ -73,15 +68,14 @@ jobs:
7368
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203
7469
with:
7570
toolchain: 1.84
76-
target: ${{ matrix.target }}
71+
target: ${{ matrix.targets }}
7772
- uses: taiki-e/install-action@0f58b6a196e0d71c72fd459ab8fd8b228f85f669
7873
with:
7974
tool: nextest,taplo-cli
8075
- name: Build
8176
run: >-
8277
cargo build
8378
--config .cargo/config-ci.toml
84-
--target ${{ matrix.target }}
8579
--workspace
8680
--all-targets
8781
--verbose
@@ -92,7 +86,6 @@ jobs:
9286
run: >-
9387
cargo nextest run
9488
--config .cargo/config-ci.toml
95-
--target ${{ matrix.target }}
9689
--workspace
9790
--all-targets
9891
--verbose

0 commit comments

Comments
 (0)