Skip to content

Commit 1f628d8

Browse files
authored
build: build all the builders to build all the builders (#29647)
* build: build all the builders to build all the builders * build: tweak the indexes a bit to make them consistent
1 parent 243cde0 commit 1f628d8

File tree

3 files changed

+35
-25
lines changed

3 files changed

+35
-25
lines changed

build/checksums.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ a5e68ae73d38748b5269fad36ac7575e3c162a5dc63ef58abdea03cc5da4522a golangci-lint-
5656
# This is the builder on PPA that will build Go itself (inception-y), don't modify!
5757
#
5858
# This version is fine to be old and full of security holes, we just use it
59-
# to build the latest Go. Don't change it. If it ever becomes insufficient,
60-
# we need to switch over to a recursive builder to jump across supported
61-
# versions.
59+
# to build the latest Go. Don't change it.
6260
#
63-
# version:ppa-builder 1.19.6
61+
# version:ppa-builder-1 1.19.6
6462
# https://go.dev/dl/
6563
d7f0013f82e6d7f862cc6cb5c8cdb48eef5f2e239b35baa97e2f1a7466043767 go1.19.6.src.tar.gz
64+
65+
# version:ppa-builder-2 1.21.9
66+
# https://go.dev/dl/
67+
58f0c5ced45a0012bce2ff7a9df03e128abcc8818ebabe5027bb92bafe20e421 go1.21.9.src.tar.gz

build/ci.go

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ func doDebianSource(cmdline []string) {
694694
}
695695
// Download and verify the Go source packages.
696696
var (
697-
gobootbundle = downloadGoBootstrapSources(*cachedir)
698-
gobundle = downloadGoSources(*cachedir)
697+
gobootbundles = downloadGoBootstrapSources(*cachedir)
698+
gobundle = downloadGoSources(*cachedir)
699699
)
700700
// Download all the dependencies needed to build the sources and run the ci script
701701
srcdepfetch := tc.Go("mod", "download")
@@ -714,11 +714,13 @@ func doDebianSource(cmdline []string) {
714714
pkgdir := stageDebianSource(*workdir, meta)
715715

716716
// Add bootstrapper Go source code
717-
if err := build.ExtractArchive(gobootbundle, pkgdir); err != nil {
718-
log.Fatalf("Failed to extract bootstrapper Go sources: %v", err)
719-
}
720-
if err := os.Rename(filepath.Join(pkgdir, "go"), filepath.Join(pkgdir, ".goboot")); err != nil {
721-
log.Fatalf("Failed to rename bootstrapper Go source folder: %v", err)
717+
for i, gobootbundle := range gobootbundles {
718+
if err := build.ExtractArchive(gobootbundle, pkgdir); err != nil {
719+
log.Fatalf("Failed to extract bootstrapper Go sources: %v", err)
720+
}
721+
if err := os.Rename(filepath.Join(pkgdir, "go"), filepath.Join(pkgdir, fmt.Sprintf(".goboot-%d", i+1))); err != nil {
722+
log.Fatalf("Failed to rename bootstrapper Go source folder: %v", err)
723+
}
722724
}
723725
// Add builder Go source code
724726
if err := build.ExtractArchive(gobundle, pkgdir); err != nil {
@@ -754,21 +756,26 @@ func doDebianSource(cmdline []string) {
754756
}
755757
}
756758

757-
// downloadGoBootstrapSources downloads the Go source tarball that will be used
759+
// downloadGoBootstrapSources downloads the Go source tarball(s) that will be used
758760
// to bootstrap the builder Go.
759-
func downloadGoBootstrapSources(cachedir string) string {
761+
func downloadGoBootstrapSources(cachedir string) []string {
760762
csdb := build.MustLoadChecksums("build/checksums.txt")
761-
gobootVersion, err := build.Version(csdb, "ppa-builder")
762-
if err != nil {
763-
log.Fatal(err)
764-
}
765-
file := fmt.Sprintf("go%s.src.tar.gz", gobootVersion)
766-
url := "https://dl.google.com/go/" + file
767-
dst := filepath.Join(cachedir, file)
768-
if err := csdb.DownloadFile(url, dst); err != nil {
769-
log.Fatal(err)
763+
764+
var bundles []string
765+
for _, booter := range []string{"ppa-builder-1", "ppa-builder-2"} {
766+
gobootVersion, err := build.Version(csdb, booter)
767+
if err != nil {
768+
log.Fatal(err)
769+
}
770+
file := fmt.Sprintf("go%s.src.tar.gz", gobootVersion)
771+
url := "https://dl.google.com/go/" + file
772+
dst := filepath.Join(cachedir, file)
773+
if err := csdb.DownloadFile(url, dst); err != nil {
774+
log.Fatal(err)
775+
}
776+
bundles = append(bundles, dst)
770777
}
771-
return dst
778+
return bundles
772779
}
773780

774781
// downloadGoSources downloads the Go source tarball.

build/deb/ethereum/deb.rules

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ override_dh_auto_build:
1919
#
2020
# We're also shipping the bootstrapper as of Go 1.20 as it had minimum version
2121
# requirements opposed to older versions of Go.
22-
(mv .goboot ../ && cd ../.goboot/src && ./make.bash)
23-
(mv .go ../ && cd ../.go/src && GOROOT_BOOTSTRAP=`pwd`/../../.goboot ./make.bash)
22+
(mv .goboot-1 ../ && cd ../.goboot-1/src && ./make.bash)
23+
(mv .goboot-2 ../ && cd ../.goboot-2/src && GOROOT_BOOTSTRAP=`pwd`/../../.goboot-1 ./make.bash)
24+
(mv .go ../ && cd ../.go/src && GOROOT_BOOTSTRAP=`pwd`/../../.goboot-2 ./make.bash)
2425

2526
# We can't download external go modules within Launchpad, so we're shipping the
2627
# entire dependency source cache with go-ethereum.

0 commit comments

Comments
 (0)