I use a lot of cargo sub-commands and maintain two of them (
cargo-llvm-ir), and I have only seen cargo subcommands that either:
- depend on cargo “as a library”, which requires re-compiling cargo, and statically linking it - this takes a while, particularly on CI, and each cargo subcommand becomes huge because of it - or
- do not depend on cargo - these allows the sub-commands to compile fast but often results in the sub-commands emulating whatever they need from cargo in some brittle way.
There has to be a better way. It should be possible for cargo subcommands to use the toolchain’s cargo as a library without having to recompile some potentially different version of cargo and statically link to it.
I mean, I just installed
cargo-tree in 11m 49s , I can’t use
cargo-travis on CI because it takes too long to compile (It used to take 15-20 min on travis-ci, I think now it takes ~5 minutes, but this is still nuts).