magic-wormhole / magic-wormhole.rs

Rust implementation of Magic Wormhole, with new features and enhancements
European Union Public License 1.2
648 stars 72 forks source link

Feature Request: cli installable using cargo-install #178

Closed clonejo closed 1 week ago

clonejo commented 1 year ago
$ cargo install magic-wormhole
    Updating crates.io index
error: there is nothing to install in `magic-wormhole v0.6.0`, because it has no binaries
`cargo install` is only for installing programs, and can't be used with libraries.
To use a library crate, add it as a dependency in a Cargo project instead.

Fails both with 0.5.0 and 0.6.0.

Might be related to https://github.com/rust-lang/cargo/issues/4101.

One workaround is to download the source and run cargo install --path=cli.

piegamesde commented 1 year ago

On the first level, the error message is right. magic-wormhole is a library and a library only. The CLI is a separate crate (although in the same repository in a shared workspace) and not currently published on crates.io. As far as I know cargo install magic-wormhole would require to make the CLI as binary of the same crate as the library, as opposed to two distinct ones. But I'm not sure about that.

Even when talking about publishing the CLI under a different name, there is still the restriction of having to use only crates.io dependencies in order to publish on crates.io. I am obviously forced to follow it for the library, but for the binary I had to use git dependencies several times in the past.

clonejo commented 1 year ago

Thank you for for clarification!

werdahias commented 1 month ago

also #227. You could do it similarly to prs; let the cli depend on a pinned version of the library

felinira commented 1 week ago

See https://github.com/magic-wormhole/magic-wormhole.rs/blob/main/cli/README.md