]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: restore "go list" exit code for missing binary packages
authorBryan C. Mills <bcmills@google.com>
Thu, 7 Jun 2018 16:50:21 +0000 (12:50 -0400)
committerBryan C. Mills <bcmills@google.com>
Thu, 7 Jun 2018 18:43:49 +0000 (18:43 +0000)
Prior to CL 108156, "go list" exited with code 0 if there were missing binary packages.
Restore that behavior to fix the failing TestBinaryOnlyPackages.

Fixes golang/go#25784.

Change-Id: Iaeca6bcc840f5ac8f2a016cef131f5c59a8261a8
Reviewed-on: https://go-review.googlesource.com/117036
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/go_test.go
src/cmd/go/internal/work/exec.go

index dbb3ddedfe6b58af42eabccf1a96a0b0bfd8421a..f1fbf6cb693e1e4f6906e8fc3a8aada2e1f0a228 100644 (file)
@@ -4217,7 +4217,6 @@ func TestFatalInBenchmarkCauseNonZeroExitStatus(t *testing.T) {
 }
 
 func TestBinaryOnlyPackages(t *testing.T) {
-       t.Skip("known failing test; see golang.org/issue/25784")
        tooSlow(t)
 
        tg := testgo(t)
index 00ac90d1ebcb9ff429c1b5212511f0966e9882e7..5fd2f66b869d5d439b6f511d5f85d17b76758947 100644 (file)
@@ -405,6 +405,9 @@ func (b *Builder) build(a *Action) (err error) {
                }
                a.Package.Stale = true
                a.Package.StaleReason = "missing or invalid binary-only package"
+               if b.IsCmdList {
+                       return nil
+               }
                return fmt.Errorf("missing or invalid binary-only package")
        }