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

x/build/cmd/gorebuild: expects go1.21.1.linux-armv6l.tar.gz and v0.0.1-go1.21.1.linux-arm.zip to be rebuildable without explicitly setting GOARM=6 #62514

Closed
dmitshur opened this issue Sep 7, 2023 · 1 comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Sep 7, 2023

As visible at https://go.dev/rebuild, gorebuild has uncovered the possibility of non-reproducibility on go1.21.1.linux-armv6l.tar.gz (and its module zip version, v0.0.1-go1.21.1.linux-arm.zip) in the generated zbootstrap.go file:

00:18:56 start go1.21.1.linux-armv6l.tar.gz
00:18:57 running ./make.bash env=[GOOS=linux GOARCH=arm] args=[-distpack]
GOROOT=/tmp/gorebuild-2727667220/repro-go1.21.1-linux-arm
GOROOT_BOOTSTRAP=/tmp/gorebuild-2727667220/bootstrap-go1.17
00:23:28 ./make.bash completed:
[...]
00:23:30 downloaded https://go.dev/dl/go1.21.1.linux-armv6l.tar.gz
[...]
00:23:40 go/src/internal/buildcfg/zbootstrap.go: rebuilt content = 9b9b164a90356243047a503d31db564a28b1755bd29abae578e41de887f51411, posted = 6844cf01f46966ecda7d5d1536707cd8cba66633cf2855130aedd2ced023d4a9
00:23:41 FAIL: rebuilt SHA256 f3c90445e7966d887bb7fdbd59b24f1e6821458f28022558ce723ab4a7ad8ff5 does not match public download SHA256 f3716a43f59ae69999841d6007b42c9e286e8d8ce470656fb3e70d7be2d7ca85
Full Log
00:18:56 start go1.21.1.linux-armv6l.tar.gz
00:18:57 running ./make.bash env=[GOOS=linux GOARCH=arm] args=[-distpack]
GOROOT=/tmp/gorebuild-2727667220/repro-go1.21.1-linux-arm
GOROOT_BOOTSTRAP=/tmp/gorebuild-2727667220/bootstrap-go1.17
00:23:28 ./make.bash completed:
Building Go cmd/dist using /tmp/gorebuild-2727667220/bootstrap-go1.17. (go1.17.13 linux/amd64)
Building Go toolchain1 using /tmp/gorebuild-2727667220/bootstrap-go1.17.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building commands for host, linux/amd64.
Building packages and commands for target, linux/arm.
Packaging archives for linux/arm.
distpack: bfa36bf75e9a1e9c go1.21.1.src.tar.gz
distpack: f3c90445e7966d88 go1.21.1.linux-arm.tar.gz
distpack: 14702966dcf6613c v0.0.1-go1.21.1.linux-arm.zip
distpack: 58528cce1848ddf4 v0.0.1-go1.21.1.linux-arm.mod
distpack: 41f8c9361bcc6925 v0.0.1-go1.21.1.linux-arm.info
---
Installed Go for linux/arm in /tmp/gorebuild-2727667220/repro-go1.21.1-linux-arm
Installed commands in /tmp/gorebuild-2727667220/repro-go1.21.1-linux-arm/bin
*** You need to add /tmp/gorebuild-2727667220/repro-go1.21.1-linux-arm/bin to your PATH.
00:23:30 downloaded https://go.dev/dl/go1.21.1.linux-armv6l.tar.gz
00:23:40 go/bin/go: rebuilt size = 11956292, posted = 12022318
00:23:40 go/bin/go: rebuilt content = c0b6ff4dc211947872d6d5aa8b98485760448c348ea155c85cdbe85f8653141a, posted = d7cc39f4eb2c90ef9906a6bc2412c89be9f3bd4211f20cee56b46bc06c9582e7
00:23:40 go/bin/gofmt: rebuilt size = 2506293, posted = 2506753
00:23:40 go/bin/gofmt: rebuilt content = b18d6b5292c9037fbb2a403d59131d31b32287ff192b95f591f668a2d266a56a, posted = a465d33cf04bd8ae310c97704b97f9665ae3315177be1332c5333aa7c0674a91
00:23:40 go/pkg/tool/linux_arm/addr2line: rebuilt size = 2083910, posted = 2084294
00:23:40 go/pkg/tool/linux_arm/addr2line: rebuilt content = cf02cf9290fe5e61b5cd6779ec2c22d11df887ffdcccaf2f13c04ec0350052f2, posted = b8c92c2ed2542dd48aa2f0152caaaa0886450b76f6eba8a102c822513e27676f
00:23:40 go/pkg/tool/linux_arm/asm: rebuilt size = 3766986, posted = 3832906
00:23:40 go/pkg/tool/linux_arm/asm: rebuilt content = 4b56952139f41594efa0f34450a9f2806303b45bb21af2667268e63d0657af4d, posted = 277b6fa2d3004660aaccd1f56d4ca96259d2b569c3a091a5e5f35fd8ceb365e9
00:23:40 go/pkg/tool/linux_arm/buildid: rebuilt size = 1875363, posted = 1875709
00:23:40 go/pkg/tool/linux_arm/buildid: rebuilt content = 3a66930e1c6c70fb4ce8d0d3e8aa7bb2c8fb8db2b42d8ea782386050cb09a87c, posted = 64d49a7a6007ceb52551b2d16f0b6345968b6121164d56f2fa731304adda0cd3
00:23:40 go/pkg/tool/linux_arm/cgo: rebuilt size = 3539338, posted = 3539760
00:23:40 go/pkg/tool/linux_arm/cgo: rebuilt content = 10762bb4702b7b75022ff8dec4ef631e88e763475dc26117053ee3553bf1b6e3, posted = 1e4c747e61d5656c8cdcff87c1ccc410ec95038e7fb22fdfde3c9fe53fbbba43
00:23:40 go/pkg/tool/linux_arm/compile: rebuilt size = 18063143, posted = 18194803
00:23:40 go/pkg/tool/linux_arm/compile: rebuilt content = 49c4bd8c84348cad3e4ab125755c0040eb48358551270070c03ca0203c3df6a6, posted = b56d6e03185cf956c4dacfd9c09dd3ba449d8519f3932ed9d74e27402407af7f
00:23:40 go/pkg/tool/linux_arm/covdata: rebuilt size = 2431167, posted = 2431589
00:23:40 go/pkg/tool/linux_arm/covdata: rebuilt content = dce482e729edfb9f7235cc99a816ddf62aa22a290f3a17c74bc6e581adfc74c0, posted = 0ff96f67260b0141336ab5707977c743cb492d961770e6922579d88bbc561856
00:23:40 go/pkg/tool/linux_arm/cover: rebuilt size = 3929980, posted = 3930440
00:23:40 go/pkg/tool/linux_arm/cover: rebuilt content = d2849fc6be030b0d227eb7b3d58e17155eddf03dd7462990c62f822e4bcc2c46, posted = 5769835c71e6a80f81a4e14e89ba40cda61a0d7c3094a0b7d8205256cb338308
00:23:40 go/pkg/tool/linux_arm/doc: rebuilt size = 2922278, posted = 2922738
00:23:40 go/pkg/tool/linux_arm/doc: rebuilt content = eab6f74f92898a8a8dd9c8b6f04cb5d970a630548b31bdc92f637a9e02f442bc, posted = 27c1c441b0301e193cc208806bb901d5d38b86fe78359baf12c717b0042563a3
00:23:40 go/pkg/tool/linux_arm/fix: rebuilt size = 2436294, posted = 2436716
00:23:40 go/pkg/tool/linux_arm/fix: rebuilt content = 53ba4ed94f0e910e3dcfb230cbc2a58162837b124a513cfa7a23dfce3d3952c9, posted = 4ddf9b4c963d20edc4cf1cd764700f99b2904db88636ae84dfcafdad52599ef2
00:23:40 go/pkg/tool/linux_arm/link: rebuilt size = 5102133, posted = 5102517
00:23:40 go/pkg/tool/linux_arm/link: rebuilt content = 7e0b4e254ed21d3b84d9ccb6760c185e5de1b70f42a5c2d6d67253023e4672e3, posted = dcf13b507be9e623fc942041d2ca89ab2222cd1a65a0e9ad4efbe414a579e1e5
00:23:40 go/pkg/tool/linux_arm/nm: rebuilt size = 1950548, posted = 1950894
00:23:40 go/pkg/tool/linux_arm/nm: rebuilt content = 1997711186b8209992b1dd6049f1d85ec75362a59664c6b555a694251544f818, posted = f9516e07573a836c306c26e323177c8c5eb3974ea04b248c86e42331bdcc669c
00:23:40 go/pkg/tool/linux_arm/objdump: rebuilt size = 3051021, posted = 3051405
00:23:40 go/pkg/tool/linux_arm/objdump: rebuilt content = 24bf6f1df2e1eb6648d2284fbfe359d29a2b832c628c15af6b3bcc2f866261bd, posted = 5380daaeb3178e2e82613e4fd2e13db0b424c17b4328925fc069333c9cdc81b8
00:23:40 go/pkg/tool/linux_arm/pack: rebuilt size = 1665086, posted = 1665470
00:23:40 go/pkg/tool/linux_arm/pack: rebuilt content = 1c2fcf101b606269b4c3d726128fc8ce43bbd5c0888b45fc47dd3e0ab94d1792, posted = 98d57ff217e9e45952f75439738fa48227992184fadb63075348eaa19f3db2d8
00:23:40 go/pkg/tool/linux_arm/pprof: rebuilt size = 10801680, posted = 10802208
00:23:40 go/pkg/tool/linux_arm/pprof: rebuilt content = ae13653ede82d0c7aaab0e13dc4987e12c650cd1fc6b198b221c1b87a40e5239, posted = 2ccda95f32a3ed42698d05e46f8bc3384240e5e0ae1a20642cec018577216776
00:23:40 go/pkg/tool/linux_arm/test2json: rebuilt size = 1948591, posted = 1948937
00:23:40 go/pkg/tool/linux_arm/test2json: rebuilt content = 9866baa2fe48f8d13ae3fba96eb1feda2fae765e6deefa2c6da290f8e97257df, posted = c1582367ee7bac1e4c7f7199404d2ef69190d81f1b9e1530411194b31cec35b7
00:23:40 go/pkg/tool/linux_arm/trace: rebuilt size = 10943322, posted = 11009386
00:23:40 go/pkg/tool/linux_arm/trace: rebuilt content = ce388ac9b2ccd9c9eafc9e5202b700ed7c76d21923a434d880b7651f60f0d744, posted = 39645b29840a73382f93d40f8bb694b8bda00d52f51462483e6855b3ca7aa65b
00:23:40 go/pkg/tool/linux_arm/vet: rebuilt size = 5640752, posted = 5641250
00:23:40 go/pkg/tool/linux_arm/vet: rebuilt content = 6e6395a134f78167e87eb87d49b49f3cc87c4a332895161c6a7a45e2dbec132a, posted = 62736f5591f7ac159b37eb4d063e9e5c620b30cda44cd907c2b21401d71047d9
00:23:40 go/src/internal/buildcfg/zbootstrap.go: rebuilt content = 9b9b164a90356243047a503d31db564a28b1755bd29abae578e41de887f51411, posted = 6844cf01f46966ecda7d5d1536707cd8cba66633cf2855130aedd2ced023d4a9
00:23:41 FAIL: rebuilt SHA256 f3c90445e7966d887bb7fdbd59b24f1e6821458f28022558ce723ab4a7ad8ff5 does not match public download SHA256 f3716a43f59ae69999841d6007b42c9e286e8d8ce470656fb3e70d7be2d7ca85

I can reproduce the rebuild content with sha256 of "9b9b164a90356243047a503d31db564a28b1755bd29abae578e41de887f51411" locally with:

src $ git checkout go1.21.1
src $ GOOS=linux GOARCH=arm ./make.bash -distpack
# extract ../pkg/distpack/go1.21.1.linux-arm.tar.gz to ../pkg/distpack/go
src $ shasum -a 256 ../pkg/distpack/go/src/internal/buildcfg/zbootstrap.go 
9b9b164a90356243047a503d31db564a28b1755bd29abae578e41de887f51411  ../pkg/distpack/go/src/internal/buildcfg/zbootstrap.go

The diff with the published zbootstrap.go in go1.21.1.linux-armv6l.tar.gz is:

$ diff -U5 $HOME/gotip/pkg/distpack/go/src/internal/buildcfg/zbootstrap.go $HOME/Downloads/go1.21.1.linux-armv6l/src/internal/buildcfg/zbootstrap.go
--- $HOME/gotip/pkg/distpack/go/src/internal/buildcfg/zbootstrap.go	2023-08-31 18:36:09
+++ $HOME/Downloads/go1.21.1.linux-armv6l/src/internal/buildcfg/zbootstrap.go	2023-08-31 18:36:09
@@ -4,11 +4,11 @@
 
 import "runtime"
 
 const defaultGO386 = `sse2`
 const defaultGOAMD64 = `v1`
-const defaultGOARM = `7`
+const defaultGOARM = `6`
 const defaultGOMIPS = `hardfloat`
 const defaultGOMIPS64 = `hardfloat`
 const defaultGOPPC64 = `power8`
 const defaultGOEXPERIMENT = ``
 const defaultGO_EXTLINK_ENABLED = ``

The linux/arm release archives have been historically built with GOARM=6, not the more common modern GOARM value 7, with the "v6l" suffix in the filename alluding to that. That briefly broke after the switch to distpack and reported in #62164, and go1.21.1 is the first distpack-based release with that fix (CL 521555), so this is working as intended for the published binaries.

For this particular case, we can teach gorebuild to interpret the "v6l" suffix in the .tar.gz release archive and explicitly set GOARM=6 to the make.bash -distpack environment, though there's no filename-based indicator for the "v0.0.1-go1.21.1.linux-arm.zip" module zip file.

That said, a part of this problem is more general. When make.bash runs, GOARM can default to one of 5, 6, or 7 depending on the system where it's running (see here), so unless it's explicitly set, gorebuild will report false positives it run on a system that defaults to a value different from what we chose (or defaulted to) during the release process. This applies to other similar make.bash configuration (GO386, GOAMD64, GOPPC64, etc.) if its value is dynamically determined. But this is minor enough that it's fine to leave out of scope here; we can track it in a separate issue if needed.

CC @rsc, @golang/release.

@dmitshur dmitshur added Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 7, 2023
@dmitshur dmitshur added this to the Unreleased milestone Sep 7, 2023
@gopherbot
Copy link

Change https://go.dev/cl/526263 mentions this issue: cmd/gorebuild: add GOARM=6 special case to reproduce linux/arm downloads

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done.
Projects
Archived in project
Development

No branches or pull requests

3 participants
@dmitshur @gopherbot and others