From 1a8ee8ba61b65c7aa0e385e102a85af4e6f7270b Mon Sep 17 00:00:00 2001 From: Haruko386 Date: Thu, 18 Jun 2026 17:49:55 +0800 Subject: [PATCH] fix: wrong clang/toolchain for windows (#16191) ### What problem does this PR solve? As title ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .github/workflows/release.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74ef473aa9..34d9eea199 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -112,16 +112,16 @@ jobs: runner: windows-latest native_asset: native-windows-x86_64.zip msystem: CLANG64 - msys2_packages: mingw-w64-clang-x86_64-clang - cc: clang + msys2_packages: mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-lld + cc: C:/msys64/clang64/bin/clang.exe output_ext: .exe - goos: windows goarch: arm64 runner: windows-11-arm native_asset: native-windows-aarch64.zip msystem: CLANGARM64 - msys2_packages: mingw-w64-clang-aarch64-clang - cc: clang + msys2_packages: mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-lld + cc: C:/msys64/clangarm64/bin/clang.exe output_ext: .exe runs-on: ${{ matrix.runner }} env: @@ -287,13 +287,21 @@ jobs: Write-Host "Building ${{ matrix.goos }}/${{ matrix.goarch }} -> $output" $officeOxidePrefix = $env:OFFICE_OXIDE_PREFIX -replace "\\", "/" + $cc = "${{ matrix.cc }}" + if (-not (Test-Path $cc)) { + Write-Error "C compiler does not exist: $cc" + exit 1 + } $env:CGO_ENABLED = "1" + $env:CC = $cc $env:CGO_CFLAGS = "-I${officeOxidePrefix}/include -I${officeOxidePrefix}/include/office_oxide_c" $env:CGO_LDFLAGS = "${officeOxidePrefix}/lib/office_oxide.lib -lws2_32 -lntdll -luserenv" $env:GOOS = "${{ matrix.goos }}" $env:GOARCH = "${{ matrix.goarch }}" + Write-Host "CC: $env:CC" + & $env:CC --version Write-Host "office_oxide prefix: $officeOxidePrefix" Write-Host "CGO_CFLAGS: $env:CGO_CFLAGS" Write-Host "CGO_LDFLAGS: $env:CGO_LDFLAGS"