diff options
author | Bryan C. Mills <bcmills@google.com> | 2021-02-19 14:03:45 -0500 |
---|---|---|
committer | Bryan C. Mills <bcmills@google.com> | 2021-03-02 17:08:12 +0000 |
commit | 09f4ef4fa73a110eefd2cb9d78439f51d9294f65 (patch) | |
tree | 962ddb489449a720968b070ed207d21529748a85 /src/cmd/go/internal/mvs/mvs_test.go | |
parent | c6374f516206c02b905d0d76ee1a66dab6fcd212 (diff) | |
download | go-09f4ef4fa73a110eefd2cb9d78439f51d9294f65.tar.gz go-09f4ef4fa73a110eefd2cb9d78439f51d9294f65.zip |
cmd/go/internal/mvs: prune spurious dependencies in Downgrade
Previously, mvs.Downgrade could introduce spurious dependencies if the
downgrade computed for one module lands on a “hidden” version (such as
a pseudo-version) due to a requirement introduced by the downgrade for
another module.
To eliminate those spurious dependencies, we can add one more call to
BuildList to recompute the “actual” downgraded versions, and then
including only those actual versions in the final call to BuildList.
For #36460
Change-Id: Icc6b54aa004907221b2bcbbae74598b0e4100776
Reviewed-on: https://go-review.googlesource.com/c/go/+/294294
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>
Diffstat (limited to 'src/cmd/go/internal/mvs/mvs_test.go')
-rw-r--r-- | src/cmd/go/internal/mvs/mvs_test.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cmd/go/internal/mvs/mvs_test.go b/src/cmd/go/internal/mvs/mvs_test.go index 661f68be08..598ed66688 100644 --- a/src/cmd/go/internal/mvs/mvs_test.go +++ b/src/cmd/go/internal/mvs/mvs_test.go @@ -282,8 +282,9 @@ downgrade A B1: A B1 # And C1 requires B2.hidden, and B2.hidden also meets our requirements: # it is compatible with D1 and a strict downgrade from B3. # -# BUG(?): B2.hidden does not require E1, so there is no need for E1 -# to appear in the final build list. Nonetheless, there it is. +# Since neither the initial nor the final build list includes B1, +# and the nothing in the final downgraded build list requires E at all, +# no dependency on E1 (required by only B1) should be introduced. # name: downhiddenartifact A: B3 C2 @@ -298,7 +299,7 @@ D2: build A1: A1 B3 D2 downgrade A1 D1: A1 B1 D1 E1 build A: A B3 C2 D2 -downgrade A D1: A B2.hidden C1 D1 E1 +downgrade A D1: A B2.hidden C1 D1 # Both B3 and C3 require D2. # If we downgrade D to D1, then in isolation B3 would downgrade to B1, |