From 8cf579abf7151f9301daf9d2ee293de0320c16aa Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 7 Jun 2018 12:50:21 -0400 Subject: [PATCH] cmd/go: restore "go list" exit code for missing binary packages 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 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/go/go_test.go | 1 - src/cmd/go/internal/work/exec.go | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index dbb3ddedfe..f1fbf6cb69 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -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) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 00ac90d1eb..5fd2f66b86 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -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") } -- 2.48.1