From 789b3f84072e6120fbe1bd637dd82e7158c07387 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 22 Aug 2023 15:08:11 -0700 Subject: [PATCH] cmd/go: don't set LD_LIBRARY_PATH for SWIG Setting LD_LIBRARY_PATH when running "go test" for a package that uses SWIG dates back to the initial introduction of SWIG support in CL 5845071 in 2012. Back then SWIG worked by creating a shared library, but in CL 6851 in 2015 we changed SWIG to generate cgo input files, and no shared library was used. Since we no longer use a shared library, we no longer need to set LD_LIBRARY_PATH. Change-Id: I31ecc03c6c52f4efdf2ef6fb3ebeab35adc325aa Reviewed-on: https://go-review.googlesource.com/c/go/+/522035 Reviewed-by: Bryan Mills Run-TryBot: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot --- src/cmd/go/internal/test/test.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index 4fd5c0b4086..11d1aefc190 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -1400,25 +1400,6 @@ func (r *runTestActor) Act(b *work.Builder, ctx context.Context, a *work.Action) cmd.Stdout = stdout cmd.Stderr = stdout - // If there are any local SWIG dependencies, we want to load - // the shared library from the build directory. - if a.Package.UsesSwig() { - env := cmd.Env - found := false - prefix := "LD_LIBRARY_PATH=" - for i, v := range env { - if strings.HasPrefix(v, prefix) { - env[i] = v + ":." - found = true - break - } - } - if !found { - env = append(env, "LD_LIBRARY_PATH=.") - } - cmd.Env = env - } - cmd.Cancel = func() error { if base.SignalTrace == nil { err := cmd.Process.Kill()