Could not find `Cargo.toml` when building dependent box on GitHub

I am trying to use rust-mosquitto library . My current Cargo.toml :

 [package] name = "HomeDaemon" version = "0.1.0" authors = ["RTR < k.teza1@gmail.com >"] [dependencies.mosquitto] git = "https://github.com/kteza1/rust-mosquitto" 

When I run cargo build , the following error is reported:

 Could not find `Cargo.toml` in `/Users/ravitejareddy/.cargo/git/checkouts/rust-mosquitto-8203e77dcf072bf7/rust-mosquitto` 

The actual download at ~/.cargo/git/checkouts/rust-mosquitto-8203e77dcf072bf7/master indicates that Cargo.toml present.

There is an extra rust-mosquitto in the above path, is this a problem?

+5
source share
1 answer

The problem arises from Cargo.toml in / ticktock examples :

 [dependencies.mosquitto] version = "*" path = "../../../rust-mosquitto" 

When you load your project from git, all subdirectories are scanned for more Cargo.toml files. If you run RUST_LOG=trace cargo build -v , you will see what happens:

 TRACE:cargo::ops::cargo_read_manifest: looking for root package: /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master, source_id=https://github.com/kteza1/rust-mosquitto#7e08a291 TRACE:cargo::ops::cargo_read_manifest: looking for child package: /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master TRACE:cargo::ops::cargo_read_manifest: read_package; path=/Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/Cargo.toml; source-id=https://github.com/kteza1/rust-mosquitto#7e08a291 TRACE:cargo::ops::cargo_read_manifest: looking for child package: /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/.git TRACE:cargo::ops::cargo_read_manifest: not processing /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/.git TRACE:cargo::ops::cargo_read_manifest: looking for child package: /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/examples TRACE:cargo::ops::cargo_read_manifest: looking for child package: /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/examples/c-mosquitto TRACE:cargo::ops::cargo_read_manifest: looking for child package: /Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/examples/ticktock TRACE:cargo::ops::cargo_read_manifest: read_package; path=/Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/master/examples/ticktock/Cargo.toml; source-id=https://github.com/kteza1/rust-mosquitto#7e08a291 DEBUG:cargo: handle_error; err=CliError { error: ChainedError { error: Unable to update https://github.com/kteza1/rust-mosquitto, cause: Could not find `Cargo.toml` in `/Users/shep/.cargo/git/checkouts/rust-mosquitto-77eb7033f32b19c9/rust-mosquitto` }, unknown: false, exit_code: 101 } 

Then Cargo tries to make sure that the enclosed Cargo.toml can have all the dependent requests.

+5
source

All Articles