]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: fuse upgrading with downgrading in EditBuildList
authorBryan C. Mills <bcmills@google.com>
Sat, 6 Feb 2021 05:50:55 +0000 (00:50 -0500)
committerBryan C. Mills <bcmills@google.com>
Wed, 10 Mar 2021 21:00:16 +0000 (21:00 +0000)
commitb7f0fb6d9eb9a2c1b2beb9ecd58bdbf3571dd5cd
treeaa6fa1b2d19e868b3dc78314d377b199e31b1803
parenta1a3d33b0dbd42ab91b04ba19bbee48b55427d58
cmd/go/internal/modload: fuse upgrading with downgrading in EditBuildList

Previosly, EditBuildList performed an mvs.Upgrade followed by an
mvs.Downgrade, with the Downgrade building on the result of the
Upgrade. Unfortunately, that approach potentially folds in irrelevant
dependencies from the first Upgrade, which are then preserved
unnecessarily by the Downgrade (see mod_get_downup_artifact.txt).

Now, we use the initial Upgrade only to compute the maximum allowed
versions of transitive dependencies, and apply the module upgrades and
downgrades together in a single operation.

For #36460

Change-Id: I7590c137111fed4a3b06531c88d90efd49e6943a
Reviewed-on: https://go-review.googlesource.com/c/go/+/290770
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/cmd/go/internal/modload/buildlist.go
src/cmd/go/internal/modload/edit.go [new file with mode: 0644]
src/cmd/go/internal/modload/mvs.go
src/cmd/go/testdata/script/mod_get_downup_artifact.txt