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

Clean up our dependency tree with cargo-hack #321

Open
smalis-msft opened this issue Nov 13, 2024 · 0 comments
Open

Clean up our dependency tree with cargo-hack #321

smalis-msft opened this issue Nov 13, 2024 · 0 comments
Labels
dependencies Something related to an external crate dependency

Comments

@smalis-msft
Copy link
Contributor

We currently have a cargo-machete-based check in xtask fmt that ensures that crates don't include dependencies that they don't use at all. While this check is fast, it isn't perfect.
 
Running a command like RUSTFLAGS=-Dunused-crate-dependencies cargo hack --workspace --feature-powerset check indicates a lot of cases where we are building dependencies that aren't actually being used for a particular configuration. For example: something used only by tests that is in dependencies instead of dev-dependencies, or something used only on one platform (windows vs linux) that is included globally, or something only needed when a feature is enabled that is always included, etc. None of these can be caught by our current cargo-machete-based approach. Cleaning all these up would be very tedious but would likely get us a little bit of compile time improvement.

@smalis-msft smalis-msft added the dependencies Something related to an external crate dependency label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Something related to an external crate dependency
Projects
None yet
Development

No branches or pull requests

1 participant