]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: preserve LIBRARY_PATH and C_INCLUDE_PATH for script tests
authorBrandon Bennett <bbennett@fb.com>
Fri, 4 Feb 2022 19:45:18 +0000 (12:45 -0700)
committerBryan Mills <bcmills@google.com>
Fri, 4 Feb 2022 20:50:14 +0000 (20:50 +0000)
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 <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Trust: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go/script_test.go

index 722921f74c3d34f371ae325a09001d94039d56ce..55a88e0e0b03e23ac34dc7e6e6b5db2d46abe0b3 100644 (file)
@@ -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