From cb52d0cc1ba4cb00584d0c03c2ff851a1981a1f4 Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 8 Oct 2025 22:44:12 +0100 Subject: [PATCH] CI: add windows arm64 workflow (#4175) * CI: add windows arm64 workflow * add win-arm64 capslock * add capslock build tag * add servive test build tag * skip proc_test.go * unskip more tests * skip TestHardcodedBreakpointCounts as flaky * add gotip * add version log to ps1 * switch logic to use stable json endpoint for getting latest go * add continue-on-error for gotip --- .github/workflows/test-windows-arm64.yml | 29 ++++++++++++++++ Documentation/backend_test_health.md | 7 ++-- _scripts/capslock_windows_arm64-output.txt | 40 ++++++++++++++++++++++ _scripts/gen-capslock-all.go | 1 + _scripts/test_windows.ps1 | 6 ++-- cmd/dlv/dlv_test.go | 3 ++ pkg/proc/proc_test.go | 9 ++--- service/test/integration2_test.go | 4 +++ 8 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/test-windows-arm64.yml create mode 100644 _scripts/capslock_windows_arm64-output.txt diff --git a/.github/workflows/test-windows-arm64.yml b/.github/workflows/test-windows-arm64.yml new file mode 100644 index 00000000..73982215 --- /dev/null +++ b/.github/workflows/test-windows-arm64.yml @@ -0,0 +1,29 @@ +name: Test Windows ARM64 + +on: + push: + pull_request: + branches: [master] + +# Cancel existing runs if user makes another push. +concurrency: + group: "${{ github.ref }}-${{ github.workflow}}" + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + test-windows-arm64: + runs-on: windows-11-arm + timeout-minutes: 90 + + strategy: + fail-fast: false + matrix: + go-version: ["1.24", "1.25", "tip"] + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Run tests + run: _scripts/test_windows.ps1 -version go${{ matrix.go-version }} -arch arm64 -binDir $env:RUNNER_TOOL_CACHE + continue-on-error: ${{ matrix.go-version == 'tip' }} diff --git a/Documentation/backend_test_health.md b/Documentation/backend_test_health.md index 19b468eb..9e9bd550 100644 --- a/Documentation/backend_test_health.md +++ b/Documentation/backend_test_health.md @@ -52,7 +52,6 @@ Tests skipped by each supported backend: * 1 broken * 2 not working on windows * 6 see https://github.com/go-delve/delve/issues/2768 -* windows/arm64 skipped = 5 - * 3 broken - * 1 broken - cgo stacktraces - * 1 broken - step concurrent +* windows/arm64 skipped = 3 + * 2 broken - cgo stacktraces + * 1 flaky diff --git a/_scripts/capslock_windows_arm64-output.txt b/_scripts/capslock_windows_arm64-output.txt new file mode 100644 index 00000000..5d6e6ae6 --- /dev/null +++ b/_scripts/capslock_windows_arm64-output.txt @@ -0,0 +1,40 @@ +Capslock is an experimental tool for static analysis of Go packages. +Share feedback and file bugs at https://github.com/google/capslock. +For additional debugging signals, use verbose mode with -output=verbose +To get machine-readable full analysis output, use -output=json + +Analyzed packages: + github.com/cosiner/argv v0.1.0 + github.com/cpuguy83/go-md2man/v2 v2.0.6 + github.com/derekparker/trie/v3 v3.2.0 + github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 + github.com/google/go-dap v0.12.0 + github.com/hashicorp/golang-lru/v2 v2.0.7 + github.com/inconshreveable/mousetrap v1.1.0 + github.com/mattn/go-colorable v0.1.13 + github.com/mattn/go-isatty v0.0.20 + github.com/mattn/go-runewidth v0.0.13 + github.com/rivo/uniseg v0.2.0 + github.com/russross/blackfriday/v2 v2.1.0 + github.com/spf13/cobra v1.9.1 + github.com/spf13/pflag v1.0.6 + go.starlark.net v0.0.0-20231101134539-556fd59b42f6 + golang.org/x/arch v0.11.0 + golang.org/x/sync v0.8.0 + golang.org/x/sys v0.26.0 + golang.org/x/telemetry v0.0.0-20241106142447-58a1122356f5 + gopkg.in/yaml.v3 v3.0.1 + +CAPABILITY_ARBITRARY_EXECUTION: 2 references +CAPABILITY_EXEC: 2 references +CAPABILITY_FILES: 2 references +CAPABILITY_MODIFY_SYSTEM_STATE: 1 references +CAPABILITY_NETWORK: 1 references +CAPABILITY_OPERATING_SYSTEM: 1 references +CAPABILITY_READ_SYSTEM_STATE: 2 references +CAPABILITY_REFLECT: 2 references +CAPABILITY_RUNTIME: 1 references +CAPABILITY_SYSTEM_CALLS: 2 references +CAPABILITY_UNANALYZED: 2 references +CAPABILITY_UNSAFE_POINTER: 2 references + diff --git a/_scripts/gen-capslock-all.go b/_scripts/gen-capslock-all.go index 8a170d6c..4e5d0688 100644 --- a/_scripts/gen-capslock-all.go +++ b/_scripts/gen-capslock-all.go @@ -26,6 +26,7 @@ var platforms = []Platform{ {GOOS: "darwin", GOARCH: "amd64"}, {GOOS: "darwin", GOARCH: "arm64"}, {GOOS: "windows", GOARCH: "amd64"}, + {GOOS: "windows", GOARCH: "arm64", BuildTags: "exp.winarm64"}, } const ( diff --git a/_scripts/test_windows.ps1 b/_scripts/test_windows.ps1 index f015d187..25187edc 100644 --- a/_scripts/test_windows.ps1 +++ b/_scripts/test_windows.ps1 @@ -18,7 +18,7 @@ if ($arch -eq "amd64") #Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install -y mingw } elseif ($arch -eq "arm64") { - $llvmVersion = "20220906" + $llvmVersion = "20250924" $name = "llvm-mingw-$llvmVersion-ucrt-aarch64" if (-Not(Test-Path "$binDir\llvm-mingw\$name")) { @@ -44,6 +44,7 @@ $env:PATH = "$binDir\procdump;$env:PATH" function GetGo($version) { $env:GOROOT = "$binDir\go\$version" + Write-Host "Installing Go $version to $env:GOROOT" if (-Not(Test-Path $env:GOROOT)) { $file = "$version.windows-$arch.zip" @@ -57,7 +58,8 @@ function GetGo($version) { if ($version -eq "gotip") { #Exit 0 - $latest = (Invoke-WebRequest -Uri "https://golang.org/VERSION?m=text" -UseBasicParsing | Select-Object -ExpandProperty Content -ErrorAction Stop).Split([Environment]::NewLine) | select -first 1 + $versions = Invoke-WebRequest -Uri "https://go.dev/dl/?mode=json" -UseBasicParsing | foreach {$_.Content} | ConvertFrom-Json -ErrorAction Stop + $latest = $versions[0].version GetGo $latest $env:GOROOT_BOOTSTRAP = $env:GOROOT $env:GOROOT = "$binDir\go\go-tip" diff --git a/cmd/dlv/dlv_test.go b/cmd/dlv/dlv_test.go index 6ce7615d..d39814e2 100644 --- a/cmd/dlv/dlv_test.go +++ b/cmd/dlv/dlv_test.go @@ -1467,6 +1467,9 @@ func TestCapsLock(t *testing.T) { if goos == "linux" && goarch == "ppc64le" { args = append([]string{"-buildtags", "exp.linuxppc64le"}, args...) } + if goos == "windows" && goarch == "arm64" { + args = append([]string{"-buildtags", "exp.winarm64"}, args...) + } cmd := exec.Command("capslock", args...) cmd.Dir = protest.ProjectRoot() diff --git a/pkg/proc/proc_test.go b/pkg/proc/proc_test.go index 38ca5c19..5811a4fc 100644 --- a/pkg/proc/proc_test.go +++ b/pkg/proc/proc_test.go @@ -440,7 +440,6 @@ func countBreakpoints(p *proc.Target) int { } func TestNextConcurrent(t *testing.T) { - skipOn(t, "broken", "windows", "arm64") testcases := []nextTest{ {8, 9}, {9, 10}, @@ -476,7 +475,6 @@ func TestNextConcurrent(t *testing.T) { } func TestNextConcurrentVariant2(t *testing.T) { - skipOn(t, "broken", "windows", "arm64") // Just like TestNextConcurrent but instead of removing the initial breakpoint we check that when it happens is for other goroutines testcases := []nextTest{ {8, 9}, @@ -1260,7 +1258,7 @@ func TestBreakpointCounts(t *testing.T) { } func TestHardcodedBreakpointCounts(t *testing.T) { - skipOn(t, "broken", "windows", "arm64") + skipOn(t, "flaky", "windows", "arm64") withTestProcess("hcbpcountstest", t, func(p *proc.Target, grp *proc.TargetGroup, fixture protest.Fixture) { counts := map[int64]int{} for { @@ -2108,7 +2106,6 @@ func TestStepOut(t *testing.T) { } func TestStepConcurrentDirect(t *testing.T) { - skipOn(t, "broken - step concurrent", "windows", "arm64") protest.AllowRecording(t) withTestProcess("teststepconcurrent", t, func(p *proc.Target, grp *proc.TargetGroup, fixture protest.Fixture) { bp := setFileBreakpoint(p, t, fixture.Source, 37) @@ -3050,9 +3047,6 @@ func TestCgoStacktrace(t *testing.T) { skipOn(t, "broken - cgo stacktraces", "windows", "arm64") skipOn(t, "broken - cgo stacktraces", "linux", "ppc64le") skipOn(t, "broken - cgo stacktraces", "linux", "riscv64") - if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 21) { - skipOn(t, "broken - cgo stacktraces", "windows", "arm64") - } protest.MustHaveCgo(t) // Tests that: @@ -4328,6 +4322,7 @@ func TestCgoStacktrace2(t *testing.T) { } skipOn(t, "broken", "386") skipOn(t, "broken - cgo stacktraces", "darwin", "arm64") + skipOn(t, "broken - cgo stacktraces", "windows", "arm64") skipOn(t, "broken", "ppc64le") skipOn(t, "broken", "riscv64") protest.MustHaveCgo(t) diff --git a/service/test/integration2_test.go b/service/test/integration2_test.go index b0f311bf..cb64a162 100644 --- a/service/test/integration2_test.go +++ b/service/test/integration2_test.go @@ -3241,6 +3241,10 @@ func TestGuessSubstitutePath(t *testing.T) { t.Setenv("GOFLAGS", "-tags=exp.linuxriscv64") case "loong64": t.Setenv("GOFLAGS", "-tags=exp.linuxloong64") + case "arm64": + if runtime.GOOS == "windows" { + t.Setenv("GOFLAGS", "-tags=exp.winarm64") + } } gsp, err := client.GuessSubstitutePath()