tg.run("build", "hello.go")
tg.grepStderrNot("unable to find math.a", "did not build math.a correctly")
}
+
+func TestIssue13655(t *testing.T) {
+ tg := testgo(t)
+ defer tg.cleanup()
+ for _, pkg := range []string{"runtime", "runtime/internal/atomic"} {
+ tg.run("list", "-f", "{{.Deps}}", pkg)
+ tg.grepStdout("runtime/internal/sys", "did not find required dependency of "+pkg+" on runtime/internal/sys")
+ }
+}
}
}
+ // Runtime and its internal packages depend on runtime/internal/sys,
+ // so that they pick up the generated zversion.go file.
+ // This can be an issue particularly for runtime/internal/atomic;
+ // see issue 13655.
+ if p.Standard && (p.ImportPath == "runtime" || strings.HasPrefix(p.ImportPath, "runtime/internal/")) && p.ImportPath != "runtime/internal/sys" {
+ importPaths = append(importPaths, "runtime/internal/sys")
+ }
+
// Build list of full paths to all Go files in the package,
// for use by commands like go fmt.
p.gofiles = stringList(p.GoFiles, p.CgoFiles, p.TestGoFiles, p.XTestGoFiles)