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/dist: check that builds are reproducible #58884

Open
rsc opened this issue Mar 6, 2023 · 15 comments
Open

cmd/dist: check that builds are reproducible #58884

rsc opened this issue Mar 6, 2023 · 15 comments
Assignees
Labels
help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Mar 6, 2023

For #24904, we have made changes to Go 1.21 to make the Go distribution builds trivially reproducible: given the source archive and a Go bootstrap toolchain that is new enough (Go 1.21 requires Go 1.17 or later), running make.bash or make.bat should produce the same binaries no matter the details of the host system, and adding the -distpack flag should produce the same archives no matter the details of the host system. Setting GOOS and GOARCH during this command cross-compiles a distribution for another system, and those should also be the same archives no matter the details of the host system. For example, building a linux/amd64 distribution should produce the same archive no matter whether the build happens on Linux, macOS, or Windows; no matter whether the host system is an x86 or an arm64; no matter where the archive is extracted; and so on.

The source archive https://swtch.com/tmp/go1.21repro4.src.tar.gz holds the source tree for a Go release claming to be go1.21repro4. The first 64 bits of its SHA256 hash are 0322e4c62dd8d770 (use openssl sha256 go1.21repro4.src.tar.gz on Unix or certutil -hashfile go1.21repro4.src.tar.gz sha256 on Windows).

If you expand that source archive and cd into go/src and run ./repro.bash (or repro.bat on Windows), it will run for quite a while building distribution archives for various systems. If you save the output and pipe it through grep distpack:, the output should match the canonical hashes here. For example:

curl -O https://swtch.com/tmp/go1.21repro4.src.tar.gz
tar xzf go1.21repro4.src.tar.gz
cd go/src
./repro.bash 2>&1 | tee ../../repro.txt  # DO NOT WRITE TO LOCAL DIRECTORY
cd ../..
grep distpack: repro.txt >distpack.txt
curl -O https://swtch.com/tmp/distpack-golden.txt
diff distpack-golden.txt distpack.txt

or on Windows:

curl -O https://swtch.com/tmp/go1.21repro4.src.tar.gz
tar xzf go1.21repro4.src.tar.gz
cd go\src
repro.bat >..\..\repro.txt  ;; DO NOT WRITE TO LOCAL DIRECTORY
cd ..\..
find "distpack:" repro.txt >distpack.txt
curl -O https://swtch.com/tmp/distpack-golden-crlf.txt
fc distpack-golden-crlf.txt distpack.txt

As noted in the comments, do not write repro.txt into the current directory, or else it will be included in the archives and affect their hashes.

You can test a single build using

cd go/src
GOOS=<goos> GOARCH=<goarch> ./make.bash -distpack

Omit GOOS and GOARCH to test the build for the local system. Note that the canonical linux-arm build also sets GOARM=6. Other variables like CC and CGO_ENABLED should be unset.

If you find a system configuration where the script runs a build successfully but produces a different archive hash than the canonical ones, please check what is different by comparing against the reference archives. Good ways to identify differences include:

  • using unzip -lv on each archive and diffing those outputs
  • using tar tzvf on each archive and diffing those outputs
  • unpacking each archive into its own directory and using diff -r

Sometimes the difference will be in your environment configuration, such as setting CC or CGO_ENABLED causing changes in the defaults baked into the toolchain. Those kinds of differences due to configuration are expected. If you find a difference that's not caused by Go configuration, please file an issue with subject cmd/distpack: reproducibility bug for GOOS/GOARCH (filling in GOOS and GOARCH) along with details of which files are different, and then mention the issue in a comment on this issue as well.

I have already tested repro.bash on darwin/amd64, darwin/arm64, linux/amd64, and windows/arm64 systems, and I've tested every possible Go release from Go 1.17 onward as bootstrap toolchain when building on darwin/amd64. Of course, there may well still be bugs in Go setups I have not thought to test, and if so we want to find them. If there are any remaining, the first person to identify each new reproducibility bug root cause wins a gopher.

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 6, 2023
@rsc rsc added this to the Go1.21 milestone Mar 6, 2023
@rsc rsc self-assigned this Mar 6, 2023
@rsc rsc added the help wanted label Mar 6, 2023
@qmuntal
Copy link
Contributor

qmuntal commented Mar 6, 2023

