Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: cli installable using cargo-install #178

Open
clonejo opened this issue Dec 22, 2022 · 3 comments
Open

Feature Request: cli installable using cargo-install #178

clonejo opened this issue Dec 22, 2022 · 3 comments

Comments

@clonejo
Copy link

clonejo commented Dec 22, 2022

$ 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 rust-lang/cargo#4101.

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

@piegamesde
Copy link
Member

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 clonejo changed the title Bug: cli not installable using cargo-install Feature Request: cli installable using cargo-install Dec 23, 2022
@clonejo
Copy link
Author

clonejo commented Dec 23, 2022

Thank you for for clarification!

@werdahias
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants