modules and build tags

197 views
Skip to first unread message

Peter Waller

unread,
Jul 26, 2018, 8:29:46 AM7/26/18
to golang-dev, Russ Cox, Bryan C. Mills, Dan Kortschak, Sebastien Binet
Hi,

(I'm running master as of a few hours ago, devel +e5b1340 Wed Jul 25 23:53:54 2018 +0000 linux/amd64)

The following ("importing gonum.org/v1/gonum/stat/distmv and syncing") does not work, and I might expect it to:

$ mkdir tmp && cd tmp
$ go mod -init -module foo.to/tmp
go: creating new go.mod: module foo.to/tmp

$ echo $'package tmp\nimport "gonum.org/v1/gonum/stat/distmv"' > tmp.go

$ go mod -sync
go: finding gonum.org/v1/gonum/stat latest
go: finding gonum.org/v1/gonum latest
go: import "foo.to/tmp" ->
import "gonum.org/v1/gonum/stat/distmv": cannot find module providing package gonum.org/v1/gonum/stat/distmv

I reported this on gonum, and there is some discussion there: https://github.com/gonum/gonum/issues/454#issuecomment-408017101

I don't know how to proceed. Is the problem a module import cycle, or is it to do with build tags? Is it in Go, or gonum? I don't have time to dig in to this at the moment.

* Should I file an issue with Go, if so, what is the title? 
* Is there an easy workaround to make this work right now?

Thanks,

- Peter

Bryan C. Mills

unread,
Jul 26, 2018, 5:46:09 PM7/26/18
to Peter Waller, golang-dev, Russ Cox, dan.ko...@adelaide.edu.au, seb....@gmail.com
On Thu, Jul 26, 2018 at 8:29 AM Peter Waller <pe...@pdftables.com> wrote:
Hi,

(I'm running master as of a few hours ago, devel +e5b1340 Wed Jul 25 23:53:54 2018 +0000 linux/amd64)

The following ("importing gonum.org/v1/gonum/stat/distmv and syncing") does not work, and I might expect it to:

$ mkdir tmp && cd tmp
$ go mod -init -module foo.to/tmp
go: creating new go.mod: module foo.to/tmp

$ echo $'package tmp\nimport "gonum.org/v1/gonum/stat/distmv"' > tmp.go

$ go mod -sync
go: finding gonum.org/v1/gonum/stat latest
go: finding gonum.org/v1/gonum latest
go: import "foo.to/tmp" ->
import "gonum.org/v1/gonum/stat/distmv": cannot find module providing package gonum.org/v1/gonum/stat/distmv

I reported this on gonum, and there is some discussion there: https://github.com/gonum/gonum/issues/454#issuecomment-408017101

I don't know how to proceed. Is the problem a module import cycle, or is it to do with build tags? Is it in Go, or gonum? I don't have time to dig in to this at the moment.

Cyclic imports are explicitly ok.

https://golang.org/issue/26602 has a similar symptom (“cannot find module” for a subpackage). I don't know whether the underlying cause is the same.

* Should I file an issue with Go, if so, what is the title?

Sure! “cmd/go: cannot find module for gonum.org/v1/gonum/stat/distmv” would be a good start.
 
* Is there an easy workaround to make this work right now?

None that I'm aware of.

Peter Waller

unread,
Jul 26, 2018, 6:18:34 PM7/26/18
to Bryan C. Mills, golang-dev, Russ Cox, Dan Kortschak, Sebastien Binet
On Thu, 26 Jul 2018 at 22:46, Bryan C. Mills <bcm...@google.com> wrote:
* Should I file an issue with Go, if so, what is the title?

Sure! “cmd/go: cannot find module for gonum.org/v1/gonum/stat/distmv” would be a good start.

Reply all
Reply to author
Forward
0 new messages