]> Cypherpunks repositories - gostls13.git/commitdiff
misc/ios: don't override TMPDIR on idevice
authorElias Naur <elias.naur@gmail.com>
Wed, 2 May 2018 18:13:14 +0000 (20:13 +0200)
committerElias Naur <elias.naur@gmail.com>
Wed, 2 May 2018 19:44:38 +0000 (19:44 +0000)
If TMPDIR is not set, the iOS runtime will automatically set TMPDIR
to a valid app temporary path.

For the iOS builders.

Change-Id: Ia82404059dcb10678f0a6e0c96d5efc79a5485fd
Reviewed-on: https://go-review.googlesource.com/110956
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/ios/go_darwin_arm_exec.go

index 6138878e20c51f7d217f8e861b6cc2de0b362b52..6c5a913bc68ef5a338a1df13a8b46f03e07dd8be 100644 (file)
@@ -403,6 +403,15 @@ func run(appdir, deviceapp string, args []string) error {
                deviceapp,
        )
        lldb.Args = append(lldb.Args, args...)
+       var env []string
+       for _, e := range os.Environ() {
+               // Don't override TMPDIR on the device.
+               if strings.HasPrefix(e, "TMPDIR=") {
+                       continue
+               }
+               env = append(env, e)
+       }
+       lldb.Env = env
        lldb.Stdin = strings.NewReader(lldbDriver)
        lldb.Stdout = os.Stdout
        lldb.Stderr = os.Stderr