Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to hide transitive dependencies #2

Closed
ssokolow opened this issue Oct 9, 2021 · 7 comments
Closed

Option to hide transitive dependencies #2

ssokolow opened this issue Oct 9, 2021 · 7 comments

Comments

@ssokolow
Copy link

ssokolow commented Oct 9, 2021

Since my main use for cargo-feature-set is to inspect which features I may be able to turn off to speed up my builds, it'd be nice to have an option to show only crates listed directly in my Cargo.toml.

That way, I could get a listing of only the features I can actually turn off without patching dependencies.

@badboy
Copy link
Owner

badboy commented Oct 11, 2021

That's what -R / --root-deps-only gets you already.

@badboy badboy closed this as completed Oct 11, 2021
@ssokolow
Copy link
Author

Has that not been released yet? I cargo install'd cargo-feature-set just before opening that feature request and this is what --help looks like:

cargo-feature-set 0.4.0
Extract the features for every compiled crate from `cargo metadata`

USAGE:
    feature-set [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --features <features>...           Space-separated list of features to activate
        --manifest-path <manifest-path>    Path to Cargo.toml

@badboy
Copy link
Owner

badboy commented Oct 11, 2021

That could be it. I can do a release in a bit.

@badboy
Copy link
Owner

badboy commented Oct 11, 2021

0.5.0 is out

@ssokolow
Copy link
Author

ssokolow commented Oct 11, 2021

Thanks. :)

Is it supposed to only list the enabled features with no option to list available features? ...because that's how it appears to be working and the README is unclear on that point.

(If I only have one choice, enabled is more useful, but it'd be nice to have the option of listing all available choices.)

@badboy
Copy link
Owner

badboy commented Oct 11, 2021

Yes, it's only for features enabled in that invocation of the build (and it might be imprecise, thanks to build.rs, etc.).
If you need a list of all available features then I'm afraid you have to build that yourself.

@ssokolow
Copy link
Author

That's OK. I was just wondering. If I need a list of all available features, I can probably hack together a little script using PyTOML.

(5 minutes on the code to extract features from a list of Cargo.toml files, 15 to 50 minutes looking up the proper way to obey the configuration for where a Cargo install is configured to cache downloaded dependency sources.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants