Skip to content

Commit 1767701

Browse files
fix(ci): force MSVC host toolchain on Windows to prevent dlltool errors
The self-hosted Windows runner has a persistent rustup settings file with default_host_triple set to x86_64-pc-windows-gnu. This causes rustup to install the GNU-hosted toolchain, which requires dlltool.exe (not present), producing flaky builds. - Add `rustup set default-host x86_64-pc-windows-msvc` before toolchain install in both the composite action and the Taskfile - Pass PINNED_RUST explicitly from the composite action to task ci:setup on Windows, bypassing unreliable grep/awk resolution in Task's sh: - Add host verification to the setup-rust-windows status check Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f74c32f commit 1767701

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.github/actions/setup-tauri-build/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ runs:
4141
$gitPath = (Get-ItemProperty 'HKLM:\SOFTWARE\GitForWindows' -ErrorAction SilentlyContinue).InstallPath
4242
if ($gitPath) { echo "$gitPath\usr\bin" >> $env:GITHUB_PATH }
4343
44+
- name: Set rustup default host to MSVC (Windows)
45+
if: runner.os == 'Windows'
46+
shell: pwsh
47+
run: |
48+
if (Get-Command rustup -ErrorAction SilentlyContinue) {
49+
rustup set default-host x86_64-pc-windows-msvc
50+
}
51+
4452
- name: Install Task
4553
uses: go-task/setup-task@v1
4654

@@ -129,7 +137,7 @@ runs:
129137
- name: Setup CI environment (Windows)
130138
if: runner.os == 'Windows'
131139
shell: pwsh
132-
run: task ci:setup
140+
run: task ci:setup PINNED_RUST=${{ steps.rust-version-windows.outputs.toolchain }}
133141

134142
- name: Windows Defender exclusions
135143
if: runner.os == 'Windows'

taskfiles/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ tasks:
5050
desc: "Configure rustup nightly toolchain (Windows)"
5151
platforms: [windows]
5252
cmds:
53+
- rustup set default-host x86_64-pc-windows-msvc
5354
- rustup toolchain install {{.PINNED_RUST}} --profile minimal --no-self-update --target x86_64-pc-windows-msvc
5455
- rustup default {{.PINNED_RUST}}
5556
- rustc --version
5657
- cargo --version
5758
status:
5859
- rustup run {{.PINNED_RUST}} rustc --version
60+
- rustup run {{.PINNED_RUST}} rustc --version --verbose | findstr "host: x86_64-pc-windows-msvc"
5961
- rustup target list --installed --toolchain {{.PINNED_RUST}} | findstr x86_64-pc-windows-msvc
6062

6163
setup-cargo-tools:

0 commit comments

Comments
 (0)