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

Feature request: Check non-dev dependencies for default-features toggled off #482

Closed
wischli opened this issue May 2, 2023 · 4 comments
Closed
Labels
Feat Feature

Comments

@wischli
Copy link

wischli commented May 2, 2023

First of all, I would like to give thanks to you for this great tool. Been mainly using the check features feature which came in super nifty when try-runtime feats became more restrictive.

Anyway, I was wondering whether it would be much overhead to add a new feature which just lists/checks non develop dependencies for default-features toggled off. It still happens way too often that some dependency is loaded with std not turned off by mistake. As you know, finding that needle in the hay can be super fiddly. I envision subalfred to once again come to the rescue for such cases.

As an example, we imported a dependency example-dep in non-dev environment and added all missing features example-dep/std, example-dep/runtime-benchmarks as well as example-dep/try-runtime derived via subalfed as part of a Substrate update. However, by mistake the example-dep dependency was configured with default-features = true which we only found after digging through all 50 Cargo.toml diffs.

@aurexav aurexav added the Feat Feature label May 2, 2023
@aurexav
Copy link
Member

aurexav commented May 2, 2023

As an example, we imported a dependency example-dep in non-dev environment and added all missing features example-dep/std, example-dep/runtime-benchmarks as well as example-dep/try-runtime derived via subalfed as part of a Substrate update. However, by mistake the example-dep dependency was configured with default-features = true which we only found after digging through all 50 Cargo.toml diffs.

Sometimes, default-features doesn't mean no-std. How do we handle this?

I need some time to look into the cargo metadata to check if there is a way to detect this.

@wischli
Copy link
Author

wischli commented May 2, 2023

Sometimes, default-features doesn't mean no-std. How do we handle this?

I suppose it would be sufficient to list non-dev dependencies with default-features toggled on. For Substrate projects, we can expect this list to be rather small and then leave it up to custom caller handling of the individual cases IMO.

@aurexav
Copy link
Member

aurexav commented Jul 24, 2023

I have found a solution for this issue. The updated version will be published within the next few days, I believe.

@aurexav
Copy link
Member

aurexav commented Jul 27, 2023

https://github.com/hack-ink/cargo-featalign @wischli

@aurexav aurexav closed this as completed Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat Feature
Projects
None yet
Development

No branches or pull requests

2 participants