Skip to content

Commit d2cb5b7

Browse files
committed
runtime: fix TestLldbPython in module mode (again)
When run with GOPATH=/dev/null, go build fails: $ GOPATH=/dev/null go test -run=TestLldbPython -v -count=1 runtime === RUN TestLldbPython --- FAIL: TestLldbPython (0.21s) runtime-lldb_test.go:169: building source exit status 1 go: failed to create cache directory /dev/null/pkg/mod/cache: mkdir /dev/null: not a directory FAIL FAIL runtime 0.220s But run.bash sets GOPATH=/dev/null. Fix this by setting GOPATH to the empty string before passing to 'go build'. Fixes #31100 Change-Id: I573c4755d209e0c3eb26c20d4f7870c2961f2782 Reviewed-on: https://go-review.googlesource.com/c/go/+/169918 Run-TryBot: Josh Bleecher Snyder <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent b3e2da6 commit d2cb5b7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/runtime/runtime-lldb_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ func TestLldbPython(t *testing.T) {
164164
// disable it for this test.
165165
cmd := exec.Command(testenv.GoToolPath(t), "build", "-gcflags=all=-N -l", "-ldflags=-compressdwarf=false", "-o", "a.exe")
166166
cmd.Dir = dir
167+
cmd.Env = append(os.Environ(), "GOPATH=") // issue 31100
167168
out, err := cmd.CombinedOutput()
168169
if err != nil {
169170
t.Fatalf("building source %v\n%s", err, out)

0 commit comments

Comments
 (0)