From 24f9db7c20ea874c14b04f4183a5632a15ff4c29 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 8 Oct 2017 22:00:34 -0700 Subject: [PATCH] misc/cgo/testcshared: don't overwrite cc in parallel runs Fixes #22176 Change-Id: If47ec9a25da6b480868d8eeccc518dc97d48bda7 Reviewed-on: https://go-review.googlesource.com/69230 Reviewed-by: Alex Brainman --- misc/cgo/testcshared/cshared_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index b81ec3b4c1..3c87850b39 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -210,7 +210,9 @@ func runExe(t *testing.T, env []string, args ...string) string { func runCC(t *testing.T, args ...string) string { t.Helper() - return run(t, nil, append(cc, args...)...) + // This function is run in parallel, so append to a copy of cc + // rather than cc itself. + return run(t, nil, append(append([]string(nil), cc...), args...)...) } func createHeaders() error { -- 2.48.1