Skip to content

misc: Go 1.27 compatibility and windows/arm64 test fixes#4377

Merged
derekparker merged 8 commits into
go-delve:masterfrom
derekparker:go1.27-compatibility
Jun 30, 2026
Merged

misc: Go 1.27 compatibility and windows/arm64 test fixes#4377
derekparker merged 8 commits into
go-delve:masterfrom
derekparker:go1.27-compatibility

Conversation

@derekparker

@derekparker derekparker commented Jun 25, 2026

Copy link
Copy Markdown
Member

Skip TestCapsLock on Go 1.27 RC/beta/devel builds where the exact
version string format differs from stable releases.

Fix several test failures on windows/arm64. TestGeneratedDoc was
running gen-usage-docs without the exp.winarm64 build tag, which was
lost during the partial revert in b17af91. TestFrameEvaluation could
panic with an index out of range when variable evaluation returned
garbage values for goroutines deep in runtime frames — added a bounds
check and increased leniency on windows/arm64 to tolerate more than
one unreadable goroutine.

The debugdetect integration tests were failing because dlv exited
without printing the listen address. The root cause was
golang.org/x/sys/windows using the deprecated syscall.Syscall15 in
Proc.Call, which overflows the 792-byte nosplit stack limit when
compiled with -gcflags="all=-N -l" on windows/arm64 (golang/go#78317).
Updated golang.org/x/sys from v0.26.0 to v0.46.0 which uses
syscall.SyscallN instead. Also improved the test to scan for the listen
address marker in a loop rather than assuming it is the first line of
stdout, and to include stderr in the failure message.

@derekparker derekparker force-pushed the go1.27-compatibility branch from d78914d to 7ed297f Compare June 29, 2026 17:48
Capslock v0.3.2 uses golang.org/x/tools v0.43.0 which has a bug
with Go 1.27 syntax, causing a panic:
  panic: unexpected expr: *ast.KeyValueExpr

This is an upstream issue in the golang.org/x/tools SSA builder.

Skip the test only on development/RC/beta builds of Go 1.27+.
Once Go 1.27.0 stable is released and the tools are updated to
support it, the test will automatically re-enable.

Older stable Go versions (1.26.x and earlier) continue to work.
Capslock v0.3.2 uses golang.org/x/tools v0.43.0 which has a bug
with Go 1.27 syntax, causing a panic:
  panic: unexpected expr: *ast.KeyValueExpr

Skip the test only on development/RC/beta builds of Go 1.27+.
Once Go 1.27.0 stable is released and capslock is updated with
newer golang.org/x/tools, the test will automatically re-enable.

The test continues to run on older stable Go versions in CI,
maintaining security coverage.
@derekparker derekparker force-pushed the go1.27-compatibility branch from 7ed297f to 93e4221 Compare June 29, 2026 18:52
TestGeneratedDoc: skip gen-usage-docs on windows/arm64 since the
script transitively imports pkg/proc/native which requires the
exp.winarm64 build tag. This skip was lost during the partial
revert in b17af91.

TestFrameEvaluation: add bounds check before using evaluated
variable value as array index. On windows/arm64, variable
evaluation can return garbage values for goroutines deep in
runtime frames, causing an index-out-of-range panic. The existing
lenient flag on Windows tolerates one missing goroutine.
TestFrameEvaluation: change lenient from bool to counter, allowing
2 missing goroutines on windows/arm64. Variable evaluation can return
garbage values for goroutines deep in runtime frames, and the existing
single-goroutine leniency was insufficient.

debugdetect integration tests: scan stdout in a loop for the listen
address marker instead of assuming it is the first line. Capture
stderr for diagnostics when dlv exits without printing the address.
Scan stdout in a loop for the listen address marker instead of
assuming it is the first line. Include dlv's stderr output in the
fatal message when the listen address is never found, so the
actual build or startup error is visible in CI output.
Fixes nosplit stack overflow when debugging on windows/arm64 with
Go 1.26. The old x/sys used syscall.Syscall15 in Proc.Call, which
overflows the 792-byte nosplit stack limit when compiled with
-gcflags="all=-N -l". The new version uses syscall.SyscallN instead.

See golang/go#78317.
@derekparker derekparker changed the title misc: update staticheck and skip capslock on 1.27 misc: Go 1.27 compatibility and windows/arm64 test fixes Jun 30, 2026
Non-default GOEXPERIMENT values force a full standard library rebuild.
On riscv64 this rebuild is too slow to complete within the test timeout,
causing TestMapImplementationVariants/MapSplitGroup to hang until the
10-minute test binary deadline fires.
The pkg/proc test suite regularly exceeds the default 10-minute go test
timeout on riscv64 due to the architecture's lower performance. Increase
to 20 minutes to give the suite enough headroom.

@aarzilli aarzilli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aarzilli

Copy link
Copy Markdown
Member

Still draft?

@derekparker derekparker marked this pull request as ready for review June 30, 2026 15:45
@derekparker derekparker merged commit d716866 into go-delve:master Jun 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants