Skip to content

Commit 31abafc

Browse files
fix(ci): guard RUSTUP_TOOLCHAIN against empty PINNED_RUST on Windows
grep/awk in PINNED_RUST sh: evaluation fail on Windows runners where Git Bash utilities aren't reliably in PATH. This produced RUSTUP_TOOLCHAIN=-x86_64-pc-windows-msvc (empty prefix), causing rustup to fail with "uninstalled toolchain". - Suppress grep stderr and fall through on failure - Only set RUSTUP_TOOLCHAIN when PINNED_RUST is non-empty - When empty, falls through to toolchain installed by actions-rust-lang/setup-rust-toolchain in the composite action Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a8497ee commit 31abafc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

taskfiles/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ vars:
1616
CONFIG_FLAG: '{{if .CONFIG}}--config {{.CONFIG}}{{end}}'
1717
EXE_EXT: '{{if eq OS "windows"}}.exe{{end}}'
1818
PINNED_RUST:
19-
sh: grep '^rust ' {{.ROOT_DIR}}/.tool-versions | awk '{print $2}'
19+
sh: grep '^rust ' {{.ROOT_DIR}}/.tool-versions 2>/dev/null | awk '{print $2}' || true
2020

2121
env:
2222
PATH: "{{.CARGO_BIN}}:{{.MISE_SHIMS}}:{{.PATH}}"
2323
RUSTC_WRAPPER: ""
24-
RUSTUP_TOOLCHAIN: '{{if eq OS "windows"}}{{.PINNED_RUST}}-x86_64-pc-windows-msvc{{else}}{{.PINNED_RUST}}{{end}}'
24+
RUSTUP_TOOLCHAIN: '{{if and (eq OS "windows") .PINNED_RUST}}{{.PINNED_RUST}}-x86_64-pc-windows-msvc{{else if .PINNED_RUST}}{{.PINNED_RUST}}{{end}}'
2525

2626
tasks:
2727
setup:

0 commit comments

Comments
 (0)