GitHub

2015-07-22 15 views
5

से एक निर्भर क्रेट बनाने के दौरान `Cargo.toml` नहीं मिला, मैं rust-mosquitto library का उपयोग करने का प्रयास कर रहा हूं। मेरे वर्तमान Cargo.toml है:GitHub

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

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

जब मैं cargo build चलाने के लिए, निम्न त्रुटि रिपोर्ट की जाती है:

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

~/.cargo/git/checkouts/rust-mosquitto-8203e77dcf072bf7/master में वास्तविक डाउनलोड पता चलता है कि Cargo.toml मौजूद है।

ऊपर दिए गए पथ में एक अतिरिक्त rust-mosquitto है, क्या यह एक समस्या है?

उत्तर

5

समस्या अपने Cargo.toml in examples/ticktock से आता है:

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

जब Git से अपनी परियोजना को डाउनलोड करने, सभी सबडायरेक्टरियों अधिक Cargo.toml फ़ाइलों के लिए स्कैन कर रहे हैं। आप RUST_LOG=trace cargo build -v चलाते हैं, जैसा कि आप देख क्या हो रहा है:

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.toml निर्भरता संतुष्ट के सभी हो सकता है कोशिश करता है।

+0

लेकिन यह एक त्रुटि क्यों है? – tez

+2

@tez: क्योंकि आप * तीन * निर्देशिकाएं ऊपर जाते हैं, जब भंडार में केवल * दो * होते हैं। आपको प्रभावी रूप से यह आवश्यक है कि आपका भंडार * हमेशा * 'जंग-मच्छर'' नाम से चेक किया जाए और * और कुछ नहीं *। –

+0

ठीक है। गिट से डाउनलोड करते समय फ़ोल्डर संरचना भिन्न होती है जहां Cargo.toml शाखा नाम के अंदर रहता है। इस मामले में 'मास्टर'। – tez