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) <noreply@anthropic.com>
This commit is contained in:
parent
8223593649
commit
1cb821f05b
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue