cmd/go: keep WINDIR during TestScript
TestScript executes PowerShell. And PowerShell appears to require
WINDIR environment variable to exists on windows-arm.
So keep WINDIR environment variable when running PowerShell.
Fixes #30711
Change-Id: I14dde6614347325a8f3caf994ea8ab05294450a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/168859
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
index 9cb5b49..7c5dd48 100644
--- a/src/cmd/go/script_test.go
+++ b/src/cmd/go/script_test.go
@@ -84,6 +84,7 @@
var extraEnvKeys = []string{
"SYSTEMROOT", // must be preserved on Windows to find DLLs; golang.org/issue/25210
+ "WINDIR", // must be preserved on Windows to be able to run PowerShell command; golang.org/issue/30711
"LD_LIBRARY_PATH", // must be preserved on Unix systems to find shared libraries
"CC", // don't lose user settings when invoking cgo
"GO_TESTING_GOTOOLS", // for gccgo testing
diff --git a/src/cmd/go/testdata/script/build_acl_windows.txt b/src/cmd/go/testdata/script/build_acl_windows.txt
index 21b8879..13a3ba2 100644
--- a/src/cmd/go/testdata/script/build_acl_windows.txt
+++ b/src/cmd/go/testdata/script/build_acl_windows.txt
@@ -1,5 +1,4 @@
[!windows] stop
-[arm] skip # TODO(golang.org/issue/30711): Skip broken test.
[!exec:icacls] skip
[!exec:powershell] skip