Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Add tool to help identify faulty Cargo features selections#11715

Closed
koenw wants to merge 1 commit intoparitytech:masterfrom
koenw:cargo_default_features_check
Closed

Add tool to help identify faulty Cargo features selections#11715
koenw wants to merge 1 commit intoparitytech:masterfrom
koenw:cargo_default_features_check

Conversation

@koenw
Copy link
Contributor

@koenw koenw commented Jun 20, 2022

As requested in Opstooling #55, add a tool to print dependency crates that have default-features = false but are not part of the std feature.

Usage: cargo run -p deps-check to recursively check all Cargo.tomls below the current directory or cargo run -p deps-check -- /path/to/Cargo.toml to check a specific Cargo.toml.

As requested in [Opstooling paritytech#55](https://github.com/paritytech/opstooling/issues/55), add
a tool to print dependency crates that have `default-features = false` but are not part of
the `std` feature.

Usage: `cargo run -p deps-check` to recursively check all `Cargo.toml`s below the current
directory or `cargo run -p deps-check -- /path/to/Cargo.toml` to check a specific
`Cargo.toml`.
@koenw koenw added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Jun 20, 2022
@bkchr
Copy link
Member

bkchr commented Jun 20, 2022

@shawntabrizi already has written such a tool or?

@shawntabrizi
Copy link
Member

@shawntabrizi
Copy link
Member

I think a rust version of this tool would be better. Happy to contribute to it.

I thought it would make sense for something like this to ultimately live in Diener?

@koenw
Copy link
Contributor Author

koenw commented Jun 22, 2022

Since everyone seems to agree this functionality should be part of Diener I'm closing this PR.

I opened a new PR to Diener instead: paritytech/diener#19.

@koenw koenw closed this Jun 22, 2022
@aurexav
Copy link
Contributor

aurexav commented Aug 4, 2022

This had already been implemented in subalfred.
See https://github.com/hack-ink/subalfred/blob/main/src/bin/subalfred/command/check/std_feature.rs.

And it was used by Darwinia CI for over a year.
See https://github.com/darwinia-network/darwinia/blob/main/.github/workflows/ci.yml#L114.

It also handles the new cargo feature ?/std.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants