Support multiple cargo_metadata feature options#83
Support multiple cargo_metadata feature options#83bors[bot] merged 1 commit intorust-embedded:masterfrom mciantyre:cargo-metadata-features
Conversation
This tracks a patch in cargo-metadata that lets us call features() more than once to express more complex feature configurations. We introduced the change in cargo-metadata 0.10.1, but this commit jumps us to 0.11.
|
r? @therealprof (rust_highfive has picked a reviewer for you, use r? to override) |
|
Looks good to me in general. I do wonder whether |
|
The behaviors of // 1
if matches.is_present("all-features") {
metadata_command.features(CargoOpt::AllFeatures);
} else {
if matches.is_present("no-default-features") {
metadata_command.features(CargoOpt::NoDefaultFeatures);
}
if let Some(features) = matches.values_of("features") {
metadata_command.features(CargoOpt::SomeFeatures(
features.map(|s| s.to_owned()).collect(),
));
}
}which means that But, it's nonetheless valid for me to pass in all three feature options to # 2
cargo metadata --no-default-features --features foo --features my-dep/dep-feat --all-featuresI suppose it doesn't matter if the checks in this crate are mutually exclusive, so long as they represent (1). I can update the PR to (1) if you'd like. As of this writing, the PR assumes that the |
therealprof
left a comment
There was a problem hiding this comment.
Thanks for the explanation. LGTM then.
bors r+
|
Build succeeded: |
The PR follows #78, which did not correct
cargo_metadatafeature exclusivity. oli-obk/cargo_metadata#118 lets us combine feature options, like--no-default-features --features foo, so we can fix our usage here. As of this PR, the return ofcargo_metadatawill truly reflect whatever feature options the user passes tocargo-binutils.The
cargo_metadatachange was published in0.10.1, but this PR bumps to0.11, which is backwards compatible with0.10.