Skip to content

Commit 789b3f8

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent fbbed13 commit 789b3f8

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,25 +1400,6 @@ func (r *runTestActor) Act(b *work.Builder, ctx context.Context, a *work.Action)
14001400
cmd.Stdout = stdout
14011401
cmd.Stderr = stdout
14021402

1403-
// If there are any local SWIG dependencies, we want to load
1404-
// the shared library from the build directory.
1405-
if a.Package.UsesSwig() {
1406-
env := cmd.Env
1407-
found := false
1408-
prefix := "LD_LIBRARY_PATH="
1409-
for i, v := range env {
1410-
if strings.HasPrefix(v, prefix) {
1411-
env[i] = v + ":."
1412-
found = true
1413-
break
1414-
}
1415-
}
1416-
if !found {
1417-
env = append(env, "LD_LIBRARY_PATH=.")
1418-
}
1419-
cmd.Env = env
1420-
}
1421-
14221403
cmd.Cancel = func() error {
14231404
if base.SignalTrace == nil {
14241405
err := cmd.Process.Kill()

0 commit comments

Comments
 (0)