This is an annoyance in the compiler, or rather the
go tool that wraps the compiler. We build with a split
$GOPATH; the dependencies under
Godeps/_workspace are first in the path, and the “regular” path follows, something like
Thing is though, if you run (for example)
go get github.com/syndtr/goleveldb from a terminal with just the regular GOPATH, it’ll build that package and stash it in (on my setup)
/Users/jb/pkg. When you next clean and build syncthing, it’ll check for an existing compiled package of leveldb first in
.../Godeps/_workspace/pkg (which won’t exist), then in
/Users/jb/pkg (which does exist), and use the latter if those files are not older than the source files in the syncthing repo. Hence, possible mismatch.
On the other hand, this is just a sign of other breakage that would have happened had we not been using godeps; because then it would have compiled and built against the wrong version of goleveldb (or another dependency).
godep restore should check out the “syncthing versions” of all dependencies in your regular GOPATH, preventing this from happening. If you want that, and don’t have other things that depend on specific versions of them, etc etc.
This has mostly come up with goleveldb because that API has changed a bit lately… If the external API doesn’t change, this isn’t an issue.