]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go/internal/modload: prevent tidy downgrading disambiguating modules
authorJay Conrod <jayconrod@google.com>
Tue, 24 Aug 2021 18:51:07 +0000 (11:51 -0700)
committerJay Conrod <jayconrod@google.com>
Wed, 15 Sep 2021 17:32:52 +0000 (17:32 +0000)
commit6196979365ec6b527b3731c9ec13d7ddfe429f86
tree22e9a2a9195b8526dfda1b72fd23e756726e5674
parent72bb8185b5fb2fe84ee7cfdc8e9605f2c81b32fe
cmd/go/internal/modload: prevent tidy downgrading disambiguating modules

If an indirectly required module does not provide any packages needed
to build packages in the main module but is needed to disambiguate
imports, 'go mod tidy' may keep an indirect requirement on that module
to prevent it from being downgraded. This can prevent the introduction
of new ambiguities. This also ensures tidy keeps sums needed to load
all packages.

Fixes #47738

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