cmd/go: 'go list -m all' fails when offline after 'go mod tidy' due to missing .info files #42723
Labels
modules
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
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?
What did you expect to see?
go list -m all
should print all modules in build list.What did you see instead?
go list -m
loads an.info
file for each module in the build list in order to include a timestamp in the output. Normally, the timestamp isn't shown, but it appears in the-json
output, and it may appear in the-f
output (related: #29666).Most commands (including
go mod tidy
) don't download.info
files for canonical versions. They're mainly used to resolve branch, tag, and commit names to versions. So when we go offline, the.info
files are not in the cache, andgo list -m
fails.We need to decide what to do here. If we can't load an
.info
file because we're offline or our proxies returned an error, we should just omit the field from the output instead of reporting an error.We may want to reconsider reporting timestamps for canonical versions at all. I think the only case where we use them are when evaluating the
@upgrade
and@patch
queries to decide whether a pseudo-version is chronologically newer than the highest release or pre-release version. Timestamps aren't required in the proxy protocol, and.info
files aren't authenticated, so they can change and get out of sync with the cache.cc @bcmills @matloob
The text was updated successfully, but these errors were encountered: