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

runtime/debug: ReadBuildInfo gives incomplete answer in a test binary #68045

Closed
rittneje opened this issue Jun 18, 2024 · 6 comments
Closed

runtime/debug: ReadBuildInfo gives incomplete answer in a test binary #68045

rittneje opened this issue Jun 18, 2024 · 6 comments

Comments

@rittneje
Copy link

Go version

go version go1.22.4 darwin/amd64

Output of go env in your module/workspace:

GO111MODULE='auto'
GOARCH='amd64'
GOBIN=''
GOCACHE='/tmp/.gocache'
GOENV='/Users/rittneje/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/rittneje/go/pkg/mod'
GONOPROXY='<redacted>'
GONOSUMDB='<redacted>'
GOOS='darwin'
GOPATH='/Users/rittneje/go'
GOPRIVATE='git.intra.lutron.com'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/rittneje/go1.22.4'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/Users/rittneje/go1.22.4/pkg/tool/darwin_amd64'
GOVCS='<redacted>'
GOVERSION='go1.22.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD=''
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kf/kr7_s3xx0l12zbj3jrn082hmzy5gvy/T/go-build3773258374=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

//go:debug tlsrsakex=1

package foo

import (
	"runtime/debug"
	"testing"
)

func TestFoo(t *testing.T) {
	t.Fatal(debug.ReadBuildInfo())
}

What did you see happen?

go go1.22.4
true

What did you expect to see?

I expected it to report DefaultGODEBUG tlsrsakex=1.

Not sure if this is entirely a duplicate of #33976. In that case, it was reported that debug.ReadBuildInfo() returned false, which is not the case here.

@seankhliao
Copy link
Member

seankhliao commented Jun 18, 2024

I believe this is #33976: running the example in the top post gives the new output of just the go version

@seankhliao

This comment was marked as outdated.

@seankhliao seankhliao marked this as a duplicate of #33876 Jun 18, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@rittneje
Copy link
Author

@seankhliao did you link the wrong issue? #33876 seems unrelated.

@seankhliao seankhliao marked this as not a duplicate of #33876 Jun 18, 2024
@seankhliao
Copy link
Member

yes, sorry, it should have been #33976
While investigating, I did find that it wasn't recorded even for package main, I've filed that for cmd/go as #68053

@seankhliao
Copy link
Member

Duplicate of #33976

@seankhliao seankhliao marked this as a duplicate of #33976 Jun 18, 2024
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

No branches or pull requests

3 participants