-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
I was using GODEBUG=inittrace=1 to get some quick stats on the init cost of some packages via go test, and I noticed that even after I unset the variable, its output was still around - presumably via Go's cache.
As a repro:
$ go version
go version devel go1.19-c6d9b38dd8 Wed Mar 9 06:51:37 2022 +0000 linux/amd64
$ cd $(go env GOROOT)/src/encoding/json
$ GODEBUG=inittrace=1 go test -c -vet=off 2>&1 | wc -l
625
$ go test -c -vet=off 2>&1 | wc -l
488
It's unclear why the number of lines diminishes, but they're all still inittrace output.
go build does not show this bug, so presumably the bug is with the test cache:
$ GODEBUG=inittrace=1 go build 2>&1 | wc -l
137
$ go build 2>&1 | wc -l
0
Perhaps Go's cache should be taught to include GODEBUG as part of cache key hashes.
Metadata
Metadata
Assignees
Labels
GoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.