Skip to content

Commit 3f83c83

Browse files
author
Bryan C. Mills
committed
cmd/go: ensure that runtime/cgo is not stale in TestExecBuildX
Fixes #29004 Change-Id: Ifc8330b47fbec6f902057cb9b6db44f2c0082056 Reviewed-on: https://go-review.googlesource.com/c/go/+/183838 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
1 parent 98e1bd2 commit 3f83c83

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmd/go/go_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5061,6 +5061,11 @@ func TestExecBuildX(t *testing.T) {
50615061
tg.tempDir("cache")
50625062
tg.setenv("GOCACHE", tg.path("cache"))
50635063

5064+
// Before building our test main.go, ensure that an up-to-date copy of
5065+
// runtime/cgo is present in the cache. If it isn't, the 'go build' step below
5066+
// will fail with "can't open import". See golang.org/issue/29004.
5067+
tg.run("build", "runtime/cgo")
5068+
50645069
tg.tempFile("main.go", `package main; import "C"; func main() { print("hello") }`)
50655070
src := tg.path("main.go")
50665071
obj := tg.path("main")

0 commit comments

Comments
 (0)