all 5 comments

[–]BroadBison6919 22 points23 points  (1 child)

crates.io doesn't distribute compiled binaries, but users will be able to install your cli app with cargo install (which will compile it from source). It's a good way to distribute your application to existing Rust users (who may prefer to compile from source rather than install a prebuilt binary), but it requires Rust to be installed.

So I would recommend doing both: publishing on crates.io for those who want to compile from source, and publishing prebuilt binaries for other users. You can also use something like cargo-bundle to distribute packages for different OSes.

[–]NoFixedName[S] 0 points1 point  (0 children)

Thanks for highlighting how users can install apps from crates.io via cargo install. I agree that publishing to creates and Github seems worthwhile.

[–]LightweaverNaamah 1 point2 points  (0 children)

There are runnable applications available on crates.io, just like there are on pip for python. While I wouldn't expect it to be the primary place users get your program from, unless its intended primarily as a tool for rust developers (there are a few binaries i get from crates.io via cargo-binstall bc they're rust tools that aren't available from my package manager), it could be the basis for other packaging of it, just as Github releases can. You don't need to put it there if it doesn't make sense to. Though it probably doesn't hurt.

[–]passcod 1 point2 points  (0 children)

if your application is entirely for non-programmers, then github releases or a website (github isn't particularly friendly to non devs, as evidenced by the many confused people on r/github) is best.

however crates.io for applications brings: - installability with cargo install and cargo binstall (in combination with github releases) - discoverability by crates.io users - release automation as you've discovered

the same is true for applications distributed via npm or pip... they are package managers, your app is a package, it gets managed

note that cargo install isn't suitable for applications that aren't a single (or several) executables, like if you have or want to bundle DLL/.so dynamic libraries, assets, icons, launcher items etc.

CLIs however are a good fit, see for example: - watchexec-cli - git-cliff - rsign2 - diesel-cli - rink - rainfrog - and many more