-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: describe dependencies in build list error messages
mvs.BuildList reports errors with a chain of modules to make it clear why the module where the error occurred was part of the build. This is a little confusing with "go get -u" since there are edges in the module graph for requirements and for updates. With this change, we now print "requires" or "updates to" between each module version in the chain. Updates #30661 Change-Id: Ie689500ea86857e715b250b9e0cae0bc6686dc32 Reviewed-on: https://go-review.googlesource.com/c/go/+/171150 Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
- Loading branch information
Jay Conrod
committed
Apr 16, 2019
1 parent
6997671
commit f7c9672
Showing
2 changed files
with
42 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,18 +8,18 @@ go mod download example.com/badchain/[email protected] | |
go mod download example.com/badchain/[email protected] | ||
go mod download example.com/badchain/[email protected] | ||
|
||
# Try to upgrade example.com/badchain/a (and its dependencies). | ||
# Try to update example.com/badchain/a (and its dependencies). | ||
! go get -u example.com/badchain/a | ||
cmp stderr upgrade-a-expected | ||
cmp stderr update-a-expected | ||
cmp go.mod go.mod.orig | ||
|
||
# Try to upgrade the main module. This upgrades everything, including | ||
# Try to update the main module. This updates everything, including | ||
# modules that aren't direct requirements, so the error stack is shorter. | ||
! go get -u | ||
cmp stderr upgrade-main-expected | ||
cmp stderr update-main-expected | ||
cmp go.mod go.mod.orig | ||
|
||
# Upgrade manually. Listing modules should produce an error. | ||
# update manually. Listing modules should produce an error. | ||
go mod edit -require=example.com/badchain/[email protected] | ||
! go list -m | ||
cmp stderr list-expected | ||
|
@@ -28,14 +28,14 @@ cmp stderr list-expected | |
module m | ||
|
||
require example.com/badchain/a v1.0.0 | ||
-- upgrade-main-expected -- | ||
go get: example.com/badchain/[email protected] -> | ||
-- update-main-expected -- | ||
go get: example.com/badchain/[email protected] updating to | ||
example.com/badchain/[email protected]: parsing go.mod: unexpected module path "example.com/badchain/wrong" | ||
-- upgrade-a-expected -- | ||
go get: example.com/badchain/[email protected] -> | ||
example.com/badchain/[email protected] -> | ||
-- update-a-expected -- | ||
go get: example.com/badchain/[email protected] requires | ||
example.com/badchain/[email protected] requires | ||
example.com/badchain/[email protected]: parsing go.mod: unexpected module path "example.com/badchain/wrong" | ||
-- list-expected -- | ||
go: example.com/badchain/[email protected] -> | ||
example.com/badchain/[email protected] -> | ||
go: example.com/badchain/[email protected] requires | ||
example.com/badchain/[email protected] requires | ||
example.com/badchain/[email protected]: parsing go.mod: unexpected module path "example.com/badchain/wrong" |