Closed bcmills closed 2 years ago
The condition that controls whether we would actually run the compiler appears to be here: https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/work/exec.go;l=476-479;drc=01604129aee8bfc9dd3e2fffd2ad8f772a3089ec
Change https://go.dev/cl/444836 mentions this issue: cmd/go: don't print cached output for non-build list commands
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Use
go install
to build a binary in a way that produces output to stdout or stderr, thengo list -json=Stale
to verify that that binary is not, in fact, stale.What did you expect to see?
Compiler output from
go install
andgo build
, and no compiler output fromgo list
(unless, perhaps, the-export
or-compiled
flag is set).What did you see instead?
The
go list
command, with neither-export
nor-compiled
repeats all of the stdout / stderr output from the compiler for thego install
command, even though it should have no possibility of actually running the compiler!I noticed this existing bug while reviewing CL 444619 (CC @matloob)