Commit 3f83c83b authored by Bryan C. Mills's avatar Bryan C. Mills

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 <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
parent 98e1bd2b
......@@ -5061,6 +5061,11 @@ func TestExecBuildX(t *testing.T) {
tg.tempDir("cache")
tg.setenv("GOCACHE", tg.path("cache"))
// Before building our test main.go, ensure that an up-to-date copy of
// runtime/cgo is present in the cache. If it isn't, the 'go build' step below
// will fail with "can't open import". See golang.org/issue/29004.
tg.run("build", "runtime/cgo")
tg.tempFile("main.go", `package main; import "C"; func main() { print("hello") }`)
src := tg.path("main.go")
obj := tg.path("main")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment