]> Cypherpunks repositories - gostls13.git/commit
cmd/go: print require chains in build list errors
authorJay Conrod <jayconrod@google.com>
Mon, 11 Mar 2019 22:53:08 +0000 (18:53 -0400)
committerJay Conrod <jayconrod@google.com>
Wed, 3 Apr 2019 18:00:56 +0000 (18:00 +0000)
commit1e3cdd1edce67350f8007e4a9b9b555f1e27c5b4
tree27da504871234bf4adb147096acfad96834a121e
parent8c896aa46655cfbdfd9971fb16a830046fcdf81c
cmd/go: print require chains in build list errors

mvs.BuildList and functions that invoke it directly (UpgradeAll) now
return an *mvs.BuildListError when there is an error retrieving the
requirements for a module. This new error prints the chain of
requirements from the main module to the module where the error
occurred.

These errors come up most commonly when a go.mod file has an
unexpected module path or can't be parsed for some other reason. It's
currently difficult to debug these errors because it's not clear where
the "bad" module is required from. Tools like "go list -m" and
"go mod why" don't work without the build graph.

Fixes #30661

Change-Id: I3c9d4683dcd9a5d7c259e5e4cc7e1ee209700b10
Reviewed-on: https://go-review.googlesource.com/c/go/+/166984
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/mvs/mvs.go
src/cmd/go/internal/mvs/mvs_test.go
src/cmd/go/testdata/mod/example.com_badchain_a_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_badchain_a_v1.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_badchain_b_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_badchain_b_v1.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_badchain_c_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_badchain_c_v1.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_load_badchain.txt [new file with mode: 0644]