Before this CL the user effectively has to guess at the expected
location of a binary-only package. While the location is normally
obvious ($GOPATH/pkg/GOOS_GOARCH/PATH/PKG.a) it is much less so when
building with options that implicitly add an -installsufix option.
Fixes #26590
Change-Id: I753ef54d6dcf733bb456dba65a4a92e4db57a1b0
Reviewed-on: https://go-review.googlesource.com/125818
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
if b.IsCmdList {
return nil
}
- return fmt.Errorf("missing or invalid binary-only package")
+ return fmt.Errorf("missing or invalid binary-only package; expected file %q", a.Package.Target)
}
if err := b.Mkdir(a.Objdir); err != nil {
--- /dev/null
+# check that error for missing binary-only says where it should be
+! go build b
+stderr pkg[\\/].*a\.a
+
+-- a/a.go --
+//go:binary-only-package
+
+package a
+-- b/b.go --
+package b; import "a"