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>
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()