Is it acceptable to register generally useful (utilities / applications) on crates.io?
The FAQ doesn't address this and from browsing, there are examples of end-user applications (mostly command line tools).
Or is crates.io? meant only for libraries?
I'm asking this because the documentation hints at library use, semantic versioning for API's etc. but doesn't reference the case for packaging applications explicitly.
Crate.io is a company of passionate, experienced team members who develop solutions for today's fast, data-intensive world.
The crate registry at crates.io distributes the source code of your packages, so it primarily hosts code that is open source.
Publishing a new version of an existing crate In order to release a new version, change the version value specified in your Cargo. toml manifest. Keep in mind the SemVer rules which provide guidelines on what is a compatible change. Then run cargo publish as described above to upload the new version.
Yes, because you can use cargo install
to install and manage those applications system-wide. If this use were discouraged, I would suspect that command to not exist at all, or at least have a very limited applicability.
Snippet from cargo install --help
:
Usage:
cargo install [options] [<crate>] cargo install [options] --list
[...]
This command manages Cargo's local set of installed binary crates. Only packages which have
[[bin]]
targets can be installed, and all binaries are installed into the installation root'sbin
folder. The installation root is determined, in order of precedence, by--root
,$CARGO_INSTALL_ROOT
, theinstall.root
configuration key, and finally the home directory (which is either$CARGO_HOME
if set or$HOME/.cargo
by default).There are multiple sources from which a crate can be installed. The default location is crates.io but the
--git
and--path
flags can change this source. If the source contains more than one package (such as crates.io or a git repository with multiple crates) the<crate>
argument is required to indicate which crate should be installed.
This should not be the primary reason to publish an application to crates.io, but I'm listing it here because it's still a good reason. :)
The Rust team will occasionally use a tool called crater to check for regressions on all crates published on crates.io, usually before merging a pull request that has uncertain consequences. If you wrote some code that happens to compile today but would stop compiling1 due to a bug fix in the compiler, then they may even submit a pull request to your project that fixes your code!
1 Usually, when such breaking changes occur, there's at least one prior release in which a warning will be reported before the warning is turned into an error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With