From 1cb821f05bd2198725c72f8d4fdefb4250e8139c Mon Sep 17 00:00:00 2001 From: Skyler Lehmkuhl Date: Sun, 21 Jun 2026 17:03:43 -0400 Subject: [PATCH] CI: build Windows under pwsh so MSVC's linker is used Git for Windows puts its usr\bin on PATH ahead of the MSVC tools, so under Git Bash rustc picked up coreutils link.exe instead of MSVC link.exe and every link (even host build scripts like proc-macro2/serde) failed with "/usr/bin/link: extra operand". Split the build step: non-Windows keeps the bash script (needs --target handling); Windows builds under pwsh, where the MSVC environment from msvc-dev-cmd stays at the front of PATH. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3651b5..218f567 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -170,6 +170,7 @@ jobs: echo "MACOSX_DEPLOYMENT_TARGET=11.0" >> "$GITHUB_ENV" - name: Build release binary + if: matrix.platform != 'windows-latest' shell: bash env: FFMPEG_STATIC: "1" @@ -181,6 +182,19 @@ jobs: fi cargo build --release --bin lightningbeam-editor $TARGET_FLAG + # Windows must build under pwsh, not Git Bash: Git for Windows puts its + # usr\bin on PATH ahead of the MSVC tools, so its coreutils `link.exe` + # shadows MSVC's linker and rustc fails with "extra operand". pwsh keeps + # the MSVC environment (set by msvc-dev-cmd) at the front of PATH. + - name: Build release binary (Windows) + if: matrix.platform == 'windows-latest' + shell: pwsh + env: + FFMPEG_STATIC: "1" + run: | + cd lightningbeam-ui + cargo build --release --bin lightningbeam-editor + - name: Copy cross-compiled binary to release dir if: matrix.target != '' shell: bash