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: cannot find module for gonum.org/v1/gonum/stat/distmv #26632

Closed
pwaller opened this issue Jul 26, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@pwaller
Copy link
Contributor

commented Jul 26, 2018

I'm running the master branch as of this morning: 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 as I 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/distmv latest
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

Apologies that I don't have time to dig deeper into this at the moment. One possible culprit seems to be build tags, as mentioned in the gonum vgo meta issue.

Other discussion: golang-dev thread.

@rogpeppe

This comment has been minimized.

Copy link
Contributor

commented Jul 27, 2018

FWIW I can't reproduce this (go version devel +b39fb9ec85 Fri Jul 27 16:29:52 2018 +0000 linux/amd64
).

What git version are you using?

@pwaller

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2018

What git version are you using?

git version 2.7.4

Here's the output of go mod -sync:

$ go mod -sync -x
# /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030 for git2 https://github.com/gonum/gonum
cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git ls-remote -q https://github.com/gonum/gonum
0.392s # cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git ls-remote -q https://github.com/gonum/gonum
go: finding gonum.org/v1/gonum/stat/distmv latest
cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git -c log.showsignature=false log -n1 --format=format:%H %ct %D cebdade430ccb61c1feba4878085f6cf8cb3320e
0.002s # cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git -c log.showsignature=false log -n1 --format=format:%H %ct %D cebdade430ccb61c1feba4878085f6cf8cb3320e
cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git tag -l
0.002s # cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git tag -l
cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git fetch -f --depth=1 https://github.com/gonum/gonum cebdade430ccb61c1feba4878085f6cf8cb3320e:refs/dummy
0.345s # cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git fetch -f --depth=1 https://github.com/gonum/gonum cebdade430ccb61c1feba4878085f6cf8cb3320e:refs/dummy
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

If I run cd /home/pwaller/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030; git fetch -f --depth=1 https://github.com/gonum/gonum cebdade430ccb61c1feba4878085f6cf8cb3320e:refs/dummy, it returns exit status 1.

git cat-file -p cebdade430ccb61c1feba4878085f6cf8cb3320e works just fine in a fresh clone, but not from the /mod/cache/vcs/... directory, (I also tried setting GIT_DIR to point there, but I get back:

~/.local/src/mod/cache/vcs/4ad966aa57dadda5e35c195a5db2854067afd6f28b21af1b907991523a199030$ GIT_DIR=. git cat-file -p cebdade430ccb61c1feba4878085f6cf8cb3320e
fatal: Not a valid object name cebdade430ccb61c1feba4878085f6cf8cb3320e

The git fetch doesn't print any errors, so that's weird.

In case it's relevant, I also have this set in my $HOME/.gitconfig:

[url "ssh://git@github.com/"]
         insteadOf = https://github.com/
         insteadOf = git://github.com/
@pwaller

This comment has been minimized.

Copy link
Contributor Author

commented Jul 31, 2018

I can't currently reproduce this unfortunately, and I don't know what caused it to be fixed. Perhaps a bad cache from a previous dev version of go/vgo.

Closing, will reopen if I hit it again.

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.