Skip to content

Multiple Packages With Binaries Found #3049

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

Closed
mmstick opened this issue Aug 27, 2016 · 9 comments
Closed

Multiple Packages With Binaries Found #3049

mmstick opened this issue Aug 27, 2016 · 9 comments

Comments

@mmstick
Copy link

mmstick commented Aug 27, 2016

Having an odd issue which I can't figure out. If I install my Rust application with:

cargo install --git https://github.com/mmstick/parallel

I get this error:

error: multiple packages with binaries found: generate-files, libc-test, parallel

Yet if I install the application with this command:

cargo install parallel

It compiles perfectly.

@alexcrichton
Copy link
Member

Ah yeah if a git repository has multiple crates inside of it all with binaries Cargo has to know which one is actually being installed. The package on crates.io, however, is specific, so that's why that works instead.

Does this work for you?

cargo install --git https://github.com/mmstick/parallel parallel

@mmstick
Copy link
Author

mmstick commented Aug 29, 2016

That does work perfectly.

@mmstick mmstick closed this as completed Aug 29, 2016
@zimond
Copy link

zimond commented Feb 17, 2017

zzeroo added a commit to Kliemann-Service-GmbH/xmz-doc-development that referenced this issue Apr 21, 2018
I added the `-p` (paralell) parameter as mentioned in rust-lang/cargo#3049
@steveklabnik
Copy link
Member

https://doc.rust-lang.org/cargo/commands/cargo-install.html says

--bin name...
Install only the specified binary.
--bins
Install all binaries.

neither of these worked for me, still giving the error about wanting to know which of multiple packages to install, but passing the binary name as an argument like suggested in this issue did work.

@spease
Copy link

spease commented Dec 11, 2024

I have a git repo where I have adjacent directories that specify dependencies among them using eg dependency = { path = "../dependency" } and cargo install fails. Is this how you're supposed to reference intra-repo dependencies?

I also had to pass CARGO_NET_GIT_FETCH_WITH_CLI=true to even authenticate to the git server on macOS.

@epage
Copy link
Contributor

epage commented Dec 11, 2024

@spease this is a fairly old issue and it is unclear if its related to this issue. If this appears to be a bug, it might be good to create a new issue and include full reproduction steps. If this is a question on how to use Cargo, you might want to post on https://users.rust-lang.org/

@spease
Copy link

spease commented Dec 11, 2024

Sorry, maybe it's not clear how I arrived at this ticket.

If I run

CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git "ssh://user@host/home/user/repo"

I get Multiple Packages with Binaries Found.

If I run

CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git "ssh://user@host/home/user/repo" --bin app

which is what the --help suggests is the right option for what I'm trying to do, I get the same error. That's when I started googling and found this ticket.

If I use the suggested solution in this ticket

CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install --git "ssh://user@host/home/user/repo" app

then I get

failed to load manifest for workspace member...

Caused by:
  failed to load manifest for dependency `dependency`

I don't know if this is the best ticket, but it seems like this is broadly the same usability issue.

EDIT: Seems CARGO_NET_GIT_FETCH_WITH_CLI=true is no longer necessary since I added the --git parameter, but I'll leave it in my examples to avoid retesting all of them right now.

@epage
Copy link
Contributor

epage commented Dec 11, 2024

As you highlighted, something is going on with dependency but I can't really say much without a reproduction case.

@spease
Copy link

spease commented Dec 11, 2024

Figured it out. The issue was that an underlying dependency was outside the project tree as I had to modify a third-party library and the PR never got accepted or rejected, so I never updated the dependency to a permanent value. Opened #14924 to discuss making the error clearer.

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

6 participants