Skip to content

bug: GODEBUG getting cached #47574

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

Closed
earthboundkid opened this issue Aug 6, 2021 · 1 comment
Closed

bug: GODEBUG getting cached #47574

earthboundkid opened this issue Aug 6, 2021 · 1 comment

Comments

@earthboundkid
Copy link
Contributor

earthboundkid commented Aug 6, 2021

What version of Go are you using (go version)?

go version go1.16.6 darwin/amd64

Does this issue reproduce with the latest release?

It seems to reproduce with go1.17rc2.

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/Users/adhoc/bin"
GOCACHE="/Users/adhoc/Library/Caches/go-build"
GOENV="/Users/adhoc/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/adhoc/src/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/adhoc/src/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.16.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.16.6/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/adhoc/src/exp/gotrace/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/p7/jc4qc9n94r3f6ylg0ssh1rq00000gs/T/go-build1481560794=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

main.go:

package main

import (
	"fmt"
	_ "google.golang.org/api/drive/v3"
)

func main() {
	fmt.Println("test program")
}
$ go mod init repro
$ go mod tidy
$ GODEBUG=inittrace=1 go run .
// snip init output
test program
$ GODEBUG=inittrace=1 go build .
// snip init output
$ go run .
// snip init output, again!
test program

In my quickie reproductions, it seems to be necessary to both go run and go build with GODEBUG set before doing it without to cause the issue. It also wasn't enough for the program to have no dependencies or the dependency to be rsc.io/quote. google.golang.org/api/drive/v3 was a real dependency in my program when I hit the bug. I don't know if it is necessary, but it is sufficient to trigger it. Maybe there needs to be some level of depth/size to the dependency to trigger it. Once the bug has been triggered, the debug information will stay even if you change fmt.Println("test program") to different text.

What did you expect to see?

No more init tracing when GODEBUG is unset.

What did you see instead?

Init continued to be traced until I ran go clean -cache.

@bcmills
Copy link
Contributor

bcmills commented Aug 6, 2021

Duplicate of #44625

@bcmills bcmills marked this as a duplicate of #44625 Aug 6, 2021
@bcmills bcmills closed this as completed Aug 6, 2021
@golang golang locked and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants