Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: removed godebug settings cause errors #72111

Open
pgimalac opened this issue Mar 5, 2025 · 5 comments
Open

cmd/go: removed godebug settings cause errors #72111

pgimalac opened this issue Mar 5, 2025 · 5 comments
Labels
BugReport Issues describing a possible bug in the Go implementation. GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@pgimalac
Copy link

pgimalac commented Mar 5, 2025

Go version

go 1.24.0

Output of go env in your module/workspace:

go env ```shell AR='ar' CC='clang' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_ENABLED='1' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' CXX='clang++' GCCGO='gccgo' GO111MODULE='auto' GOARCH='arm64' GOARM64='v8.0' GOAUTH='netrc' GOBIN='' GOCACHE='/Users/pierre.gimalac/Library/Caches/go-build' GOCACHEPROG='' GODEBUG='' GOENV='/Users/pierre.gimalac/Library/Application Support/go/env' GOEXE='' GOEXPERIMENT='' GOFIPS140='off' GOFLAGS='' GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/zp/m8h1x16s30g3f656sxsdt7rm0000gp/T/go-build2391666502=/tmp/go-build -gno-record-gcc-switches -fno-common' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GOMOD='/Users/pierre.gimalac/go/src/github.com/DataDog/datadog-agent-dev/go.mod' GOMODCACHE='/Users/pierre.gimalac/go/pkg/mod' GONOPROXY='github.com/DataDog' GONOSUMDB='github.com/DataDog,go.ddbuild.io' GOOS='darwin' GOPATH='/Users/pierre.gimalac/go' GOPRIVATE='github.com/DataDog' GOPROXY='binaries.ddbuild.io,proxy.golang.org,direct' GOROOT='/usr/local/go' GOSUMDB='sum.golang.org' GOTELEMETRY='local' GOTELEMETRYDIR='/Users/pierre.gimalac/Library/Application Support/go/telemetry' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64' GOVCS='' GOVERSION='go1.24.0' GOWORK='/Users/pierre.gimalac/go/src/github.com/DataDog/datadog-agent-dev/go.work' PKG_CONFIG='pkg-config' ```

What did you do?

I'm working on a codebase with a go.work file containing the following directives:

go 1.23.6

toolchain go1.23.6

godebug tlskyber=0

When using Go 1.23.x, everything works fine, but whenever I use 1.24.x go errors due to tlskyber not being a recognized setting.

Using godebug default=go1.23 didn't change anything.

I know the documentation https://go.dev/doc/godebug says:

It is an error to list a godebug with an unrecognized setting.
[...]
Starting in Go 1.21, the Go toolchain treats a //go:debug directive with an unrecognized GODEBUG setting as an invalid program.

But I was not expecting it to apply to settings which have been removed in previous versions.

Since my installed toolchain is more recent than the toolchain directive, it's not automatically downgrading to 1.23.6, despite the go.work using a godebug directive specific to go 1.23.

In practice this kind of seems like a breaking change, as something working with go 1.23 completely fails with 1.24... I feel like removed setting could be ignored, or warn without actually failing.

What did you see happen?

Any go command fails with

go: error loading go.work:
go.work:9: unknown godebug "tlskyber"

What did you expect to see?

Either the toolchain should downgrade to 1.23.6, or maybe warn about the godebug directive being deprecated and ignore it (without failing).

@mateusz834
Copy link
Member

The name was changed see CL 630775

CC @FiloSottile

@seankhliao seankhliao changed the title godebug: removed settings cause errors cmd/go: errors on removed godebug setting Mar 5, 2025
@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label Mar 5, 2025
@dmitshur dmitshur added the GoCommand cmd/go label Mar 5, 2025
@pgimalac pgimalac changed the title cmd/go: errors on removed godebug setting cmd/go: removed godebug settings cause errors Mar 5, 2025
@FiloSottile
Copy link
Contributor

The name was changed see CL 630775

It wasn't quite a name change, we removed tlskyber and introduced a new different (similar and related) GODEBUG.

How to handle removed GODEBUGs is an interesting question, and indeed the current behavior doesn't feel right. Maybe it should depend on whether the GODEBUG was removed because the new behavior is now mandatory (hopefully an increasingly common occurrence) or because the new behavior was removed (this unusual case)?

@JunyangShao
Copy link
Contributor

CC @matloob

@JunyangShao JunyangShao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 6, 2025
@dmitshur
Copy link
Contributor

dmitshur commented Mar 6, 2025

I’m not familiar with the specifics of why the tlskyber godebug was added in Go 1.23 and removed in 1.24, but I’ll note that https://go.dev/doc/godebug includes:

GODEBUG settings added for compatibility will be maintained for a minimum of two years (four Go releases). Some, such as http2client and http2server, will be maintained much longer, even indefinitely.

If it were removed in Go 1.27 instead, would that have been enough to help with this, or would the same problem apply when Go 1.28 is released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants