#140 cargo-inspector support the upstream --no-default-features option
Opened a year ago by pbrobinson. Modified 23 days ago

When building deps there may be requirements to disable optional functionality that's enabled by default. The upstream means of doing this [1] --no-default-features and then selecting explicit features you need explicitly enabled by adding --features "foo bar" but while the --features option is supported in cargo-inspector the --no-default-features is not which means you need to manually hack the metadata to achieve the same.

[1] https://github.com/behnam/rust-cargo/blob/3f5ca7b53f2fbf098dc6b60069fc1335b81727af/src/doc/manifest.md#usage-in-end-products

Isn't this already supported? The macros make me think it is:

Though I do not know if it works, as I have never needed to use it.

Not at least with the version in Fedora:

$ cargo-inspector -BR --no-default-features --features "chrono_crate serde_json"
usage: cargo-inspector [-h] (-n | -v | -rv | -t | -l | -P | -R | -BR | -TR) [-a | -f FEATURES] [file ...]
cargo-inspector: error: unrecognized arguments: --no-default-features
$ rpm -qf /usr/bin/cargo-inspector 

Hrm, okay. Looks like all other macros support the -n argument, but cargo-inspector does not. So you're right, that's definitely a missing feature.

Metadata Update from @decathorpe:
- Issue set to the milestone: 23

23 days ago

Login to comment on this ticket.