]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: drop requirements on excluded versions
authorBryan C. Mills <bcmills@google.com>
Fri, 24 Jul 2020 21:43:55 +0000 (17:43 -0400)
committerBryan C. Mills <bcmills@google.com>
Mon, 24 Aug 2020 20:24:00 +0000 (20:24 +0000)
commit5a691927659d1057bb3be80087732b5df5889aca
tree22b4c659c5cca84e5f911e1375fb3aed6085a1df
parent5c76382762cfc34b7a7678668460f127fec4a35b
cmd/go/internal/modload: drop requirements on excluded versions

Previously, when we encountered an excluded version in any module's
requirements, we would resolve it to the next higher version.
Unfortunately, the meaning of “the next higher version” can change
over time.

Moreover, users who use 'exclude' directives normally either already
require some higher version (using the 'exclude' directive to prune
out invalid requirements from some intermediate version), or already
require some lower version (using the 'exclude' directive to prevent
'go get -u' from upgrading to a known-bad version). In both of these
cases, resolving an upgrade for the excluded version is needless work
even in the best case: it adds work for the 'go' command when there is
already a perfectly usable selected version of the module in the
requirement graph.

Instead, we now interpret the 'exclude' directive as dropping all
references to the excluded version.

This implements the approach described in
https://golang.org/issue/36465#issuecomment-572694990.

Fixes #36465
Updates #36460

Change-Id: Ibf0187daced417b4cc23b97125826778658e4b0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/244773
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/mvs.go
src/cmd/go/testdata/script/mod_require_exclude.txt