Skip to content

Build fails with Go 1.26 due to gVisor sync runtime constants redeclaration #22

@chenrui333

Description

@chenrui333

Summary

gotun fails to build with Go 1.26.0 due to redeclared constants in gvisor.dev/gvisor/pkg/sync.

Environment

  • gotun: v0.8.0
  • Go: go1.26.0
  • OS: macOS arm64 and Linux arm64 (Homebrew CI)

Reproduction

git clone --depth 1 --branch v0.8.0 https://github.com/Sesame2/gotun.git
cd gotun
go version
# go version go1.26.0 ...
go build -trimpath -ldflags='-s -w -X main.Version=0.8.0' ./cmd/gotun

Error

# gvisor.dev/gvisor/pkg/sync
.../gvisor.dev/gvisor@v0.0.0-20251220000015-517913d17844/pkg/sync/runtime_constants_go126.go:22:2: WaitReasonSelect redeclared in this block
	.../gvisor.dev/gvisor@v0.0.0-20251220000015-517913d17844/pkg/sync/runtime_constants_go125.go:22:2: other declaration of WaitReasonSelect
.../runtime_constants_go126.go:23:2: WaitReasonChanReceive redeclared in this block
	.../runtime_constants_go125.go:23:2: other declaration of WaitReasonChanReceive
.../runtime_constants_go126.go:24:2: WaitReasonSemacquire redeclared in this block
	.../runtime_constants_go125.go:24:2: other declaration of WaitReasonSemacquire

Homebrew references

It looks like this may require updating/pinning the gVisor dependency to a revision compatible with Go 1.26 build tags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions