]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/mvs: omit modules at version "none" in BuildList and Req
authorBryan C. Mills <bcmills@google.com>
Thu, 29 Oct 2020 01:29:19 +0000 (21:29 -0400)
committerBryan C. Mills <bcmills@google.com>
Fri, 30 Oct 2020 18:05:46 +0000 (18:05 +0000)
For #37438

Change-Id: Icb28035ae4027aa09d8959d4ac2f4b94a6c843a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/266339
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Bryan C. Mills <bcmills@google.com>

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

index ea23a9f45e172aaafdc174994438bd1bd3d61a1b..3524a7a90eec557db9e3a38e22337e3a84a4e850 100644 (file)
@@ -120,7 +120,9 @@ func buildList(target module.Version, reqs Reqs, upgrade func(module.Version) (m
                }
                node.required = required
                for _, r := range node.required {
-                       work.Add(r)
+                       if r.Version != "none" {
+                               work.Add(r)
+                       }
                }
 
                if upgrade != nil {
@@ -208,6 +210,9 @@ func buildList(target module.Version, reqs Reqs, upgrade func(module.Version) (m
                n := modGraph[module.Version{Path: path, Version: vers}]
                required := n.required
                for _, r := range required {
+                       if r.Version == "none" {
+                               continue
+                       }
                        v := min[r.Path]
                        if r.Path != target.Path && reqs.Max(v, r.Version) != v {
                                panic(fmt.Sprintf("mistake: version %q does not satisfy requirement %+v", v, r)) // TODO: Don't panic.
index 9a30a8c3ac0679ccdb123571588eda1e544cef5c..f6f07b200eac3e6479048ea7b979e038ed118f40 100644 (file)
@@ -317,6 +317,13 @@ B1: X2
 X1: I1
 X2: 
 req M: A1 B1
+
+name: reqnone
+M: Anone B1 D1 E1
+B1: Cnone D1
+E1: Fnone
+build M: M B1 D1 E1
+req M: B1 E1
 `
 
 func Test(t *testing.T) {