我有板条箱A
取决于B
and B
取决于rust-nmea https://github.com/Dushistov/rust-nmea crate.
如果我建造箱子A
我遇到了很多错误(所有错误都错过了)use std::error::Error;
)在构建期间rust-nmea https://github.com/Dushistov/rust-nmea依赖性:
error[E0599]: no method named `description` found for type `nom::Err<&[u8]>` in the current scope
--> /home/evgeniy/.cargo/registry/src/github.com-1ecc6299db9ec823/nmea-0.0.6/src/parse.rs:100:44
|
100 | IError::Error(e) => e.description().to_string(),
| ^^^^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope
= note: the following trait is implemented but not in scope, perhaps add a `use` for it:
candidate #1: `use std::error::Error;`
但是如果我去源树B
装箱并运行cargo build
,
所有构建都没有任何错误(如果你关注我A
取决于B
and B
取决于rust-nmea https://github.com/Dushistov/rust-nmea),
另外如果去/home/evgeniy/.cargo/registry/src/github.com-1ecc6299db9ec823/nmea-0.0.6/
(参见编译错误)并运行cargo build
那么一切都好。
货物树展示A
:
│ ├── chrono v0.4.0
│ │ ├── num v0.1.40
│ │ │ ├── num-integer v0.1.35
│ │ │ │ └── num-traits v0.1.40
│ │ │ ├── num-iter v0.1.34
│ │ │ │ ├── num-integer v0.1.35 (*)
│ │ │ │ └── num-traits v0.1.40 (*)
│ │ │ └── num-traits v0.1.40 (*)
│ │ └── time v0.1.38
│ │ └── libc v0.2.27
├── nmea v0.0.6
│ ├── chrono v0.4.0 (*)
│ └── nom v3.2.0
│ └── memchr v1.0.1 (*)
并由以下缓存:cargo
rust-nmea https://github.com/Dushistov/rust-nmea:
├── chrono v0.4.0
│ ├── num v0.1.40
│ │ ├── num-integer v0.1.35
│ │ │ └── num-traits v0.1.40
│ │ ├── num-iter v0.1.34
│ │ │ ├── num-integer v0.1.35 (*)
│ │ │ └── num-traits v0.1.40 (*)
│ │ └── num-traits v0.1.40 (*)
│ └── time v0.1.38
│ └── libc v0.2.27
└── nom v3.2.0
└── memchr v1.0.1
└── libc v0.2.27 (*)
因此,无论好坏情况,都使用相同的依赖项。
If run cargo build -v -j1
, I got rustc
两种情况的命令行。
好坏情况的唯一区别是这部分:
-L dependency=/home/evgeniy/.cargo/registry/src/github.com-1ecc6299db9ec823/nmea-0.0.6/target/debug/deps --extern chrono=/home/evgeniy/.cargo/registry/src/github.com-1ecc6299db9ec823/nmea-0.0.6/target/debug/deps/libchrono-8e9e54e691d9b988.rlib --extern nom=/home/evgeniy/.cargo/registry/src/github.com-1ecc6299db9ec823/nmea-0.0.6/target/debug/deps/libnom-b72336f662b090c1.rlib
坏情况有不同的库路径和libnom-e2ec53418967eac0.rlib
代替libnom-b72336f662b090c1.rlib
, while libchrono-8e9e54e691d9b988.rlib
match.
板条箱A
and B
是闭源的,我无法将问题简化为更简单的情况。nom https://github.com/Geal/nom板条箱未用于A
and B
除了通过rust-nmea https://github.com/Geal/nom.
rust-nmea https://github.com/Geal/nom使用方式很简单,只需nmea = 0.0.6
in Cargo.toml
。
没有旗帜之类的东西。
知道为什么使用相同的标志创建依赖关系(根本没有标志)
可能产生或不产生语法错误?