Warning
This post was published 72 days ago. The information described in this article may have changed.
My project has two binaries (command line utilities) which make use of common functionality from a library crate. Unless there is a reason I shouldn't, I figure that I might as well publish the library on crates.io.
In this case, I might argue that there are three different public APIs in my package: one for each of the command line interfaces of the binary crates (e.g., if they are used in shell scripts), and one for the library crate that developers interact with in Rust. I could conceivably break the API of the library crate and bump the major version, but adapt both of the binary crates so that this is merely an implementation detail to them, and their command line interfaces stay the same. Therefore, I would want to keep the major version number the same for them.
I don't see a way in Cargo.toml to specify different versions for the library crate and each of the binary crates. Does that mean the best solution is to publish these crates as three separate packages? If this is the case, then how is the ability to have multiple crates in one package not moot in practice?
2 posts - 2 participants
🏷️ rust_feed