@ -136,23 +136,6 @@ var (
"golang-go" : "/usr/lib/go" ,
"golang-go" : "/usr/lib/go" ,
}
}
// This is the version of Go that will be downloaded by
//
// go run ci.go install -dlgo
dlgoVersion = "1.21.1"
// This is the version of Go that will be used to bootstrap the PPA builder.
//
// This version is fine to be old and full of security holes, we just use it
// to build the latest Go. Don't change it. If it ever becomes insufficient,
// we need to switch over to a recursive builder to jumpt across supported
// versions.
gobootVersion = "1.19.6"
// This is the version of execution-spec-tests that we are using.
// When updating, you must also update build/checksums.txt.
executionSpecTestsVersion = "1.0.2"
// This is where the tests should be unpacked.
// This is where the tests should be unpacked.
executionSpecTestsDir = "tests/spec-tests"
executionSpecTestsDir = "tests/spec-tests"
)
)
@ -192,6 +175,8 @@ func main() {
doWindowsInstaller ( os . Args [ 2 : ] )
doWindowsInstaller ( os . Args [ 2 : ] )
case "purge" :
case "purge" :
doPurge ( os . Args [ 2 : ] )
doPurge ( os . Args [ 2 : ] )
case "sanitycheck" :
doSanityCheck ( )
default :
default :
log . Fatal ( "unknown command " , os . Args [ 1 ] )
log . Fatal ( "unknown command " , os . Args [ 1 ] )
}
}
@ -213,9 +198,8 @@ func doInstall(cmdline []string) {
tc := build . GoToolchain { GOARCH : * arch , CC : * cc }
tc := build . GoToolchain { GOARCH : * arch , CC : * cc }
if * dlgo {
if * dlgo {
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
tc . Root = build . DownloadGo ( csdb , dlgoVersion )
tc . Root = build . DownloadGo ( csdb )
}
}
// Disable CLI markdown doc generation in release builds.
// Disable CLI markdown doc generation in release builds.
buildTags := [ ] string { "urfave_cli_no_docs" }
buildTags := [ ] string { "urfave_cli_no_docs" }
@ -312,7 +296,7 @@ func doTest(cmdline []string) {
// Configure the toolchain.
// Configure the toolchain.
tc := build . GoToolchain { GOARCH : * arch , CC : * cc }
tc := build . GoToolchain { GOARCH : * arch , CC : * cc }
if * dlgo {
if * dlgo {
tc . Root = build . DownloadGo ( csdb , dlgoVersion )
tc . Root = build . DownloadGo ( csdb )
}
}
gotest := tc . Go ( "test" )
gotest := tc . Go ( "test" )
@ -345,6 +329,10 @@ func doTest(cmdline []string) {
// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
// downloadSpecTestFixtures downloads and extracts the execution-spec-tests fixtures.
func downloadSpecTestFixtures ( csdb * build . ChecksumDB , cachedir string ) string {
func downloadSpecTestFixtures ( csdb * build . ChecksumDB , cachedir string ) string {
executionSpecTestsVersion , err := build . Version ( csdb , "spec-tests" )
if err != nil {
log . Fatal ( err )
}
ext := ".tar.gz"
ext := ".tar.gz"
base := "fixtures" // TODO(MariusVanDerWijden) rename once the version becomes part of the filename
base := "fixtures" // TODO(MariusVanDerWijden) rename once the version becomes part of the filename
url := fmt . Sprintf ( "https://github.com/ethereum/execution-spec-tests/releases/download/v%s/%s%s" , executionSpecTestsVersion , base , ext )
url := fmt . Sprintf ( "https://github.com/ethereum/execution-spec-tests/releases/download/v%s/%s%s" , executionSpecTestsVersion , base , ext )
@ -377,9 +365,11 @@ func doLint(cmdline []string) {
// downloadLinter downloads and unpacks golangci-lint.
// downloadLinter downloads and unpacks golangci-lint.
func downloadLinter ( cachedir string ) string {
func downloadLinter ( cachedir string ) string {
const version = "1.51.1"
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
version , err := build . Version ( csdb , "golangci" )
if err != nil {
log . Fatal ( err )
}
arch := runtime . GOARCH
arch := runtime . GOARCH
ext := ".tar.gz"
ext := ".tar.gz"
@ -761,6 +751,10 @@ func doDebianSource(cmdline []string) {
// to bootstrap the builder Go.
// to bootstrap the builder Go.
func downloadGoBootstrapSources ( cachedir string ) string {
func downloadGoBootstrapSources ( cachedir string ) string {
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
gobootVersion , err := build . Version ( csdb , "ppa-builder" )
if err != nil {
log . Fatal ( err )
}
file := fmt . Sprintf ( "go%s.src.tar.gz" , gobootVersion )
file := fmt . Sprintf ( "go%s.src.tar.gz" , gobootVersion )
url := "https://dl.google.com/go/" + file
url := "https://dl.google.com/go/" + file
dst := filepath . Join ( cachedir , file )
dst := filepath . Join ( cachedir , file )
@ -773,6 +767,10 @@ func downloadGoBootstrapSources(cachedir string) string {
// downloadGoSources downloads the Go source tarball.
// downloadGoSources downloads the Go source tarball.
func downloadGoSources ( cachedir string ) string {
func downloadGoSources ( cachedir string ) string {
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
csdb := build . MustLoadChecksums ( "build/checksums.txt" )
dlgoVersion , err := build . Version ( csdb , "golang" )
if err != nil {
log . Fatal ( err )
}
file := fmt . Sprintf ( "go%s.src.tar.gz" , dlgoVersion )
file := fmt . Sprintf ( "go%s.src.tar.gz" , dlgoVersion )
url := "https://dl.google.com/go/" + file
url := "https://dl.google.com/go/" + file
dst := filepath . Join ( cachedir , file )
dst := filepath . Join ( cachedir , file )
@ -1099,3 +1097,7 @@ func doPurge(cmdline []string) {
log . Fatal ( err )
log . Fatal ( err )
}
}
}
}
func doSanityCheck ( ) {
build . DownloadAndVerifyChecksums ( build . MustLoadChecksums ( "build/checksums.txt" ) )
}