sourcegraph / go-vcs

manipulate and inspect VCS repositories in Go
https://sourcegraph.com/sourcegraph/go-vcs
Other
79 stars 20 forks source link

vcs/git: build failure due to import path change in a dependency #113

Closed dmitshur closed 5 years ago

dmitshur commented 5 years ago

The latest version of the sourcegraph.com/sourcegraph/go-vcs/vcs/git package fails to build:

$ go version
go version go1.12.9 darwin/amd64
$ export GOPATH=$(mktemp -d)
$ go get sourcegraph.com/sourcegraph/go-vcs/vcs/git
/tmp/3p9J1dXg/src/github.com/Unknwon/cae/tz/tz.go:27:2: case-insensitive import collision: "github.com/unknwon/cae" and "github.com/Unknwon/cae"

This is because sourcegraph.com/sourcegraph/go-vcs/vcs/git imports sourcegraph.com/sourcegraph/go-git:

https://github.com/sourcegraph/go-vcs/blob/d784c9520ccdd19883f59efd0a2ae4441f576582/vcs/git/repo.go#L10

And sourcegraph.com/sourcegraph/go-git imports github.com/Unknwon/cae:

https://github.com/sourcegraph/go-git/blob/5768d0da5d809e85d30fdf69e6fea996d9b35c40/commit_archive.go#L8-L10

But github.com/Unknwon/cae has recently changed its import path to github.com/unknwon/cae (lower case 'u'):

https://github.com/unknwon/cae/commit/55a0b64484a12115b7322b9eed01e2c26113061d

I'm reporting the problem here rather than in the https://github.com/sourcegraph/go-git issue tracker, because that repository has been archived and is read-only.

The fix is a 3 line change like in https://github.com/smlrepo/go-git/commit/8eddcb03fd7ad072bf7a7ccadd497a327850beee.

/cc @unknwon

keegancsmith commented 5 years ago

cc @unknwon

unknwon commented 5 years ago

Thanks for the report! Please see https://github.com/sourcegraph/go-vcs/pull/114.

unknwon commented 5 years ago

With merge of https://github.com/sourcegraph/go-git/pull/4, this issue should be fixed.

I did a test with command go get sourcegraph.com/sourcegraph/go-vcs/vcs/git and don't see the error message anymore.

dmitshur commented 5 years ago

It is fixed by https://github.com/sourcegraph/go-git/pull/4, thank you!