Skip to content

Commit f213d44

Browse files
committed
Override CARGO instead
1 parent e9eaf49 commit f213d44

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,32 @@ jobs:
5757
environments: build
5858
- name: Set version
5959
run: pixi run -e build set-version
60-
- name: Install cargo-auditable
61-
if: ${{ !contains(matrix.os, 'ubuntu') }}
62-
run: cargo install cargo-auditable@0.7.4 --locked
60+
- name: Install cargo-auditable (macOS)
61+
if: ${{ contains(matrix.os, 'macos') }}
62+
run: |
63+
cargo install cargo-auditable@0.7.4 --locked
64+
printf '#!/bin/sh\nexec cargo auditable "$@"\n' > /usr/local/bin/cargo-auditable-wrapper
65+
chmod +x /usr/local/bin/cargo-auditable-wrapper
66+
- name: Install cargo-auditable (Windows)
67+
if: ${{ contains(matrix.os, 'windows') }}
68+
run: |
69+
cargo install cargo-auditable@0.7.4 --locked
70+
Set-Content -Path "C:\Windows\System32\cargo-auditable-wrapper.cmd" -Value "@cargo auditable %*"
6371
- name: Build wheel
6472
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
6573
env:
66-
# cargo-auditable and sccache both wrap rustc and cannot be composed.
67-
RUSTC_WORKSPACE_WRAPPER: cargo-auditable
74+
# cargo-auditable is a cargo subcommand wrapper, not a rustc shim.
75+
# Set CARGO to a thin wrapper that prepends "auditable" to every invocation.
76+
CARGO: cargo-auditable-wrapper
6877
with:
6978
command: build
7079
args: --out dist --release -i python3.10
7180
manylinux: auto
7281
sccache: false
73-
before-script-linux: cargo install cargo-auditable@0.7.4 --locked
82+
before-script-linux: |
83+
cargo install cargo-auditable@0.7.4 --locked
84+
printf '#!/bin/sh\nexec cargo auditable "$@"\n' > /usr/local/bin/cargo-auditable-wrapper
85+
chmod +x /usr/local/bin/cargo-auditable-wrapper
7486
- name: Check package
7587
run: pixi run -e build check-wheel
7688
- name: Upload package

0 commit comments

Comments
 (0)