Skip to content

Commit a7f208a

Browse files
committed
Try simplified
1 parent fe3fc99 commit a7f208a

1 file changed

Lines changed: 12 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,26 +60,19 @@ jobs:
6060
- name: Install cargo-auditable
6161
shell: bash
6262
run: |
63-
# cargo-auditable must be invoked as "cargo auditable <cmd>" (subcommand form), not as a
64-
# direct CARGO replacement — the latter does not support "cargo rustc --profile".
65-
# A thin wrapper script bridges the gap by forwarding all args through the subcommand.
66-
if [[ "$RUNNER_OS" == "Linux" ]]; then
67-
# before-script-linux handles installation inside the manylinux container.
68-
# Set CARGO on the host so maturin-action passes it into the container.
69-
echo "CARGO=/usr/local/bin/cargo-auditable-wrapper" >> "$GITHUB_ENV"
70-
elif [[ "$RUNNER_OS" == "Windows" ]]; then
71-
REAL_CARGO="$(cygpath -w "$(which cargo)")"
63+
# cargo-auditable must be invoked as "cargo auditable <cmd>", not as a direct CARGO
64+
# replacement — the latter does not support "cargo rustc --profile". A wrapper delegates
65+
# to the real cargo via PATH (no recursion risk since CARGO is set via env, not PATH).
66+
if [[ "$RUNNER_OS" != "Linux" ]]; then
7267
cargo install cargo-auditable@0.7.4 --locked
73-
WRAPPER="C:/cargo-auditable-wrapper.cmd"
74-
printf '@"%s" auditable %%*\n' "$REAL_CARGO" > "$WRAPPER"
75-
echo "CARGO=$(cygpath -w "$WRAPPER")" >> "$GITHUB_ENV"
68+
fi
69+
if [[ "$RUNNER_OS" == "Windows" ]]; then
70+
printf '@cargo auditable %%*\n' > "C:/cargo-auditable-wrapper.cmd"
71+
echo "CARGO=C:\\cargo-auditable-wrapper.cmd" >> "$GITHUB_ENV"
7672
else
77-
cargo install cargo-auditable@0.7.4 --locked
78-
REAL_CARGO="$(which cargo)"
79-
WRAPPER="/usr/local/bin/cargo-auditable-wrapper"
80-
printf '#!/bin/sh\nREAL_CARGO="%s"\nexec "$REAL_CARGO" auditable "$@"\n' "$REAL_CARGO" > "$WRAPPER"
81-
chmod +x "$WRAPPER"
82-
echo "CARGO=$WRAPPER" >> "$GITHUB_ENV"
73+
printf '#!/bin/sh\nexec cargo auditable "$@"\n' > /usr/local/bin/cargo-auditable-wrapper
74+
chmod +x /usr/local/bin/cargo-auditable-wrapper
75+
echo "CARGO=/usr/local/bin/cargo-auditable-wrapper" >> "$GITHUB_ENV"
8376
fi
8477
- name: Build wheel
8578
uses: PyO3/maturin-action@04ac600d27cdf7a9a280dadf7147097c42b757ad # v1.50.1
@@ -91,8 +84,7 @@ jobs:
9184
docker-options: "-e CARGO=${{ env.CARGO }}"
9285
before-script-linux: |
9386
cargo install cargo-auditable@0.7.4 --locked
94-
REAL_CARGO="$(which cargo)"
95-
printf '#!/bin/sh\nREAL_CARGO="%s"\nexec "$REAL_CARGO" auditable "$@"\n' "$REAL_CARGO" > /usr/local/bin/cargo-auditable-wrapper
87+
printf '#!/bin/sh\nexec cargo auditable "$@"\n' > /usr/local/bin/cargo-auditable-wrapper
9688
chmod +x /usr/local/bin/cargo-auditable-wrapper
9789
- name: Check package
9890
run: pixi run -e build check-wheel

0 commit comments

Comments
 (0)