Tested on windows/amd64, result is OK.
Tested on windows/amd64 with GOHOSTARCH=386, result is NO OK:

fc distpack-golden-crlf.txt distpack.txt Output
$ fc distpack-golden-crlf.txt distpack.txt
Comparing files distpack-golden-crlf.txt and DISTPACK.TXT
***** distpack-golden-crlf.txt
---------- REPRO.TXT
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 484fa7a7ebd21976 go1.21repro4.darwin-amd64.tar.gz
distpack: 2c14b67b0c3b5528 v0.0.1-go1.21repro4.darwin-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.darwin-amd64.mod
***** DISTPACK.TXT
---------- REPRO.TXT
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: a0a4fe31a7ad946e go1.21repro4.darwin-amd64.tar.gz
distpack: aadbe5f10d5f345c v0.0.1-go1.21repro4.darwin-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.darwin-amd64.mod
*****

***** distpack-golden-crlf.txt
distpack: 41abee8115a736b7 v0.0.1-go1.21repro4.darwin-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: b90718ad21d985d4 go1.21repro4.darwin-arm64.tar.gz
distpack: 6f2aae6215381fb3 v0.0.1-go1.21repro4.darwin-arm64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.darwin-arm64.mod
***** DISTPACK.TXT
distpack: 41abee8115a736b7 v0.0.1-go1.21repro4.darwin-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 3139158d8fa612c7 go1.21repro4.darwin-arm64.tar.gz
distpack: 95fdc0dd94f7bdb5 v0.0.1-go1.21repro4.darwin-arm64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.darwin-arm64.mod


***** distpack-golden-crlf.txt
distpack: 30cb65f1a4248c33 v0.0.1-go1.21repro4.darwin-arm64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 298c9539c6e57d5d go1.21repro4.freebsd-386.tar.gz
distpack: e67fbaada9dfefe7 v0.0.1-go1.21repro4.freebsd-386.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.freebsd-386.mod
***** DISTPACK.TXT
distpack: 30cb65f1a4248c33 v0.0.1-go1.21repro4.darwin-arm64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 39ea3b51474d8440 go1.21repro4.freebsd-386.tar.gz
distpack: 57a12c7609d883e2 v0.0.1-go1.21repro4.freebsd-386.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.freebsd-386.mod


***** distpack-golden-crlf.txt
distpack: 7e5d92a57aaf6869 v0.0.1-go1.21repro4.freebsd-386.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 4d0d5c44e1991f94 go1.21repro4.freebsd-amd64.tar.gz
distpack: 900caa1228711fdc v0.0.1-go1.21repro4.freebsd-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.freebsd-amd64.mod
***** DISTPACK.TXT
distpack: 7e5d92a57aaf6869 v0.0.1-go1.21repro4.freebsd-386.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: b897b1f62fd87aa2 go1.21repro4.freebsd-amd64.tar.gz
distpack: cd85dd2a14c388cd v0.0.1-go1.21repro4.freebsd-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.freebsd-amd64.mod


***** distpack-golden-crlf.txt
distpack: cd488e8c0b33b769 v0.0.1-go1.21repro4.freebsd-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 611b06d29a13428a go1.21repro4.linux-386.tar.gz
distpack: 030b34aa95d62c72 v0.0.1-go1.21repro4.linux-386.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-386.mod
***** DISTPACK.TXT
distpack: cd488e8c0b33b769 v0.0.1-go1.21repro4.freebsd-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 208bce0d751cb8e2 go1.21repro4.linux-386.tar.gz
distpack: 216f2728364ad7d3 v0.0.1-go1.21repro4.linux-386.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-386.mod


***** distpack-golden-crlf.txt
distpack: b9de174fbf29e484 v0.0.1-go1.21repro4.linux-386.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: e308cdc4cd99c9bd go1.21repro4.linux-amd64.tar.gz
distpack: 1ee3de4569e69cc8 v0.0.1-go1.21repro4.linux-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-amd64.mod
***** DISTPACK.TXT
distpack: b9de174fbf29e484 v0.0.1-go1.21repro4.linux-386.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 8bea2e49ae57b5cb go1.21repro4.linux-amd64.tar.gz
distpack: 0cfdf9d1f694cc7f v0.0.1-go1.21repro4.linux-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-amd64.mod


***** distpack-golden-crlf.txt
distpack: 7e10f23c7a60fca2 v0.0.1-go1.21repro4.linux-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: f3f70b2baae60c7a go1.21repro4.linux-arm.tar.gz
distpack: ad10c0aa8d52147c v0.0.1-go1.21repro4.linux-arm.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-arm.mod
***** DISTPACK.TXT
distpack: 7e10f23c7a60fca2 v0.0.1-go1.21repro4.linux-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 1f669eb300e0a739 go1.21repro4.linux-arm.tar.gz
distpack: f5598628b25eee13 v0.0.1-go1.21repro4.linux-arm.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-arm.mod


***** distpack-golden-crlf.txt
distpack: 2d434700965a8330 v0.0.1-go1.21repro4.linux-arm.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 09a55f9780f82372 go1.21repro4.linux-arm64.tar.gz
distpack: 9e8e57659edb190a v0.0.1-go1.21repro4.linux-arm64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-arm64.mod
***** DISTPACK.TXT
distpack: 2d434700965a8330 v0.0.1-go1.21repro4.linux-arm.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: b24db37fe752c1cc go1.21repro4.linux-arm64.tar.gz
distpack: e51f3bb916054c53 v0.0.1-go1.21repro4.linux-arm64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-arm64.mod


***** distpack-golden-crlf.txt
distpack: 50558c15d16d42b9 v0.0.1-go1.21repro4.linux-arm64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 3fb5fdad90c3d351 go1.21repro4.linux-ppc64le.tar.gz
distpack: 46e9ed75a66fa46d v0.0.1-go1.21repro4.linux-ppc64le.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-ppc64le.mod
***** DISTPACK.TXT
distpack: 50558c15d16d42b9 v0.0.1-go1.21repro4.linux-arm64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: a0eecd2bbd16d1de go1.21repro4.linux-ppc64le.tar.gz
distpack: 615e12fa30e3b09e v0.0.1-go1.21repro4.linux-ppc64le.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-ppc64le.mod


***** distpack-golden-crlf.txt
distpack: 2b0ad7b76105a26f v0.0.1-go1.21repro4.linux-ppc64le.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: f1a351c65aa7fa67 go1.21repro4.linux-s390x.tar.gz
distpack: ec9728fba49e3dd5 v0.0.1-go1.21repro4.linux-s390x.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-s390x.mod
***** DISTPACK.TXT
distpack: 2b0ad7b76105a26f v0.0.1-go1.21repro4.linux-ppc64le.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 160ccb3d15901590 go1.21repro4.linux-s390x.tar.gz
distpack: 9a80ab74aaa6b5cf v0.0.1-go1.21repro4.linux-s390x.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.linux-s390x.mod


***** distpack-golden-crlf.txt
distpack: c6b273199341dbec v0.0.1-go1.21repro4.linux-s390x.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: d32952a2af5498b3 go1.21repro4.windows-386.zip
distpack: 46064d32b4bc712c v0.0.1-go1.21repro4.windows-386.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.windows-386.mod
***** DISTPACK.TXT
distpack: c6b273199341dbec v0.0.1-go1.21repro4.linux-s390x.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 5e99b0922d9a71db go1.21repro4.windows-386.zip
distpack: 451ae3b36cb55249 v0.0.1-go1.21repro4.windows-386.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.windows-386.mod


***** distpack-golden-crlf.txt
distpack: 1c26b9471ca17a48 v0.0.1-go1.21repro4.windows-386.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: e1e7a4ccb7f69e8a go1.21repro4.windows-amd64.zip
distpack: 0139e4dcdd6bae59 v0.0.1-go1.21repro4.windows-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.windows-amd64.mod
***** DISTPACK.TXT
distpack: 1c26b9471ca17a48 v0.0.1-go1.21repro4.windows-386.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: de06ef113a474306 go1.21repro4.windows-amd64.zip
distpack: aa202007886136e2 v0.0.1-go1.21repro4.windows-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.windows-amd64.mod


***** distpack-golden-crlf.txt
distpack: c1f96f09986a7bbf v0.0.1-go1.21repro4.windows-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 8bc26d12432cb7a4 go1.21repro4.windows-arm64.zip
distpack: a8561ce01182f327 v0.0.1-go1.21repro4.windows-arm64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.windows-arm64.mod
***** DISTPACK.TXT
distpack: c1f96f09986a7bbf v0.0.1-go1.21repro4.windows-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 465f62e7c7009c38 go1.21repro4.windows-arm64.zip
distpack: b97444e2b949c4e2 v0.0.1-go1.21repro4.windows-arm64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.windows-arm64.mod


***** distpack-golden-crlf.txt
distpack: e59b083dbb941f44 v0.0.1-go1.21repro4.windows-arm64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: eee042687beba643 go1.21repro4.openbsd-amd64.tar.gz
distpack: aa487ebcc53745d2 v0.0.1-go1.21repro4.openbsd-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.openbsd-amd64.mod
***** DISTPACK.TXT
distpack: e59b083dbb941f44 v0.0.1-go1.21repro4.windows-arm64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: c129a21460f2b6e0 go1.21repro4.openbsd-amd64.tar.gz
distpack: fa58d41357e2082d v0.0.1-go1.21repro4.openbsd-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.openbsd-amd64.mod


***** distpack-golden-crlf.txt
distpack: bb6fa2ecd0fad553 v0.0.1-go1.21repro4.openbsd-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 494d4b4c09a8fa39 go1.21repro4.netbsd-amd64.tar.gz
distpack: 80d5b1610733c3ee v0.0.1-go1.21repro4.netbsd-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.netbsd-amd64.mod
***** DISTPACK.TXT
distpack: bb6fa2ecd0fad553 v0.0.1-go1.21repro4.openbsd-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 8b0da82e9c9f20a4 go1.21repro4.netbsd-amd64.tar.gz
distpack: 9da91d7f114248cc v0.0.1-go1.21repro4.netbsd-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.netbsd-amd64.mod


***** distpack-golden-crlf.txt
distpack: f28ecfbefb8042e2 v0.0.1-go1.21repro4.netbsd-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 4a95f5a53e2bfab6 go1.21repro4.dragonfly-amd64.tar.gz
distpack: 05bc9f79e2ac4584 v0.0.1-go1.21repro4.dragonfly-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.dragonfly-amd64.mod
***** DISTPACK.TXT
distpack: f28ecfbefb8042e2 v0.0.1-go1.21repro4.netbsd-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 5654b9ad89098e92 go1.21repro4.dragonfly-amd64.tar.gz
distpack: 0b14b0fa5ae63406 v0.0.1-go1.21repro4.dragonfly-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.dragonfly-amd64.mod


***** distpack-golden-crlf.txt
distpack: 89202c8aec5fdcd0 v0.0.1-go1.21repro4.dragonfly-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: 4b25fabe7d974d3c go1.21repro4.illumos-amd64.tar.gz
distpack: b31ebb742fa0cfa6 v0.0.1-go1.21repro4.illumos-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.illumos-amd64.mod
***** DISTPACK.TXT
distpack: 89202c8aec5fdcd0 v0.0.1-go1.21repro4.dragonfly-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: 39dfe0c3836b6fc5 go1.21repro4.illumos-amd64.tar.gz
distpack: df9a400456559829 v0.0.1-go1.21repro4.illumos-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.illumos-amd64.mod


***** distpack-golden-crlf.txt
distpack: b7051e86ce944cff v0.0.1-go1.21repro4.illumos-amd64.info
distpack: 0322e4c62dd8d770 go1.21repro4.src.tar.gz
distpack: b676dafe53cffcca go1.21repro4.solaris-amd64.tar.gz
distpack: b3b0f15f262c4c37 v0.0.1-go1.21repro4.solaris-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.solaris-amd64.mod
***** DISTPACK.TXT
distpack: b7051e86ce944cff v0.0.1-go1.21repro4.illumos-amd64.info
distpack: 88b6cf652f99262a go1.21repro4.src.tar.gz
distpack: e5e501df7028b5bf go1.21repro4.solaris-amd64.tar.gz
distpack: afdd72a0ef6114d1 v0.0.1-go1.21repro4.solaris-amd64.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21repro4.solaris-amd64.mod


Still haven't investigated which are the offending files, will do that during this week and submit an issue if it is really a reproducibility bug (rather than something wrong on my side).

@rsc
Copy link
Contributor Author

rsc commented Mar 6, 2023

Thanks @qmuntal. The go1.21repro4.src.tar.gz came out different. Usually that means either (1) generated files got generated differently, or (2) extra files were included unexpectedly, either because they existed locally or because the filtering in distpack needs revision. Diffing the outputs of tar tzvf on both source archives should make it clear.

Edit: There shouldn't be generated files in the source archive so it should be (2).

@qmuntal
Copy link
Contributor

qmuntal commented Mar 7, 2023

I've tried again in a clean environment and it didn't have me any diff. The first time I ran GOHOSTARCH=386 repro.bat >..\..\repro.txt was just after running the whole test without GOHOSTARCH, which left some dangling autogenerated files that leaked to the GOHOSTARCH=386 test:

fc golden.txt solaris.txt Output
Comparing files golden.txt and SOLARIS.TXT
***** golden.txt
-rw-r--r--  0 0      0          50 Mar 05 01:00 go/api/next/57708.txt
-rw-r--r--  0 0      0          15 Mar 05 01:00 go/codereview.cfg
***** SOLARIS.TXT
-rw-r--r--  0 0      0          50 Mar 05 01:00 go/api/next/57708.txt
-rwxr-xr-x  0 0      0    15696487 Mar 05 01:00 go/bin/go
-rwxr-xr-x  0 0      0     3341227 Mar 05 01:00 go/bin/gofmt
-rw-r--r--  0 0      0          15 Mar 05 01:00 go/codereview.cfg
*****

***** golden.txt
-rw-r--r-- 0 0 0 1151 Mar 05 01:00 go/misc/wasm/wasm_exec_node.js
-rw-r--r-- 0 0 0 553 Mar 05 01:00 go/src/Make.dist
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 1151 Mar 05 01:00 go/misc/wasm/wasm_exec_node.js
-rw-r--r-- 0 0 0 572 Mar 05 01:00 go/pkg/include/asm_amd64.h
-rw-r--r-- 0 0 0 1023 Mar 05 01:00 go/pkg/include/asm_ppc64x.h
-rw-r--r-- 0 0 0 2612 Mar 05 01:00 go/pkg/include/funcdata.h
-rw-r--r-- 0 0 0 1501 Mar 05 01:00 go/pkg/include/textflag.h
-rwxr-xr-x 0 0 0 2808673 Mar 05 01:00 go/pkg/tool/solaris_amd64/addr2line
-rwxr-xr-x 0 0 0 4919960 Mar 05 01:00 go/pkg/tool/solaris_amd64/asm
-rwxr-xr-x 0 0 0 2509245 Mar 05 01:00 go/pkg/tool/solaris_amd64/buildid
-rwxr-xr-x 0 0 0 4668260 Mar 05 01:00 go/pkg/tool/solaris_amd64/cgo
-rwxr-xr-x 0 0 0 23860203 Mar 05 01:00 go/pkg/tool/solaris_amd64/compile
-rwxr-xr-x 0 0 0 3199656 Mar 05 01:00 go/pkg/tool/solaris_amd64/covdata
-rwxr-xr-x 0 0 0 4887336 Mar 05 01:00 go/pkg/tool/solaris_amd64/cover
-rwxr-xr-x 0 0 0 3963196 Mar 05 01:00 go/pkg/tool/solaris_amd64/doc
-rwxr-xr-x 0 0 0 3316297 Mar 05 01:00 go/pkg/tool/solaris_amd64/fix
-rwxr-xr-x 0 0 0 6803058 Mar 05 01:00 go/pkg/tool/solaris_amd64/link
-rwxr-xr-x 0 0 0 2732655 Mar 05 01:00 go/pkg/tool/solaris_amd64/nm
-rwxr-xr-x 0 0 0 4135767 Mar 05 01:00 go/pkg/tool/solaris_amd64/objdump
-rwxr-xr-x 0 0 0 2218294 Mar 05 01:00 go/pkg/tool/solaris_amd64/pack
-rwxr-xr-x 0 0 0 14445883 Mar 05 01:00 go/pkg/tool/solaris_amd64/pprof
-rwxr-xr-x 0 0 0 2579143 Mar 05 01:00 go/pkg/tool/solaris_amd64/test2json
-rwxr-xr-x 0 0 0 13712044 Mar 05 01:00 go/pkg/tool/solaris_amd64/trace
-rwxr-xr-x 0 0 0 7596898 Mar 05 01:00 go/pkg/tool/solaris_amd64/vet
-rw-r--r-- 0 0 0 553 Mar 05 01:00 go/src/Make.dist


