Skip to content

Commit 34665c6

Browse files
author
Bryan C. Mills
committed
cmd/go/internal/mvs: omit modules at version "none" in BuildList and Req
For #37438 Change-Id: Icb28035ae4027aa09d8959d4ac2f4b94a6c843a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/266339 Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Michael Matloob <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Bryan C. Mills <[email protected]>
1 parent fb184a3 commit 34665c6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/cmd/go/internal/mvs/mvs.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ func buildList(target module.Version, reqs Reqs, upgrade func(module.Version) (m
120120
}
121121
node.required = required
122122
for _, r := range node.required {
123-
work.Add(r)
123+
if r.Version != "none" {
124+
work.Add(r)
125+
}
124126
}
125127

126128
if upgrade != nil {
@@ -208,6 +210,9 @@ func buildList(target module.Version, reqs Reqs, upgrade func(module.Version) (m
208210
n := modGraph[module.Version{Path: path, Version: vers}]
209211
required := n.required
210212
for _, r := range required {
213+
if r.Version == "none" {
214+
continue
215+
}
211216
v := min[r.Path]
212217
if r.Path != target.Path && reqs.Max(v, r.Version) != v {
213218
panic(fmt.Sprintf("mistake: version %q does not satisfy requirement %+v", v, r)) // TODO: Don't panic.

src/cmd/go/internal/mvs/mvs_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,13 @@ B1: X2
317317
X1: I1
318318
X2:
319319
req M: A1 B1
320+
321+
name: reqnone
322+
M: Anone B1 D1 E1
323+
B1: Cnone D1
324+
E1: Fnone
325+
build M: M B1 D1 E1
326+
req M: B1 E1
320327
`
321328

322329
func Test(t *testing.T) {

0 commit comments

Comments
 (0)