bmatsuo / lmdb-go

Bindings for the LMDB C library
BSD 3-Clause "New" or "Revised" License
157 stars 59 forks source link

How to build with glide? #75

Closed ghost closed 8 years ago

ghost commented 8 years ago

I'm using golang v1.6.1, and glide for vendor manage.

I run

glide rebuild 

In my project, which has been add to $GOPATH, get error:

[WARN] The rebuild command is deprecated and will be removed in a future version
[WARN] Use the go install command instead
[INFO] Building dependencies.
[INFO] Running go build github.com/bmatsuo/lmdb-go
[WARN] Failed to run 'go install' for github.com/bmatsuo/lmdb-go: can't load package: package ./vendor/github.com/bmatsuo/lmdb-go: no buildable Go source files in /Users/zwb/Code/Go/queue/vendor/github.com/bmatsuo/lmdb-go

I hope to build lmdb-go first, so I can get auto-complete with gocode set lib-path.

bmatsuo commented 8 years ago

I think the problem is that glide needs you to specify subpackages explicitly. The lmdb package is at import path github.com/bmatsuo/lmdb-go/lmdb, not just github.com/bmatsuo/lmdb-go.

I think something like the following is what you need in your glide.yaml file in order to vendor lmdb-go with glide:

import:
  - package: github.com/bmatsuo/lmdb-go
    subpackages: [lmdb]

And, to make use of other subpackages like exp/lmdbsync you would just add them to the subpackages array.

ghost commented 8 years ago

@bmatsuo Thank you, this sloved my problem.