sandbox: update for Go 1.5

Change-Id: I2dc04b2ce4959e9d24d1ab931cfd003f72897ac0
Reviewed-on: https://go-review.googlesource.com/13340
Reviewed-by: Andrew Gerrand <adg@golang.org>
diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile
index 36447e3..032a5b6 100644
--- a/sandbox/Dockerfile
+++ b/sandbox/Dockerfile
@@ -2,21 +2,24 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-FROM golang:1.4.2
+FROM golang:1.5
 
 # enable faketime
 RUN apt-get update && apt-get install -yq --no-install-recommends patch
-ADD enable-fake-time.patch /usr/src/go/
-RUN patch /usr/src/go/src/runtime/rt0_nacl_amd64p32.s /usr/src/go/enable-fake-time.patch
-ADD write-to-stderr.patch /usr/src/go/
-RUN patch /usr/src/go/src/runtime/sys_nacl_amd64p32.s /usr/src/go/write-to-stderr.patch
+ADD enable-fake-time.patch /usr/local/go/
+RUN patch /usr/local/go/src/runtime/rt0_nacl_amd64p32.s /usr/local/go/enable-fake-time.patch
 
 # add fake file system
-ADD fake_fs.lst /usr/src/go/
-RUN cd /usr/src/go && go run misc/nacl/mkzip.go -p syscall fake_fs.lst src/syscall/fstest_nacl.go
+ADD fake_fs.lst /usr/local/go/
+RUN cd /usr/local/go && go run misc/nacl/mkzip.go -p syscall fake_fs.lst src/syscall/fstest_nacl.go
 
-# build go nacl tool chain
-RUN cd /usr/src/go/src && GOOS=nacl GOARCH=amd64p32 ./make.bash --no-clean
+# Install go1.4 ss $HOME/go1.4 (the default location), as we need it to build
+# Go 1.5+. We can't just use the existing Go installation to bootstrap, as the
+# first thing make.bash does is clean the existing binaries.
+RUN curl https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -xz -C /root && mv /root/go /root/go1.4
+
+# Build the Go nacl tool chain.
+RUN cd /usr/local/go/src && GOOS=nacl GOARCH=amd64p32 ./make.bash --no-clean
 RUN cd /usr/local/bin && curl -s -O https://storage.googleapis.com/gobuilder/sel_ldr_x86_64 && chmod 0755 sel_ldr_x86_64
 
 # add and compile tour packages
diff --git a/sandbox/fake_fs.lst b/sandbox/fake_fs.lst
index d9204ca..806aa63 100644
--- a/sandbox/fake_fs.lst
+++ b/sandbox/fake_fs.lst
@@ -4,7 +4,7 @@
 	passwd	src=misc/nacl/testdata/empty
 	hosts	src=misc/nacl/testdata/hosts
 usr	src=/usr
-	src
+	local
 		go
 			lib
 				time
diff --git a/sandbox/write-to-stderr.patch b/sandbox/write-to-stderr.patch
deleted file mode 100644
index cc31634..0000000
--- a/sandbox/write-to-stderr.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-This has been committed to the master branch, but is not present in
-1.4 and may not make it to 1.4.x. This patch will fail to apply
-if and when it does, so we'll know to simply delete it when the
-latest stable Go includes the patch.
-
---- sys_nacl_amd64p32.s	2014-12-11 01:18:12.000000000 +0000
-+++ sys_nacl_amd64p32.s.new	2015-01-12 14:58:08.376023852 +0000
-@@ -93,13 +93,13 @@
- 	MOVL n+8(FP), DX
- 	BSWAPL DX
- 	MOVL DX, 12(SP)
--	MOVL $1, DI // standard output
-+	MOVL fd+0(FP), DI
- 	MOVL SP, SI
- 	MOVL $16, DX
- 	NACL_SYSCALL(SYS_write)
- 
- 	// Write actual data.
--	MOVL $1, DI // standard output
-+	MOVL fd+0(FP), DI
- 	MOVL p+4(FP), SI
- 	MOVL n+8(FP), DX
- 	NACL_SYSCALL(SYS_write)