From 39a2d013becdcfa6c1c320818544e27af68cea4c Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Sun, 25 Jan 2015 02:40:49 +1100 Subject: [PATCH] cmd/tipgodoc: set GOROOT_BOOTSTRAP environment variable Change-Id: I7d5dc5f7510641d2976f2ea6acf0d52cb10b94e8 Reviewed-on: https://go-review.googlesource.com/3266 Reviewed-by: Brad Fitzpatrick --- cmd/tipgodoc/Dockerfile | 5 ++++- cmd/tipgodoc/tip.go | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/tipgodoc/Dockerfile b/cmd/tipgodoc/Dockerfile index 23060d38..ac958192 100644 --- a/cmd/tipgodoc/Dockerfile +++ b/cmd/tipgodoc/Dockerfile @@ -1,7 +1,10 @@ -FROM golang +FROM golang:1.4.1 RUN apt-get update && apt-get install --no-install-recommends -y -q build-essential git +# golang puts its go install here (weird but true) +ENV GOROOT_BOOTSTRAP /usr/src/go + # golang sets GOPATH=/go ADD . /go/src/tipgodoc RUN go install tipgodoc diff --git a/cmd/tipgodoc/tip.go b/cmd/tipgodoc/tip.go index 6fc0656b..4a92a5c1 100644 --- a/cmd/tipgodoc/tip.go +++ b/cmd/tipgodoc/tip.go @@ -151,7 +151,11 @@ func initSide(side, goHash, toolsHash string) (godoc *exec.Cmd, hostport string, } goBin := filepath.Join(goDir, "bin/go") install := exec.Command(goBin, "install", "golang.org/x/tools/cmd/godoc") - install.Env = []string{"GOROOT=" + goDir, "GOPATH=" + filepath.Join(dir, "gopath")} + install.Env = []string{ + "GOROOT=" + goDir, + "GOPATH=" + filepath.Join(dir, "gopath"), + "GOROOT_BOOTSTRAP=" + os.Getenv("GOROOT_BOOTSTRAP"), + } if err := runErr(install); err != nil { return nil, "", err }