]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/go: don't set LD_LIBRARY_PATH for SWIG
authorIan Lance Taylor <iant@golang.org>
Tue, 22 Aug 2023 22:08:11 +0000 (15:08 -0700)
committerGopher Robot <gobot@golang.org>
Fri, 25 Aug 2023 21:04:21 +0000 (21:04 +0000)
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 <bcmills@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go/internal/test/test.go

index 4fd5c0b408663aaad2da68cb6f939e5ac05f3686..11d1aefc190faebbced407933e67123ebbc9062d 100644 (file)
@@ -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()