diff --git a/build/ci-notes.md b/build/ci-notes.md index 13e1fd2307..cfdf954b29 100644 --- a/build/ci-notes.md +++ b/build/ci-notes.md @@ -22,19 +22,20 @@ variables `PPA_SIGNING_KEY` and `PPA_SSH_KEY` on Travis. We want to build go-ethereum with the most recent version of Go, irrespective of the Go version that is available in the main Ubuntu repository. In order to make this possible, -our PPA depends on the ~gophers/ubuntu/archive PPA. Our source package build-depends on -golang-1.11, which is co-installable alongside the regular golang package. PPA dependencies -can be edited at https://launchpad.net/%7Eethereum/+archive/ubuntu/ethereum/+edit-dependencies +our we depend on ~gophers/ubuntu/archive and ~longsleep/ubuntu/golang-backports PPAs. Our +source package build-depends on golang-1.11 on Tusty and golang-1.13 on others, which is +co-installable alongside the regular golang package. PPA dependencies can be edited at +https://launchpad.net/%7Eethereum/+archive/ubuntu/ethereum/+edit-dependencies ## Building Packages Locally (for testing) You need to run Ubuntu to do test packaging. -Add the gophers PPA and install Go 1.11 and Debian packaging tools: +Add the longsleep PPA and install Go 1.13 and Debian packaging tools: - $ sudo apt-add-repository ppa:gophers/ubuntu/archive + $ sudo apt-add-repository ppa:longsleep/ubuntu/golang-backports $ sudo apt-get update - $ sudo apt-get install build-essential golang-1.11 devscripts debhelper python-bzrlib python-paramiko + $ sudo apt-get install build-essential golang-1.13 devscripts debhelper python-bzrlib python-paramiko Create the source packages: @@ -42,10 +43,10 @@ Create the source packages: Then go into the source package directory for your running distribution and build the package: - $ cd dist/ethereum-unstable-1.6.0+xenial + $ cd dist/ethereum-unstable-1.9.6+bionic $ dpkg-buildpackage Built packages are placed in the dist/ directory. $ cd .. - $ dpkg-deb -c geth-unstable_1.6.0+xenial_amd64.deb + $ dpkg-deb -c geth-unstable_1.9.6+bionic_amd64.deb diff --git a/build/ci.go b/build/ci.go index 347cf95e68..43692a2117 100644 --- a/build/ci.go +++ b/build/ci.go @@ -138,7 +138,13 @@ var ( // Note: zesty is unsupported because it was officially deprecated on Launchpad. // Note: artful is unsupported because it was officially deprecated on Launchpad. // Note: cosmic is unsupported because it was officially deprecated on Launchpad. - debDistros = []string{"trusty", "xenial", "bionic", "disco", "eoan"} + debDistros = map[string]string{ + "trusty": "1.11", // Trusty is only supported in ppa:gophers/archive, which is abandoned, so we're stuck at Go 1.11 + "xenial": "1.13", // Xenial and upward are supported in ppa:longsleep/golang-backports, so we can get Go 1.13 + "bionic": "1.13", + "disco": "1.13", + "eoan": "1.13", + } ) var GOBIN, _ = filepath.Abs(filepath.Join("build", "bin")) @@ -479,8 +485,8 @@ func doDebianSource(cmdline []string) { // Create Debian packages and upload them for _, pkg := range debPackages { - for _, distro := range debDistros { - meta := newDebMetadata(distro, *signer, env, now, pkg.Name, pkg.Version, pkg.Executables) + for distro, gover := range debDistros { + meta := newDebMetadata(distro, gover, *signer, env, now, pkg.Name, pkg.Version, pkg.Executables) pkgdir := stageDebianSource(*workdir, meta) debuild := exec.Command("debuild", "-S", "-sa", "-us", "-uc", "-d", "-Zxz") debuild.Dir = pkgdir @@ -561,7 +567,8 @@ type debPackage struct { } type debMetadata struct { - Env build.Environment + Env build.Environment + GoVersion string PackageName string @@ -590,12 +597,13 @@ func (d debExecutable) Package() string { return d.BinaryName } -func newDebMetadata(distro, author string, env build.Environment, t time.Time, name string, version string, exes []debExecutable) debMetadata { +func newDebMetadata(distro, gover, author string, env build.Environment, t time.Time, name string, version string, exes []debExecutable) debMetadata { if author == "" { // No signing key, use default author. author = "Ethereum Builds " } return debMetadata{ + GoVersion: gover, PackageName: name, Env: env, Author: author, diff --git a/build/deb/ethereum/deb.control b/build/deb/ethereum/deb.control index 5b3ff93542..aae69b1844 100644 --- a/build/deb/ethereum/deb.control +++ b/build/deb/ethereum/deb.control @@ -2,7 +2,7 @@ Source: {{.Name}} Section: science Priority: extra Maintainer: {{.Author}} -Build-Depends: debhelper (>= 8.0.0), golang-1.11 +Build-Depends: debhelper (>= 8.0.0), golang-{{.GoVersion}} Standards-Version: 3.9.5 Homepage: https://ethereum.org Vcs-Git: git://github.com/ethereum/go-ethereum.git diff --git a/build/deb/ethereum/deb.rules b/build/deb/ethereum/deb.rules index 5280e0e55a..c0c797ee09 100644 --- a/build/deb/ethereum/deb.rules +++ b/build/deb/ethereum/deb.rules @@ -8,7 +8,7 @@ export GOCACHE=/tmp/go-build override_dh_auto_build: - build/env.sh /usr/lib/go-1.11/bin/go run build/ci.go install -git-commit={{.Env.Commit}} -git-branch={{.Env.Branch}} -git-tag={{.Env.Tag}} -buildnum={{.Env.Buildnum}} -pull-request={{.Env.IsPullRequest}} + build/env.sh /usr/lib/go-{{.GoVersion}}/bin/go run build/ci.go install -git-commit={{.Env.Commit}} -git-branch={{.Env.Branch}} -git-tag={{.Env.Tag}} -buildnum={{.Env.Buildnum}} -pull-request={{.Env.IsPullRequest}} override_dh_auto_test: