Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: `go mod -graph` erroneously lists edges from the main module to indirect dependencies #26489

bcmills opened this issue Jul 19, 2018 · 1 comment


None yet
2 participants
Copy link

commented Jul 19, 2018

In modload, we intentionally treat the main module as requiring the entire build list. (I don't recall why, but we do.)

list = append(list, r.buildList[1:]...)

Unfortunately, that interacts badly with go mod -graph, which fails to take the extra requirements into account. We end up printing spurious edges from the main module to all of its transitive dependencies.

$ cd $(mktemp -d)

$ go version
go version devel +f8f3e3a3b4 Thu Jul 19 14:17:14 2018 -0400 linux/amd64

$ git clone .
Cloning into '.'...
remote: Counting objects: 80, done.
remote: Total 80 (delta 0), reused 0 (delta 0), pack-reused 80
Unpacking objects: 100% (80/80), done.

$ cat go.mod

require ( v3.0.0 v1.3.0

$ go mod -graph
go: finding v1.3.0
go: finding v3.0.0

Note the spurious line:

Found while investigating #26474.

@bcmills bcmills added the NeedsFix label Jul 19, 2018

@bcmills bcmills added this to the Go1.11 milestone Jul 19, 2018

@bcmills bcmills added the modules label Jul 20, 2018


This comment has been minimized.

Copy link

commented Jul 24, 2018

Change mentions this issue: cmd/go: fix spurious edges in mod -graph output

@gopherbot gopherbot closed this in f37ca81 Jul 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.