Commit 3e97b04a authored by Felix Lange's avatar Felix Lange Committed by Péter Szilágyi

build: put GOPATH in /tmp on launchpad (#20564)

* build: put GOPATH in /tmp on launchpad

* build: don't remove GOPATH from go tool environment
parent f20c8d49
...@@ -297,7 +297,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd ...@@ -297,7 +297,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd
cmd.Env = append(cmd.Env, "CC="+cc) cmd.Env = append(cmd.Env, "CC="+cc)
} }
for _, e := range os.Environ() { for _, e := range os.Environ() {
if strings.HasPrefix(e, "GOPATH=") || strings.HasPrefix(e, "GOBIN=") { if strings.HasPrefix(e, "GOBIN=") {
continue continue
} }
cmd.Env = append(cmd.Env, e) cmd.Env = append(cmd.Env, e)
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
# Launchpad rejects Go's access to $HOME, use custom folders # Launchpad rejects Go's access to $HOME, use custom folders
export GOCACHE=/tmp/go-build export GOCACHE=/tmp/go-build
export GOPATH=/tmp/gopath
export GOROOT_BOOTSTRAP={{.GoBootPath}} export GOROOT_BOOTSTRAP={{.GoBootPath}}
override_dh_auto_clean: override_dh_auto_clean:
...@@ -19,7 +20,8 @@ override_dh_auto_build: ...@@ -19,7 +20,8 @@ override_dh_auto_build:
# We can't download external go modules within Launchpad, so we're shipping the # We can't download external go modules within Launchpad, so we're shipping the
# entire dependency source cache with go-ethereum. # entire dependency source cache with go-ethereum.
(mkdir -p $(HOME)/go/pkg/mod && mv .mod/* $(HOME)/go/pkg/mod) mkdir -p $(GOPATH)/pkg
mv .mod $(GOPATH)/pkg/mod
# A fresh Go was built, all dependency downloads faked, hope build works now # A fresh Go was built, all dependency downloads faked, hope build works now
../.go/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}} ../.go/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}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment