-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
What version of Go are you using (go version)?
~/go-review/src$ go version go version devel go1.20-fe7d3a0df5 Mon Nov 21 19:48:00 2022 -0500 linux/amd64 ~/go-review/src$ mote run gcc --version # Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote363460504/bcmills-aix-ppc64-0.stdout"... gcc (GCC) 8.4.0
What did you do?
Ran go list -export -json=BuildID runtime/cgo before and after clearing the Go build cache.
~/go-review/src/cmd/dist$ mote run ./go/bin/go list -export -json=BuildID runtime/cgo
# Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote3714306807/bcmills-aix-ppc64-0.stdout"...
{
"BuildID": "ogJ-10b1BIf2OIMT5g5K/4jyhoIAusu99uwtt-kuy"
}
# Wrote results from "bcmills-aix-ppc64-0" to "/tmp/gomote3714306807/bcmills-aix-ppc64-0.stdout".
~/go-review/src/cmd/dist$ mote run ./go/bin/go clean -cache
# Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote225234382/bcmills-aix-ppc64-0.stdout"...
# Wrote results from "bcmills-aix-ppc64-0" to "/tmp/gomote225234382/bcmills-aix-ppc64-0.stdout".
~/go-review/src/cmd/dist$ mote run ./go/bin/go list -export -json=BuildID runtime/cgo
# Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote3775804530/bcmills-aix-ppc64-0.stdout"...
{
"BuildID": "ogJ-10b1BIf2OIMT5g5K/7hDfzCuKuu_KQFpt3mXk"
}
# Wrote results from "bcmills-aix-ppc64-0" to "/tmp/gomote3775804530/bcmills-aix-ppc64-0.stdout".
Note that the first part of the build ID (describing the inputs to the build) is identical; however, the second part (describing the output of the compiler) is not.
What did you expect to see?
Because the runtime/cgo package is within GOROOT, its build should always be reproducible (see #50183), and so each fresh rebuild of the package should result in the same BuildID, and any package in GOROOT that uses it (such as net) should also have a reproducible build.
Setting CGO_ENABLED=0 does result in a reproducible build for the net package on the aix-ppc64 builder:
~/go-review/src/cmd/dist$ gomote run -e 'CGO_ENABLED=0' bcmills-aix-ppc64-0 ./go/bin/go list -export -json=BuildID net
# Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote3253411634/bcmills-aix-ppc64-0.stdout"...
{
"BuildID": "_EPUfZVuKfZHEmEBc02h/7QWWxSr9bui2XajXR10N"
}
# Wrote results from "bcmills-aix-ppc64-0" to "/tmp/gomote3253411634/bcmills-aix-ppc64-0.stdout".
~/go-review/src/cmd/dist$ gomote run -e 'CGO_ENABLED=0' bcmills-aix-ppc64-0 ./go/bin/go clean -cache
# Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote3293010067/bcmills-aix-ppc64-0.stdout"...
# Wrote results from "bcmills-aix-ppc64-0" to "/tmp/gomote3293010067/bcmills-aix-ppc64-0.stdout".
~/go-review/src/cmd/dist$ gomote run -e 'CGO_ENABLED=0' bcmills-aix-ppc64-0 ./go/bin/go list -export -json=BuildID net
# Streaming results from "bcmills-aix-ppc64-0" to "/tmp/gomote1809113884/bcmills-aix-ppc64-0.stdout"...
{
"BuildID": "_EPUfZVuKfZHEmEBc02h/7QWWxSr9bui2XajXR10N"
}
# Wrote results from "bcmills-aix-ppc64-0" to "/tmp/gomote1809113884/bcmills-aix-ppc64-0.stdout".
And on linux/amd64 (and presumably other platforms), we do see reproducible builds for runtime/cgo even with cgo enabled:
~/go-review/src$ go list -export -json=BuildID runtime/cgo
{
"BuildID": "WhJYk_P3Gk345k1UDp2X/iflidhKq7bnW0242XAPO"
}
~/go-review/src$ go clean -cache
~/go-review/src$ go list -export -json=BuildID runtime/cgo
{
"BuildID": "WhJYk_P3Gk345k1UDp2X/iflidhKq7bnW0242XAPO"
}
What did you see instead?
With cgo enabled, the BuildID for the runtime/cgo and net packages on the aix-ppc64 builder differ each time the package is rebuilt from a clean cache.
(attn @golang/aix; CC @ianlancetaylor in case he has any tips on cgo reproducibility)