From 5b558ad936c00e468851b2fc46b136b059495675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 21 Nov 2019 18:18:59 +0200 Subject: [PATCH] build: skip go clean on PPA, messes with the module trick --- Makefile | 2 +- build/ci.go | 2 +- build/clean_go_build_cache.sh | 19 ------------------- build/deb/ethereum/deb.rules | 5 ++++- 4 files changed, 6 insertions(+), 22 deletions(-) delete mode 100755 build/clean_go_build_cache.sh diff --git a/Makefile b/Makefile index 5d4a82de8..474fe61ed 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ lint: ## Run linters. build/env.sh go run build/ci.go lint clean: - ./build/clean_go_build_cache.sh + go clean -cache rm -fr build/_workspace/pkg/ $(GOBIN)/* # The devtools target installs tools required for 'go generate'. diff --git a/build/ci.go b/build/ci.go index d8d7c6590..1ec8e0183 100644 --- a/build/ci.go +++ b/build/ci.go @@ -530,7 +530,7 @@ func doDebianSource(cmdline []string) { log.Fatalf("Failed to copy Go module dependencies: %v", err) } // Run the packaging and upload to the PPA - debuild := exec.Command("debuild", "-S", "-sa", "-us", "-uc", "-d", "-Zxz") + debuild := exec.Command("debuild", "-S", "-sa", "-us", "-uc", "-d", "-Zxz", "-nc") debuild.Dir = pkgdir build.MustRun(debuild) diff --git a/build/clean_go_build_cache.sh b/build/clean_go_build_cache.sh deleted file mode 100755 index 1666381d9..000000000 --- a/build/clean_go_build_cache.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Cleaning the Go cache only makes sense if we actually have Go installed... or -# if Go is actually callable. This does not hold true during deb packaging, so -# we need an explicit check to avoid build failures. -if ! command -v go > /dev/null; then - exit -fi - -version_gt() { - test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1" -} - -golang_version=$(go version |cut -d' ' -f3 |sed 's/go//') - -# Clean go build cache when go version is greater than or equal to 1.10 -if !(version_gt 1.10 $golang_version); then - go clean -cache -fi diff --git a/build/deb/ethereum/deb.rules b/build/deb/ethereum/deb.rules index 8f72437b8..983b87af1 100644 --- a/build/deb/ethereum/deb.rules +++ b/build/deb/ethereum/deb.rules @@ -4,10 +4,13 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -# Launchpad rejects Go's access to $HOME/.cache, use custom folder +# Launchpad rejects Go's access to $HOME, use custom folders export GOCACHE=/tmp/go-build export GOROOT_BOOTSTRAP={{.GoBootPath}} +override_dh_auto_clean: + # Don't try to be smart Launchpad, we know our build rules better than you + override_dh_auto_build: # We can't download a fresh Go within Launchpad, so we're shipping and building # one on the fly. However, we can't build it inside the go-ethereum folder as