The missing brace made the 'stale' command a no-op in the non-error case.
Fix the 'short' skip in install_cross_gobin (it was backward) and
update it to no longer check staleness of a not-necessarily-stale
target and to no longer expect to be able to install into GOROOT/pkg.
(This was missed in #30316 because that part of the test was
erroneously skipped in non-short mode.)
Change-Id: I6a276fec5fa5e5da3fe0daf0c2b5086116ed7c1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/223747
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
if len(args) == 0 {
ts.fatalf("usage: stale target...")
}
- tmpl := "{{if .Error}}{{.ImportPath}}: {{.Error.Err}}{else}}"
+ tmpl := "{{if .Error}}{{.ImportPath}}: {{.Error.Err}}{{else}}"
if neg {
tmpl += "{{if .Stale}}{{.ImportPath}} is unexpectedly stale{{end}}"
} else {
env GO111MODULE=off
-[!short] skip # rebuilds std for alternate architecture
+[short] skip # rebuilds std for alternate architecture
cd mycmd
go build mycmd
! go install mycmd
! exists $GOBIN/linux_$GOARCH
-# installing standard command should still work
-# (should also be mtime update only if cmd/pack is up-to-date).
-! stale cmd/pack
-[!short] go install cmd/pack
+# The install directory for a cross-compiled standard command should include GOARCH.
+go list -f '{{.Target}}' cmd/pack
+stdout ${GOROOT}[/\\]pkg[/\\]tool[/\\]${GOOS}_${GOARCH}[/\\]pack$
-- mycmd/x.go --
package main