]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: classify "invalid pseudo-version" errors in Query
authorBryan C. Mills <bcmills@google.com>
Fri, 8 Dec 2023 16:26:30 +0000 (11:26 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 11 Dec 2023 22:29:11 +0000 (22:29 +0000)
commita839ec1e73c25d47cc329e93b9508fb53277bdd2
tree10019463db2514e63368d58cff69326de5c4aed7
parente872807e2b7d74ba4ac474e697027a9318439d04
cmd/go/internal/modload: classify "invalid pseudo-version" errors in Query

If we encounter an unclassified error in modload.Query, it takes
precedence even if the package is found in some other module.
(That is intentional, so that if a package exists in both a parent
and a nested module the outcome is deterministic, and does not shift
if a temporary error causes one of the modules to be unavailable.)

A pseudo-version is formed from a base version and a commit hash.
Each version tag is specific to the module in a particular directory
of the repo (often the root directory), whereas the commit hash is
the same for all subdirectories. When we go to check a particular
subdirectory for the requested package, we may find that that version
is not valid for that combination of <subdirectory, commit hash>,
but we should keep looking to see whether it is valid for a module
in some other subdirectory.

Fixes #47650.

Change-Id: Id48f590ce906a3d4cf4e82fc66137bf67613277d
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/548475
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/cmd/go/internal/modfetch/coderepo.go
src/cmd/go/internal/modload/query.go
src/cmd/go/testdata/script/mod_get_issue47650.txt [new file with mode: 0644]
src/cmd/go/testdata/vcstest/git/issue47650.txt [new file with mode: 0644]