Closed JRMeyer closed 2 years ago
Cargo install is more akin to a package manager, you need to add it as a dependency in your project's Cargo.toml to use it in your project
What would it take to make it installable via 'cargo install'? It seems the Dev experience would have less friction that way, no?
Cargo.toml is the typical way of adding a new library dependency, and cargo install
is just for executables, not for libraries.
From the Rust book (https://doc.rust-lang.org/book/ch14-04-installing-binaries.html):
The
cargo install
command allows you to install and use binary crates locally. This isn’t intended to replace system packages; it’s meant to be a convenient way for Rust developers to install tools that others have shared on crates.io. Note that you can only install packages that have binary targets. A binary target is the runnable program that is created if the crate has a src/main.rs file or another file specified as a binary, as opposed to a library target that isn’t runnable on its own but is suitable for including within other programs. Usually, crates have information in the README file about whether a crate is a library, has a binary target, or both.
Remember that a crate is a collection of Rust source code files. The project we’ve been building is a binary crate, which is an executable. The rand crate is a library crate, which contains code intended to be used in other programs, and can’t be executed on its own.
This crate (coqui-stt
) and its FFI binding variant (coqui-stt-sys
) both qualify as library crates that do nothing on their own.
However, there is a binary crate that adds cargo add
, which would do exactly what you're trying to do, and it would add it to the current Rust project: https://github.com/killercup/cargo-edit
This turned into a bit of a wall of text, sorry about that :P
Hi @tazz4843 -- the wall of text is super informative! thanks for taking the time to elaborate to me, a Rust noob 💚
I'll close this comment because you're already doing exactly what makes sense:)
Thanks again for open-sourcing this! Feel free to come chat in the 🐸STT chatrooms :D gitter.im/coqui-ai/STT
Hi there @tazz4843 👋
forgive my Rust ignorance:)
I was hoping to have an easy install with
cargo install
, but I get this error:I see what the error message, and what little I've read says this could be used as a dependency.
If it would make sense, I think it would be a great dev experience to install via a package manager like cargo
thanks for open-sourcing this btw!