2015-07-22 14 views
5

Próbuję użyć rust-mosquitto library. Mój obecny Cargo.toml jest:Nie można znaleźć `Cargo.toml` podczas budowania zależnej skrzynki od GitHub

[package] 
name = "HomeDaemon" 
version = "0.1.0" 
authors = ["RTR <[email protected]>"] 

[dependencies.mosquitto] 
git = "https://github.com/kteza1/rust-mosquitto" 

Kiedy biegnę cargo build po zgłaszany jest błąd:

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

Rzeczywista pobieranie w ~/.cargo/git/checkouts/rust-mosquitto-8203e77dcf072bf7/master pokazuje, że Cargo.toml jest obecny.

W powyższej ścieżce jest dodatkowy rust-mosquitto, czy to jest problem?

Odpowiedz

5

Problem pochodzi ze swoimi Cargo.toml in examples/ticktock:

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

Po pobraniu projektu z git, wszystkie podkatalogi są skanowane wiecej Cargo.toml plików. Jeśli prowadzisz RUST_LOG=trace cargo build -v, widzisz, co się dzieje: wtedy

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 } 

Cargo stara się zapewnić, że zagnieżdżona Cargo.toml może mieć wszystkie zależności spełnione.

+0

Ale dlaczego jest to błąd? – tez

+2

@tez: Ponieważ idziesz w górę * trzy * katalogi, gdy w repozytorium jest tylko * dwa *. Skutecznie wymagasz, aby twoje repozytorium * zawsze * było sprawdzane pod nazwą 'rust-mosquitto' i * nic innego *. –

+0

Ok. Struktura folderów jest inna podczas pobierania z git gdzie Cargo.toml znajduje się wewnątrz nazwy oddziału. "master" w tym przypadku. – tez

Powiązane problemy