]> Cypherpunks repositories - gostls13.git/commit
cmd/go: make 'go get' save sums for incidentally updated modules
authorJay Conrod <jayconrod@google.com>
Wed, 26 May 2021 19:29:39 +0000 (15:29 -0400)
committerJay Conrod <jayconrod@google.com>
Tue, 1 Jun 2021 12:20:06 +0000 (12:20 +0000)
commit0b80cf11366f28ef5d0d8bae9c46813e96ffd071
tree04f421bcd44ba19cd832f23cd69892261e835174
parent3b770f2ccb1fa6fecc22ea822a19447b10b70c5c
cmd/go: make 'go get' save sums for incidentally updated modules

When 'go get' updates a module, it may update another module in the
build list that provides a package in 'all' that wasn't loaded as part
of the 'go get' command. If 'go get' doesn't add a sum for that
module, builds may fail later.

With this change, 'go get' will fetch a sum for the content of an
updated module if we had a sum for the version before the update.

'go get' won't load the complete package graph, so there are still
cases where the build may be broken, like when an updated (but not
loaded) package imports a package from a new module.

Fixes #44129

Change-Id: I62eba3df4137a3e84e2ca8d549c36eec3670f08c
Reviewed-on: https://go-review.googlesource.com/c/go/+/322832
Trust: Jay Conrod <jayconrod@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/go/internal/modget/get.go
src/cmd/go/testdata/script/mod_get_update_unrelated_sum.txt [new file with mode: 0644]