***** golden.txt
-rw-r--r-- 0 0 0 3052 Mar 05 01:00 go/src/cmd/cgo/util.go
-rw-r--r-- 0 0 0 7076 Mar 05 01:00 go/src/cmd/compile/README.md
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 3052 Mar 05 01:00 go/src/cmd/cgo/util.go
-rw-r--r-- 0 0 0 444 Mar 05 01:00 go/src/cmd/cgo/zdefaultcc.go
-rw-r--r-- 0 0 0 7076 Mar 05 01:00 go/src/cmd/compile/README.md


***** golden.txt
-rw-r--r-- 0 0 0 17083 Mar 05 01:00 go/src/cmd/go/internal/cfg/cfg.go
-rw-r--r-- 0 0 0 11226 Mar 05 01:00 go/src/cmd/go/internal/clean/clean.go
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 17083 Mar 05 01:00 go/src/cmd/go/internal/cfg/cfg.go
-rw-r--r-- 0 0 0 443 Mar 05 01:00 go/src/cmd/go/internal/cfg/zdefaultcc.go
-rw-r--r-- 0 0 0 1194 Mar 05 01:00 go/src/cmd/go/internal/cfg/zosarch.go
-rw-r--r-- 0 0 0 11226 Mar 05 01:00 go/src/cmd/go/internal/clean/clean.go


***** golden.txt
-rw-r--r-- 0 0 0 961 Mar 05 01:00 go/src/cmd/internal/objabi/util.go
-rw-r--r-- 0 0 0 10767 Mar 05 01:00 go/src/cmd/internal/objfile/disasm.go
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 961 Mar 05 01:00 go/src/cmd/internal/objabi/util.go
-rw-r--r-- 0 0 0 64 Mar 05 01:00 go/src/cmd/internal/objabi/zbootstrap.go
-rw-r--r-- 0 0 0 10767 Mar 05 01:00 go/src/cmd/internal/objfile/disasm.go


***** golden.txt
-rw-r--r-- 0 0 0 80 Mar 05 01:00 go/src/debug/plan9obj/testdata/hello.c
-rw-r--r-- 0 0 0 13649 Mar 05 01:00 go/src/embed/embed.go
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 80 Mar 05 01:00 go/src/debug/plan9obj/testdata/hello.c
-rw-r--r-- 0 0 0 0 Mar 05 01:00 go/src/distpack.txt
-rw-r--r-- 0 0 0 13649 Mar 05 01:00 go/src/embed/embed.go


***** golden.txt
-rw-r--r-- 0 0 0 10 Mar 05 01:00 go/src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go
-rw-r--r-- 0 0 0 3572 Mar 05 01:00 go/src/go/constant/example_test.go
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 10 Mar 05 01:00 go/src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go
-rw-r--r-- 0 0 0 1090 Mar 05 01:00 go/src/go/build/zcgo.go
-rw-r--r-- 0 0 0 3572 Mar 05 01:00 go/src/go/constant/example_test.go


***** golden.txt
-rw-r--r-- 0 0 0 5562 Mar 05 01:00 go/src/internal/buildcfg/exp.go
-rw-r--r-- 0 0 0 3987 Mar 05 01:00 go/src/internal/bytealg/bytealg.go
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 5562 Mar 05 01:00 go/src/internal/buildcfg/exp.go
-rw-r--r-- 0 0 0 463 Mar 05 01:00 go/src/internal/buildcfg/zbootstrap.go
-rw-r--r-- 0 0 0 3987 Mar 05 01:00 go/src/internal/bytealg/bytealg.go


***** golden.txt
-rw-r--r-- 0 0 0 283 Mar 05 01:00 go/src/runtime/internal/sys/sys.go
-rw-r--r-- 0 0 0 861 Mar 05 01:00 go/src/runtime/internal/syscall/asm_linux_386.s
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 283 Mar 05 01:00 go/src/runtime/internal/sys/sys.go
-rw-r--r-- 0 0 0 61 Mar 05 01:00 go/src/runtime/internal/sys/zversion.go
-rw-r--r-- 0 0 0 861 Mar 05 01:00 go/src/runtime/internal/syscall/asm_linux_386.s


