aboutsummaryrefslogtreecommitdiff
path: root/misc/ios
diff options
context:
space:
mode:
authorElias Naur <mail@eliasnaur.com>2019-03-17 16:07:25 +0100
committerElias Naur <mail@eliasnaur.com>2019-03-17 17:00:42 +0000
commit746f405f98ab8ad6e2e6a1ce162c831527aafd57 (patch)
tree2841b600f7e879fc19577d3f63bbc16e55e90fb7 /misc/ios
parent14c3692502be68275a8deb9c19dabbbd510a4f31 (diff)
downloadgo-746f405f98ab8ad6e2e6a1ce162c831527aafd57.tar.gz
go-746f405f98ab8ad6e2e6a1ce162c831527aafd57.zip
cmd/go,misc/ios: fix tests on iOS
Now that modules are always on, cmd/go tests require a valid GOCACHE. However, on iOS where the go tool is not available, the cmd/go test driver ends up setting GOCACHE to the empty string. Fix it by falling back to the builtin default cache directory. The iOS exec wrapper passes the environment variables to the app on the device, including $HOME used for the default cache directory. Skip $HOME to let the device specific and writable $HOME be used instead. Should fix cmd/go on the iOS builders that broke when GO111MODULE defaulted to on. Change-Id: I0939f5b8aaa1d2db95e64c99f4130eee2d0b4d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/167938 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'misc/ios')
-rw-r--r--misc/ios/go_darwin_arm_exec.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/ios/go_darwin_arm_exec.go b/misc/ios/go_darwin_arm_exec.go
index 6a3d9def68..8912d1e8fc 100644
--- a/misc/ios/go_darwin_arm_exec.go
+++ b/misc/ios/go_darwin_arm_exec.go
@@ -467,8 +467,8 @@ func idevCmd(cmd *exec.Cmd) *exec.Cmd {
func run(appdir, bundleID string, args []string) error {
var env []string
for _, e := range os.Environ() {
- // Don't override TMPDIR on the device.
- if strings.HasPrefix(e, "TMPDIR=") {
+ // Don't override TMPDIR, HOME on the device.
+ if strings.HasPrefix(e, "TMPDIR=") || strings.HasPrefix(e, "HOME=") {
continue
}
env = append(env, e)