From e436a64a6241a9ce2f26bc29c6627ff7d441119a Mon Sep 17 00:00:00 2001 From: Li Jie Date: Fri, 18 Sep 2026 10:05:25 +0800 Subject: [PATCH 1/4] test/goroot: classify Windows 386 timeouts and retire fixed xfails - Add 90s timeouts and flake classification for fixedbugs/issue79186.go, fixedbugs/issue30041.go, and fixedbugs/issue39541.go on windows/386. - Remove version: go1.27 constraint from index0.go timeout and flake entries so Windows 386 uses the 90s budget across all supported Go releases. - Remove fixedbugs/issue80196.go from xfails: per-call stack-slot semantics for loops fixed the stack overflow in PR #2530 and PR #2613. - Remove fixedbugs/issue75764.go on windows/amd64 from xfails: the deep interface tail-call test now passes reliably. --- test/goroot/xfail.yaml | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/test/goroot/xfail.yaml b/test/goroot/xfail.yaml index 27bfef9b6a..637a7608c2 100644 --- a/test/goroot/xfail.yaml +++ b/test/goroot/xfail.yaml @@ -41,6 +41,11 @@ timeouts: case: fixedbugs/issue79186.go timeout: 90s reason: the 51.2 million-operation RWMutex stress loop needs load-dependent runtime slack + - platform: windows/386 + directive: run + case: fixedbugs/issue79186.go + timeout: 90s + reason: the 51.2 million-operation RWMutex stress loop needs load-dependent runtime slack - version: go1.26 platform: darwin/arm64 directive: run @@ -59,8 +64,7 @@ timeouts: case: abi/uglyfib.go timeout: 90s reason: uglyfib can exceed the default timeout on loaded Windows 386 runners - - version: go1.27 - platform: windows/386 + - platform: windows/386 directive: runoutput case: index0.go timeout: 90s @@ -75,6 +79,16 @@ timeouts: case: fixedbugs/issue25897a.go timeout: 90s reason: the single-P continuous-GC loop needs load-dependent runtime slack on Windows 386 + - platform: windows/386 + directive: run + case: fixedbugs/issue30041.go + timeout: 90s + reason: the continuous-GC and reflect.MakeFunc stress loop needs load-dependent runtime slack on Windows 386 + - platform: windows/386 + directive: run + case: fixedbugs/issue39541.go + timeout: 90s + reason: the one-million reflect.MakeFunc concurrent call loop needs load-dependent runtime slack on Windows 386 - version: go1.26 platform: darwin/arm64 directive: runoutput @@ -96,6 +110,10 @@ flakes: directive: run case: fixedbugs/issue79186.go reason: the RWMutex stress test passes when the host is idle but can exceed its timeout under sustained CPU contention + - platform: windows/386 + directive: run + case: fixedbugs/issue79186.go + reason: the RWMutex stress test passes when the host is idle but can exceed its timeout under sustained CPU contention - version: go1.26 platform: linux/amd64 directive: run @@ -157,11 +175,18 @@ flakes: directive: run case: abi/uglyfib.go reason: uglyfib can complete or exceed its run timeout on a loaded Windows 386 runner - - version: go1.27 - platform: windows/386 + - platform: windows/386 directive: runoutput case: index0.go reason: the generated index stress program can pass, time out, or fail during LLVM target object emission on Windows 386 + - platform: windows/386 + directive: run + case: fixedbugs/issue30041.go + reason: the continuous-GC and reflect.MakeFunc stress loop can complete or exceed its run timeout on loaded Windows 386 runners + - platform: windows/386 + directive: run + case: fixedbugs/issue39541.go + reason: the one-million reflect.MakeFunc concurrent call loop can complete or exceed its run timeout on loaded Windows 386 runners xfails: - platform: darwin/arm64 directive: runoutput @@ -179,9 +204,6 @@ xfails: directive: runoutput case: rangegen.go reason: the current golang.org/x/tools/go/ssa dependency mishandles labeled branches in generated range-over-function code; update x/tools after https://github.com/golang/tools/pull/666 lands - - directive: run - case: fixedbugs/issue80196.go - reason: LLGo overflows its native stack while repeatedly assigning the escaped named result in this test - directive: run case: genmeth1.go reason: the current go/types and x/tools SSA path panics while instantiating the new generic-method test @@ -201,11 +223,6 @@ xfails: directive: run case: fixedbugs/issue58300.go reason: LLGo emits unexpected runtime output for the unsafe string conversion test on Windows amd64 - - version: go1.27 - platform: windows/amd64 - directive: run - case: fixedbugs/issue75764.go - reason: LLGo does not eliminate the deep interface tail-call chain and crashes on Windows amd64 - platform: windows/386 directive: run case: fixedbugs/bug114.go From ce741b0d1debb8c691acf1b2840c1a878c8759ed Mon Sep 17 00:00:00 2001 From: Li Jie Date: Fri, 18 Sep 2026 10:36:50 +0800 Subject: [PATCH 2/4] test/goroot: align abi/uglyfib.go windows/386 timeout across all Go releases --- test/goroot/xfail.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/goroot/xfail.yaml b/test/goroot/xfail.yaml index 637a7608c2..6bd53e376d 100644 --- a/test/goroot/xfail.yaml +++ b/test/goroot/xfail.yaml @@ -58,8 +58,7 @@ timeouts: case: abi/uglyfib.go timeout: 1m reason: uglyfib runs close to the default timeout on loaded linux/amd64 runners - - version: go1.27 - platform: windows/386 + - platform: windows/386 directive: run case: abi/uglyfib.go timeout: 90s @@ -170,8 +169,7 @@ flakes: directive: run case: fixedbugs/issue25897a.go reason: reflect-generated goroutines under a single-P continuous-GC loop can complete or exceed the run timeout on Windows 386 - - version: go1.27 - platform: windows/386 + - platform: windows/386 directive: run case: abi/uglyfib.go reason: uglyfib can complete or exceed its run timeout on a loaded Windows 386 runner From a8b845e78ced1f9ad8cad694b44f6e6ca73af65e Mon Sep 17 00:00:00 2001 From: Li Jie Date: Fri, 18 Sep 2026 19:54:06 +0800 Subject: [PATCH 3/4] ci: use native ARM64 MSVC host toolchain on windows-11-arm --- .github/actions/setup-deps/action.yml | 57 ++++++++++++++++----------- .github/windows/msvc-target.ps1 | 3 +- .github/workflows/benchmark.yml | 2 +- .github/workflows/goroot.yml | 4 +- .github/workflows/llgo.yml | 4 +- 5 files changed, 40 insertions(+), 30 deletions(-) diff --git a/.github/actions/setup-deps/action.yml b/.github/actions/setup-deps/action.yml index 926b560726..31aafb056b 100644 --- a/.github/actions/setup-deps/action.yml +++ b/.github/actions/setup-deps/action.yml @@ -38,11 +38,10 @@ runs: if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc' uses: actions/cache@v6 with: - # All MSVC profiles use the same x64 host LLVM. Cache its compressed - # immutable input once instead of three 1.2 GiB extracted trees; the - # target-specific builtins and LLDB remain in the caches below. - path: ${{ runner.tool_cache }}\llgo-llvm-archives\clang+llvm-22.1.8-x86_64-pc-windows-msvc.tar.xz - key: llgo-llvm-archive-22.1.8-x86_64-pc-windows-msvc-d96c2cc1736f4eb7fa43cb9bbdf56d93551a9ae0a9aadb9c99c3c3b2b712a234 + # Cache the host architecture's full LLVM archive: x64 on windows-2022 + # and native ARM64 on windows-11-arm. + path: ${{ runner.tool_cache }}\llgo-llvm-archives\${{ runner.arch == 'ARM64' && 'clang+llvm-22.1.8-aarch64-pc-windows-msvc.tar.xz' || 'clang+llvm-22.1.8-x86_64-pc-windows-msvc.tar.xz' }} + key: ${{ runner.arch == 'ARM64' && 'llgo-llvm-archive-22.1.8-aarch64-pc-windows-msvc-de718c58ebbc5f61d58c17b90457fcf42983bc2c4a4aba3e010d108713bfd7f1' || 'llgo-llvm-archive-22.1.8-x86_64-pc-windows-msvc-d96c2cc1736f4eb7fa43cb9bbdf56d93551a9ae0a9aadb9c99c3c3b2b712a234' }} - name: Install full-target Windows LLVM if: runner.os == 'Windows' && inputs.install-llvm == 'true' && inputs.windows-abi == 'msvc' @@ -52,14 +51,20 @@ runs: # Clang, LLD, and the WebAssembly backend required by LLGo's Windows # host and WASI cross-compilation paths. LLVM_VERSION: "22.1.8" - LLVM_ARCHIVE_SHA256: d96c2cc1736f4eb7fa43cb9bbdf56d93551a9ae0a9aadb9c99c3c3b2b712a234 run: | $ErrorActionPreference = "Stop" if ("${{ inputs.llvm-version }}" -ne "22") { throw "Unsupported Windows LLVM version: ${{ inputs.llvm-version }}" } - $archiveName = "clang+llvm-$env:LLVM_VERSION-x86_64-pc-windows-msvc.tar.xz" + $hostArch = if ($env:RUNNER_ARCH -eq "ARM64") { "aarch64" } else { "x86_64" } + $expectedSha256 = if ($env:RUNNER_ARCH -eq "ARM64") { + "de718c58ebbc5f61d58c17b90457fcf42983bc2c4a4aba3e010d108713bfd7f1" + } else { + "d96c2cc1736f4eb7fa43cb9bbdf56d93551a9ae0a9aadb9c99c3c3b2b712a234" + } + + $archiveName = "clang+llvm-$env:LLVM_VERSION-$hostArch-pc-windows-msvc.tar.xz" $archiveParent = Join-Path $env:RUNNER_TOOL_CACHE "llgo-llvm-archives" $archive = Join-Path $archiveParent $archiveName New-Item -ItemType Directory -Force $archiveParent | Out-Null @@ -72,13 +77,13 @@ runs: } } $actual = (Get-FileHash -Algorithm SHA256 $archive).Hash - if (-not $actual.Equals($env:LLVM_ARCHIVE_SHA256, [StringComparison]::OrdinalIgnoreCase)) { - throw "LLVM archive SHA-256 is $actual, want $env:LLVM_ARCHIVE_SHA256" + if (-not $actual.Equals($expectedSha256, [StringComparison]::OrdinalIgnoreCase)) { + throw "LLVM archive SHA-256 is $actual, want $expectedSha256" } $extractParent = Join-Path $env:RUNNER_TEMP "llgo-llvm-extract" $installParent = Join-Path $env:RUNNER_TOOL_CACHE "llgo-llvm" - $installRoot = Join-Path $installParent "clang+llvm-$env:LLVM_VERSION-x86_64-pc-windows-msvc" + $installRoot = Join-Path $installParent "clang+llvm-$env:LLVM_VERSION-$hostArch-pc-windows-msvc" $sevenZip = Join-Path $env:ProgramFiles "7-Zip\7z.exe" if (-not (Test-Path $sevenZip)) { throw "7-Zip was not found at $sevenZip" @@ -278,7 +283,11 @@ runs: run: | $ErrorActionPreference = "Stop" - $llvmRoot = Join-Path $env:RUNNER_TOOL_CACHE "llgo-llvm\clang+llvm-$env:LLVM_VERSION-x86_64-pc-windows-msvc" + $hostArch = if ($env:RUNNER_ARCH -eq "ARM64") { "aarch64" } else { "x86_64" } + $hostTriple = if ($env:RUNNER_ARCH -eq "ARM64") { "aarch64-pc-windows-msvc" } else { "x86_64-pc-windows-msvc" } + $hostGoArch = if ($env:RUNNER_ARCH -eq "ARM64") { "arm64" } else { "amd64" } + + $llvmRoot = Join-Path $env:RUNNER_TOOL_CACHE "llgo-llvm\clang+llvm-$env:LLVM_VERSION-$hostArch-pc-windows-msvc" if (-not (Test-Path (Join-Path $llvmRoot "bin\llvm-config.exe"))) { throw "The full-target LLVM installation is incomplete: $llvmRoot" } @@ -297,13 +306,13 @@ runs: throw "The native pkgconf executable was not installed at $pkgconf" } - # LLGo itself and the LLVM Go bindings are x64 host programs even when + # LLGo itself and the LLVM Go bindings are host programs even when # this job will later execute ARM64 or 386 output. Target SDK variables # are activated only after the host compiler has been installed. - $null = Enter-LLGoVisualStudio2022 -GoArch "amd64" + $null = Enter-LLGoVisualStudio2022 -GoArch $hostGoArch # Clang emits the MSVC ABI but uses the SDK/UCRT selected by the - # Visual Studio developer environment. Persist the x64 host search + # Visual Studio developer environment. Persist the host search # variables and tools used to build the LLGo compiler itself. Export-LLGoVisualStudioEnvironment # Enter-VsDevShell only updates this action process. Export the native @@ -386,7 +395,7 @@ runs: } $llvmIncludeDir = Join-Path $llvmRoot "include" & (Join-Path $llvmBin "clang++.exe") ` - --target=x86_64-pc-windows-msvc ` + --target=$hostTriple ` -fuse-ld=lld ` -fms-runtime-lib=static ` -std=c++17 ` @@ -449,10 +458,10 @@ runs: # The upstream LLVM 22 development archive builds its static libraries # against the static MSVC runtime. Match it in FileCheck and all host # cgo objects so lld-link sees one RuntimeLibrary directive. - Add-Content -Encoding utf8 $env:GITHUB_ENV "CC=clang --target=x86_64-pc-windows-msvc -fuse-ld=lld -fms-runtime-lib=static" - Add-Content -Encoding utf8 $env:GITHUB_ENV "CXX=clang++ --target=x86_64-pc-windows-msvc -fuse-ld=lld -fms-runtime-lib=static -std=c++17" - Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_HOST_CC=clang --target=x86_64-pc-windows-msvc -fuse-ld=lld -fms-runtime-lib=static" - Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_HOST_CXX=clang++ --target=x86_64-pc-windows-msvc -fuse-ld=lld -fms-runtime-lib=static -std=c++17" + Add-Content -Encoding utf8 $env:GITHUB_ENV "CC=clang --target=$hostTriple -fuse-ld=lld -fms-runtime-lib=static" + Add-Content -Encoding utf8 $env:GITHUB_ENV "CXX=clang++ --target=$hostTriple -fuse-ld=lld -fms-runtime-lib=static -std=c++17" + Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_HOST_CC=clang --target=$hostTriple -fuse-ld=lld -fms-runtime-lib=static" + Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_HOST_CXX=clang++ --target=$hostTriple -fuse-ld=lld -fms-runtime-lib=static -std=c++17" Add-Content -Encoding utf8 $env:GITHUB_ENV "CGO_ENABLED=1" Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_TARGET_TRIPLE=$($target.Triple)" Add-Content -Encoding utf8 $env:GITHUB_ENV "LLGO_WINDOWS_VCPKG_TRIPLET=$($target.VcpkgTriplet)" @@ -483,21 +492,21 @@ runs: throw "LLVM lacks the WebAssembly backend required by Windows-host cross-compilation: $targetsBuilt" } $defaultTarget = (& (Join-Path $llvmBin "clang.exe") -dumpmachine).Trim() - if ($defaultTarget -ne "x86_64-pc-windows-msvc") { - throw "Standalone Clang defaults to $defaultTarget, want x86_64-pc-windows-msvc" + if ($defaultTarget -ne $hostTriple) { + throw "Standalone Clang defaults to $defaultTarget, want $hostTriple" } - $builtins = (& (Join-Path $llvmBin "clang.exe") --target=x86_64-pc-windows-msvc --rtlib=compiler-rt -print-libgcc-file-name).Trim() + $builtins = (& (Join-Path $llvmBin "clang.exe") --target=$hostTriple --rtlib=compiler-rt -print-libgcc-file-name).Trim() if (-not (Test-Path $builtins)) { throw "Clang's MSVC compiler-rt builtins were not found at $builtins" } $targetBuiltins = (& (Join-Path $llvmBin "clang.exe") "--target=$($target.Triple)" --rtlib=compiler-rt -print-libgcc-file-name).Trim() - if ($target.GoArch -ne "amd64" -and -not (Test-Path $targetBuiltins)) { + if ($target.Triple -ne $hostTriple -and -not (Test-Path $targetBuiltins)) { $builtinsArch = if ($target.GoArch -eq "arm64") { "aarch64" } else { "i386" } $cachedBuiltins = Join-Path $env:RUNNER_TOOL_CACHE "llgo-windows-support\$env:LLVM_TARGET_VERSION\$($target.GoArch)\clang_rt.builtins-$builtinsArch.lib" if (-not (Test-Path $cachedBuiltins)) { throw "The cached Windows $($target.GoArch) compiler-rt builtins were not found at $cachedBuiltins" } - # Let the x64 host Clang driver discover the target library through + # Let the host Clang driver discover the target library through # its normal resource-dir lookup, exactly as it does for x86/x64. New-Item -ItemType Directory -Force (Split-Path $targetBuiltins) | Out-Null Copy-Item -LiteralPath $cachedBuiltins -Destination $targetBuiltins diff --git a/.github/windows/msvc-target.ps1 b/.github/windows/msvc-target.ps1 index f4ab330519..1a56ebb78b 100644 --- a/.github/windows/msvc-target.ps1 +++ b/.github/windows/msvc-target.ps1 @@ -71,9 +71,10 @@ function Enter-LLGoVisualStudio2022 { $target = Get-LLGoWindowsMSVCTarget -GoArch $GoArch $installPath = Find-LLGoVisualStudio2022 -GoArch $GoArch Import-Module "$installPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" + $hostArch = if ($env:RUNNER_ARCH -eq "ARM64") { "arm64" } else { "x64" } Enter-VsDevShell -VsInstallPath $installPath ` -SkipAutomaticLocation ` - -DevCmdArguments "-arch=$($target.VisualStudio) -host_arch=x64" + -DevCmdArguments "-arch=$($target.VisualStudio) -host_arch=$hostArch" return $target } diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a56501d2cd..27d5115846 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -46,7 +46,7 @@ jobs: display: Windows MSVC ARM64 windows_abi: msvc windows_arch: arm64 - host_go_arch: x64 + host_go_arch: arm64 timeout: 120 - os: windows-11-arm id: windows-mingw-arm64 diff --git a/.github/workflows/goroot.yml b/.github/workflows/goroot.yml index ffbbeeac56..d13b523ec4 100644 --- a/.github/workflows/goroot.yml +++ b/.github/workflows/goroot.yml @@ -71,7 +71,7 @@ jobs: - name: Set up Go for building LLGo and the runner uses: ./.github/actions/setup-go with: - architecture: ${{ matrix.os == 'windows-11-arm' && matrix.windows_abi == 'mingw' && 'arm64' || startsWith(matrix.os, 'windows') && 'x64' || '' }} + architecture: ${{ matrix.os == 'windows-11-arm' && 'arm64' || startsWith(matrix.os, 'windows') && 'x64' || '' }} - name: Build LLGo and the GOROOT runner id: build-tools @@ -116,7 +116,7 @@ jobs: uses: ./.github/actions/setup-go with: go-version: ${{ steps.target-go.outputs.version }} - architecture: ${{ matrix.os == 'windows-11-arm' && matrix.windows_abi == 'mingw' && 'arm64' || startsWith(matrix.os, 'windows') && 'x64' || '' }} + architecture: ${{ matrix.os == 'windows-11-arm' && 'arm64' || startsWith(matrix.os, 'windows') && 'x64' || '' }} - name: Select target GOROOT shell: bash diff --git a/.github/workflows/llgo.yml b/.github/workflows/llgo.yml index ee0d8a4249..b9a4c70368 100644 --- a/.github/workflows/llgo.yml +++ b/.github/workflows/llgo.yml @@ -54,7 +54,7 @@ jobs: llvm: 22 windows_abi: msvc windows_arch: arm64 - host_go_arch: x64 + host_go_arch: arm64 shard_total: "2" - os: windows-11-arm llvm: 22 @@ -480,7 +480,7 @@ jobs: shard_total: "2" windows_abi: msvc windows_arch: arm64 - host_go_arch: x64 + host_go_arch: arm64 runs-on: ${{ github.repository_owner == 'xgo-dev' && matrix.runner || matrix.os }} steps: - uses: actions/checkout@v7 From f90617ed6e2f851db6b35f5d3111434357b2f78f Mon Sep 17 00:00:00 2001 From: Li Jie Date: Sat, 19 Sep 2026 04:45:12 +0800 Subject: [PATCH 4/4] ci(release): use native ARM64 Go on windows-11-arm --- .github/workflows/release-build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 9efa7459de..b7a2d84df0 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -171,9 +171,8 @@ jobs: - name: Set up Go uses: ./.github/actions/setup-go with: - # MSVC uses the x64 bootstrap Clang, with architecture-matched LLVM - # libraries and SDK for the resulting llgo.exe. MinGW builds natively. - architecture: ${{ matrix.abi == 'mingw' && matrix.goarch == 'arm64' && 'arm64' || 'x64' }} + # On windows-11-arm, both MinGW and MSVC build natively. + architecture: ${{ matrix.os == 'windows-11-arm' && 'arm64' || 'x64' }} - name: Cache ARM64 MSVC release SDK archive if: matrix.abi == 'msvc' && matrix.goarch == 'arm64' uses: actions/cache@v6