fix(ci): use USERPROFILE and add rustup toolchain bin to PATH
The rustup shim at .cargo\bin\cargo.exe was failing with "No application is associated with the specified file for this operation" — a Windows error indicating the shim proxy could not resolve the toolchain. Fix by also adding the actual stable toolchain bin dir to PATH, bypassing the shim. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -89,7 +89,13 @@ jobs:
|
|||||||
# Retry transient network errors before failing.
|
# Retry transient network errors before failing.
|
||||||
CARGO_NET_RETRY: '5'
|
CARGO_NET_RETRY: '5'
|
||||||
run: |
|
run: |
|
||||||
$env:PATH = "C:\Users\$env:USERNAME\.cargo\bin;$env:PATH"
|
# USERPROFILE is set by Windows directly; more reliable than C:\Users\$USERNAME
|
||||||
|
$env:PATH = "$env:USERPROFILE\.cargo\bin;$env:PATH"
|
||||||
|
# Also add the actual toolchain bin to bypass rustup shim execution issues
|
||||||
|
$toolchain = Get-ChildItem "$env:USERPROFILE\.rustup\toolchains" -Directory -ErrorAction SilentlyContinue |
|
||||||
|
Where-Object { $_.Name -match 'stable' } | Select-Object -First 1
|
||||||
|
if ($toolchain) { $env:PATH = "$($toolchain.FullName)\bin;$env:PATH" }
|
||||||
|
Write-Host "cargo: $((Get-Command cargo -ErrorAction SilentlyContinue).Source)"
|
||||||
cargo --version
|
cargo --version
|
||||||
npm run tauri -- build --bundles nsis
|
npm run tauri -- build --bundles nsis
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user