Skip to content

Conversation

hkrutzer
Copy link

What kind of change does this PR introduce?

Remove unnecessary dependencies using Cargo Shear

What is the current behavior?

N/a

What is the new behavior?

N/a

Additional context

https://crates.io/crates/cargo-shear

@laktek
Copy link
Contributor

laktek commented Aug 18, 2025

@nyannyacha we do need cargo-shear yeah?

@nyannyacha
Copy link
Contributor

@laktek Well... I'm not sure if we need this.

It's nice to have Catgo.toml leave only the dependencies it needs, but as far as I know, the tool doesn't detect dependencies used by code generated by proc macros, etc. (We'd eventually have to use the nightly version of the Rust toolchain to detect this as described in its docs).

Even if the unused dependencies are in Cargo.toml, this isn't necessary, as rustc's opt passes will elliminates all unused code.

@hkrutzer
Copy link
Author

Well, while dependencies used by generated code are not detected that is a hypothetical, while compiling unused dependencies, taking compile time and disk space, are a current tangible cost.

@hkrutzer hkrutzer closed this Aug 21, 2025
@nyannyacha
Copy link
Contributor

I think your point is mostly correct.

Unfortunately, I am not prioritizing this at the moment, so I think it would be best to leave it closed for now.
will review this PR in depth when the time comes.

Thank you for your efforts!

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

Successfully merging this pull request may close these issues.

3 participants