]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add a missing curly-brace in the 'stale' command format string
authorBryan C. Mills <bcmills@google.com>
Tue, 17 Mar 2020 19:17:22 +0000 (15:17 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 18 Mar 2020 01:03:36 +0000 (01:03 +0000)
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>

src/cmd/go/script_test.go
src/cmd/go/testdata/script/install_cross_gobin.txt

index 00c6523cbc674ed6f3d1e170cfdd2dd1bd3f1fc7..e83782a24aa91c1e6d3b44a37b3eb5d8f2f2501e 100644 (file)
@@ -759,7 +759,7 @@ func (ts *testScript) cmdStale(neg bool, args []string) {
        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 {
index 57c18be602b63604d435bb1afa56c28166d1ccb4..33d48fce89915cbd53272e87dc07ba55e8c2bc00 100644 (file)
@@ -1,5 +1,5 @@
 env GO111MODULE=off
-[!short] skip # rebuilds std for alternate architecture
+[short] skip # rebuilds std for alternate architecture
 
 cd mycmd
 go build mycmd
@@ -16,10 +16,9 @@ env GOBIN=$WORK/bin
 ! 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