Skip to content

Commit be0fe03

Browse files
committed
playground: put GOCACHE in temp dir
Fixes golang/go#30473 Change-Id: Iad5b60b98c12add932fa3be9174fe7ca4dcbb6b2 Reviewed-on: https://go-review.googlesource.com/c/164519 Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 15cfee7 commit be0fe03

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,6 @@ RUN apt-get update && apt-get install -y git ca-certificates --no-install-recomm
222222
COPY --from=builder /usr/local/go /usr/local/go
223223
COPY --from=builder /tmp/sel_ldr_x86_64 /usr/local/bin
224224

225-
# For implicit GOCACHE (issues 29243 and 29251), set HOME:
226-
RUN mkdir -p /home/gopher
227-
ENV HOME /home/gopher
228-
229225
ENV GOPATH /go
230226
ENV PATH /usr/local/go/bin:$GOPATH/bin:$PATH
231227

sandbox.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ func compileAndRun(req *request) (*response, error) {
323323
}
324324

325325
exe := filepath.Join(tmpDir, "a.out")
326+
goCache := filepath.Join(tmpDir, "gocache")
326327
cmd := exec.Command("go", "build", "-o", exe, in)
327-
cmd.Env = []string{"GOOS=nacl", "GOARCH=amd64p32", "GOPATH=" + os.Getenv("GOPATH"), "HOME=" + os.Getenv("HOME")}
328+
cmd.Env = []string{"GOOS=nacl", "GOARCH=amd64p32", "GOPATH=" + os.Getenv("GOPATH"), "GOCACHE=" + goCache}
328329
if out, err := cmd.CombinedOutput(); err != nil {
329330
if _, ok := err.(*exec.ExitError); ok {
330331
// Return compile errors to the user.

0 commit comments

Comments
 (0)