0

I want to use latest couchbase-rs version directly from github.

I managed successfully the couchbase dependency with:

couchbase = { git = "https://github.com/couchbaselabs/couchbase-rs", branch = "master"}

But I'm not able to use the couchbase-sys because it is a subdir of the couchbase-rs github project.

Is there a way to configure such dependency into Cargo.toml?

attdona
  • 17,196
  • 7
  • 49
  • 60
  • I believe your question is answered by the answers of [Can I add a dependent crate that is a subdirectory in a git repository?](https://stackoverflow.com/q/46786956/155423). If you disagree, please [edit] your question to explain the differences. Otherwise, we can mark this question as already answered. – Shepmaster May 15 '18 at 13:49
  • @Shepmaster I'm not sure that answers it because there are two crates in the same repo. – Peter Hall May 15 '18 at 13:54
  • @PeterHall but it works, no? Cargo scans through the entire repo looking for a matching Cargo.toml. – Shepmaster May 15 '18 at 13:54
  • @PeterHall I just compiled with `[dependencies] couchbase = { git = "https://github.com/couchbaselabs/couchbase-rs", branch = "master" } couchbase-sys = { git = "https://github.com/couchbaselabs/couchbase-rs", branch = "master" }` and it worked fine. – Shepmaster May 15 '18 at 14:01
  • @Shepmaster Oh yes, you are right. I forget that the LHS is the exact crate name. I always feel like that's just a label, which you could use to rename the crate even. Which was discussed but never done. It really _should_ work that way IMO. – Peter Hall May 15 '18 at 14:01
  • I compiled with `couchbase-sys = { git = "https://github.com/couchbaselabs/couchbase-rs", branch = "master", features = ["build-lcb"]}` without success: `thread 'main' panicked at 'Could not find include path from pkg config', libcore/option.rs:914:5` – attdona May 15 '18 at 15:07
  • @attdona I can not reproduce this behavior. Looks like you [haven't installed a required dependency](https://github.com/couchbaselabs/couchbase-rs/blob/41ceed4e30ab13a3acd960cac12e2633c01a31af/couchbase-sys/build.rs#L35-L44). – Shepmaster May 15 '18 at 16:08
  • Many thanks @shepmaster. Was a conflicting couchbase version installed on my machine. – attdona May 16 '18 at 08:53

0 Answers0