***** golden.txt
-rw-r--r-- 0 0 0 3040 Mar 05 01:00 go/src/time/tzdata/tzdata.go
-rw-r--r-- 0 0 0 2515 Mar 05 01:00 go/src/time/tzdata_test.go
***** SOLARIS.TXT
-rw-r--r-- 0 0 0 3040 Mar 05 01:00 go/src/time/tzdata/tzdata.go
-rw-r--r-- 0 0 0 1336131 Mar 05 01:00 go/src/time/tzdata/zzipdata.go
-rw-r--r-- 0 0 0 2515 Mar 05 01:00 go/src/time/tzdata_test.go


@rsc
Copy link
Contributor Author

rsc commented Mar 7, 2023

Thanks @qmuntal. What is golden.txt and solaris.txt in the fc output? The golden.txt looks like maybe the listing for go1.21repro4.src.tar.gz (the source distribution) while the solaris.txt looks like maybe the listing for go1.21repro4.solaris-amd64.tar.gz (the solaris binary distribution). I expect those would be different.

@qmuntal
Copy link
Contributor

qmuntal commented Mar 8, 2023

What is golden.txt and solaris.txt in the fc output? The golden.txt looks like maybe the listing for go1.21repro4.src.tar.gz (the source distribution) while the solaris.txt looks like maybe the listing for go1.21repro4.solaris-amd64.tar.gz (the solaris binary distribution

That's the right file name mapping. Do you need any other test?

@rsc
Copy link
Contributor Author

rsc commented Mar 13, 2023

@qmuntal, if you can reproduce the mismatch, then the next step would be to diff the content of your generated source archive (../pkg/distpack/go1.21repro4.src.tar.gz) against the original https://swtch.com/tmp/go1.21repro4.src.tar.gz that you started with. Something is different between those. Don't worry about binary archives like the solaris distribution until the source archive comes out right: if the source is different, the binaries will be different. The difference in the source is the root cause. Thanks!

@gopherbot
Copy link

Change https://go.dev/cl/483695 mentions this issue: cmd/dist: rework generated cgo-support logic

gopherbot pushed a commit that referenced this issue Apr 20, 2023
During bootstrapping, cmd/dist writes a file indicating which
GOOS/GOARCH combinations are valid, and which support cgo-enabled
builds. That information previously went into the go/build package,
but today it fits in more naturally in the internal/platform package
(which already has a number of functions indicating feature support
for GOOS/GOARCH combinations).

Moreover, as of CL 450739 the cmd/go logic for determining whether to
use cgo is somewhat more nuanced than the go/build logic: cmd/go
checks for the presence of a C compiler, whereas go/build does not
(mostly because it determines its configuration at package-init time,
and checking $PATH for a C compiler is somewhat expensive).

To simplify this situation, this change:

	- consolidates the “cgo supported” check in internal/platform
	  (alongside many other platform-support checks) instead of making
	  it a one-off in go/build,

	- and updates a couple of tests to use testenv.HasCGO instead of
	  build.Default.CgoEnabled to decide whether to test a cgo-specific
	  behavior.

For #58884.
For #59500.

Change-Id: I0bb2502dba4545a3d98c9e915727382ce536a0f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/483695
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
@bcmills
Copy link
Contributor

bcmills commented Jun 22, 2023

@qmuntal, did you have any luck tracking down the differences?

There was one recent reproducibility fix in https://go.dev/cl/502755, but it's not clear to me that that would account for your observations.

@qmuntal
Copy link
Contributor

qmuntal commented Jun 27, 2023

@rsc @bcmills sorry for late response, I forgot about this issue. As I said in my previous comment, I ran the GOHOSTARCH=386 repro.bat >..\..\repro.txt test using the same source folder I previously used to test just repro.bat >..\..\repro.txt. The first run autogenerated a couple of files, which where inherited by the second run (aka GOHOSTARCH=386), therefore the second run was already "corrupted" before even running repro.bat. This probably invalidates the experiment. If I run GOHOSTARCH=386 repro.bat >..\..\repro.txt on a clean env, then the checksums matches.

@gopherbot
Copy link

Change https://go.dev/cl/513975 mentions this issue: cmd/gorebuild: add tool to reproduce posted Go binaries

@gopherbot
Copy link

Change https://go.dev/cl/513700 mentions this issue: _content: add rebuild page with reproducible build information

@gopherbot
Copy link

Change https://go.dev/cl/514415 mentions this issue: [release-branch.go1.4] all: fixes for modern compilers

gopherbot pushed a commit that referenced this issue Jul 31, 2023
This makes make.bash pass without any warnings for

	$ clang --version
	Ubuntu clang version 14.0.0-1ubuntu1.1
	Target: x86_64-pc-linux-gnu
	Thread model: posix
	InstalledDir: /usr/bin
	$ gcc --version
	gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
	Copyright (C) 2021 Free Software Foundation, Inc.
	This is free software; see the source for copying conditions.  There is NO
	warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
	$

The change in src/liblink/asm5.c silences a warning building
on modern macOS, which doesn't actually produce a working
toolchain anyway, but it still seems worth silencing the warning.

These warnings surface now in the reproducible builds reports
(for example https://gorebuild.storage.googleapis.com/gorebuild.html,
click on "Bootstrap go1.4"). I'd rather not look at them anymore.

For #58884.

Change-Id: I689c862ad360ca23153438f9e143a1cb840730e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/514415
TryBot-Bypass: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
gopherbot pushed a commit to golang/build that referenced this issue Aug 2, 2023
This command rebuilds or verifies all the artifacts posted on
go.dev/dl for the latest supported releases (the last patch of
the last two major releases, plus the most recent release candidate
if we're approaching a new release).

It is meant to be run by the Go team to update a status page
that can be linked from reproducible-builds.org, but it is also
meant to be run by anyone who wants to "trust but verify" the
status page themselves.

For golang/go#57120.
For golang/go#58884.

Change-Id: I80a70275c1821a66b6219d24f29c2d11bfe464a8
Reviewed-on: https://go-review.googlesource.com/c/build/+/513975
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
@gopherbot
Copy link

Change https://go.dev/cl/515415 mentions this issue: cmd/gorebuild: check uid/gid/uname/gname/mtime fields in tgz files

gopherbot pushed a commit to golang/build that referenced this issue Aug 2, 2023
Issue 61513 is resolved so this path can be turned on now.
Confirmed to still pass now that go1.21rc4 is out. It was
the first release built using improvements from CL 512437.

For golang/go#57120.
For golang/go#58884.
For golang/go#61513.

Change-Id: Ie39765f8c7ba514dea2bfccf7c8ef8acc5822a22
Reviewed-on: https://go-review.googlesource.com/c/build/+/515415
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Auto-Submit: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
gopherbot pushed a commit to golang/website that referenced this issue Aug 3, 2023
We now have a command to reproduce Go builds posted on go.dev/dl.
Add a dashboard that people can check to see its results.
We should be able to link to this page from https://reproducible-builds.org/citests/.

For golang/go#57120.
For golang/go#58884.

Change-Id: I0bd1f9c26a9a003aa1f301125083195fdeb048b4
Reviewed-on: https://go-review.googlesource.com/c/website/+/513700
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
@gopherbot
Copy link

Change https://go.dev/cl/515455 mentions this issue: cmd/golangorg: fix CachedURL, update rebuild template

gopherbot pushed a commit to golang/website that referenced this issue Aug 3, 2023
The "not modified" response code is 304, not 206. Oops.
Use named constants to avoid similar mistakes in the future.

Also update rebuild template to show more version information.

For golang/go#57120.
For golang/go#58884.

Change-Id: I2c3ddf25cede0b5a853fa971226463a997f168c7
Reviewed-on: https://go-review.googlesource.com/c/website/+/515455
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
@gopherbot gopherbot modified the milestones: Go1.21, Go1.22 Aug 8, 2023
@gopherbot
Copy link

Change https://go.dev/cl/556075 mentions this issue: cmd/rebuild: report files missing from posted archive better

gopherbot pushed a commit to golang/build that referenced this issue Jan 19, 2024
The "missing from posted archive" case was checking the wrong variable
and could never trigger. Fortunately, it's fairly harmless, as missing
files would still be caught by gorebuild thanks to check hitting a nil
pointer dereference trying to compare the missing file.

Check the right variable to fix the panic, and print the intended text.

For golang/go#57120.
For golang/go#58884.

Change-Id: I4560a9cc6c53bca37283c004826d728e175a1ff1
Reviewed-on: https://go-review.googlesource.com/c/build/+/556075
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
@gopherbot gopherbot modified the milestones: Go1.22, Go1.23 Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants