buildgolang.org/x/build/cmd/gorebuild

gorebuild command

Gorebuild rebuilds and verifies the distribution files posted at https://go.dev/dl/.

Usage:

gorebuild [-p N] [goos-goarch][@version]...

With no arguments, gorebuild rebuilds and verifies the files for all systems (that is, all operating system-architecture pairs) for up to three versions of Go:

Only Go versions starting at Go 1.21 or later are considered for this default set of versions, because Go 1.20 and earlier did not ship reproducible toolchains.

With arguments, gorebuild rebuilds the files only for the named toolchains:

The -p flag specifies how many toolchain rebuilds to run in parallel (default 2).

When running on linux-amd64, gorebuild does a full bootstrap, building Go 1.4 (written in C) with the host C compiler, then building Go 1.17 with Go 1.4, then building Go 1.20 using Go 1.17, and so on, up to the target toolchain. On other systems, gorebuild downloads a binary distribution of the bootstrap toolchain it needs. For example, Go 1.21 required Go 1.17, so to rebuild and verify Go 1.21, gorebuild downloads and uses the latest binary distribution of the Go 1.17 toolchain (specifically, Go 1.17.13) from https://go.dev/dl/.

In general, gorebuild checks that the local rebuild produces a bit-for-bit identical copy of the file posted at https://go.dev/dl/. Similarly, gorebuild checks that the local rebuild produces a bit-for-bit identical copy of the module form of the toolchain used by Go 1.21's toolchain downloads (also served by https://go.dev/dl/).

However, in a few cases gorebuild does not insist on a bit-for-bit comparison. These cases are:

Gorebuild prints log messages to standard error but also accumulates them in a structured report. Before exiting, it writes the report as JSON to gorebuild.json and as HTML to gorebuild.html.

Gorebuild exits with status 0 when it succeeds in writing a report, whether or not the report verified all the posted files.

Version
v0.0.0-20250421191922-3619c213cff3 (latest)
Published
Apr 21, 2025
Platform
linux/amd64
Imports
32 packages
Last checked
2 months ago

Tools for package owners.