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

Add cargo-machete and remove unnecessary dependencies 🔪 #890

Merged
merged 3 commits into from
May 13, 2022

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented May 9, 2022

cargo-machete is a tool designed to detect unnecessary dependencies in Rust crates. Having a similar goal as cargo-udep, it chooses some different trade-offs, which are explained in the blog post.

In godot-rust, machete detected 6 cases of unnecessary dependencies (of which 2 are between internal crates). I automated checks via CI action, which runs in less than a second -- most time is spent on cargo install, which is cached when possible. I needed to highlight one false positive (libc), which is fortunately a well-supported feature of machete. With the amount of proc-macros and code generation we deal with, I was surprised it wasn't more.

This addition should help us detect dependencies which are no longer needed, and slightly reduce initial compile time. It won't have a big effect on incremental compilation. We may need to monitor in the coming weeks if the removed dependencies cause issues in one way or another -- that would however also highlight a lack of coverage in our CI pipeline.

bors try

@Bromeon Bromeon added c: ci Component: CI and automation quality-of-life No new functionality, but improves ergonomics/internals labels May 9, 2022
@Bromeon Bromeon added this to the v0.10.1 milestone May 9, 2022
bors bot added a commit that referenced this pull request May 9, 2022
@bors

This comment was marked as outdated.

@Bromeon
Copy link
Member Author

Bromeon commented May 9, 2022

Android build failed due to network error.
bors try

bors bot added a commit that referenced this pull request May 9, 2022
@bors
Copy link
Contributor

bors bot commented May 9, 2022

try

Build succeeded:

@Bromeon
Copy link
Member Author

Bromeon commented May 10, 2022

bors try

bors bot added a commit that referenced this pull request May 10, 2022
@bors
Copy link
Contributor

bors bot commented May 10, 2022

try

Build succeeded:

@Bromeon
Copy link
Member Author

Bromeon commented May 13, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented May 13, 2022

Build succeeded:

@bors bors bot merged commit bebb783 into godot-rust:master May 13, 2022
@Bromeon Bromeon deleted the qol/unused-deps branch May 13, 2022 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: ci Component: CI and automation quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant