@@ -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.
0 commit comments