cmd/go: list -export -e sets the Error field but keeps Incomplete false #57724
Labels
GoCommand
cmd/go
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
I tracked this down after a tool of mine (which calls
go list
) was choking on https://github.com/bytedance/sonic.With that repo cloned, here's the reproducer:
Note how the package fails to build (they don't support tip, aka 1.20), and the
Error
field is set to the error message, butIncomplete
is stillfalse
.From the docs:
Unless I'm misreading the docs,
Incomplete
needs to betrue
in this case.I see that, in
cmd/go/internal/load
, there are many places whereError
andIncomplete
are set. It sounds very likely to me that one of those setError
while forgetting to setIncomplete
. Could we not setIncomplete
at the very end of loading, based on whetherError
orDepsErrors
are not empty? That would help ensure the documented invariant, reduce code, and avoid bugs like these.cc @bcmills @matloob
The text was updated successfully, but these errors were encountered: