From 2aafd9ea179ec308607c131dbda438abac2b9184 Mon Sep 17 00:00:00 2001 From: Brandon Bennett Date: Fri, 4 Feb 2022 12:45:18 -0700 Subject: [PATCH] cmd/go: preserve LIBRARY_PATH and C_INCLUDE_PATH for script tests In bespoke build environments default libraries may be specificied with LIBRARY_PATH, C_INCLUDE_PATH enviroment variables to overide the system (i.e glibc). Allow them though to allow cgo testing of these enviroments. Fixes #50985 Change-Id: I7497a7715d9b635a6ae97efaab94a7ff01cdf8e2 Reviewed-on: https://go-review.googlesource.com/c/go/+/383334 Reviewed-by: Bryan Mills Run-TryBot: Bryan Mills Trust: Ian Lance Taylor TryBot-Result: Gopher Robot --- src/cmd/go/script_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 722921f74c..55a88e0e0b 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -142,6 +142,8 @@ 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 + "LIBRARY_PATH", // allow override of non-standard static library paths + "C_INCLUDE_PATH", // allow override non-standard include paths "CC", // don't lose user settings when invoking cgo "GO_TESTING_GOTOOLS", // for gccgo testing "GCCGO", // for gccgo testing -- 2.50.0