-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo install --git finds binaries in crates that are not part of the root workspace #9011
Comments
This is an intentional design decision of |
@alexcrichton Can you clarify what you mean by "this" is a design decision? Do you mean: cargo intentionally finds all bin targets in a repository regardless of the workspace configuration in the |
This behavior is different than, e.g.
|
Yeah Cargo will walk the entire git repository looking for crates and determine the set of packages with binaries from that walk. Currently |
Problem
When running
cargo install
with a git repository,cargo
findsbin
targets in all crates in the repository, even if they are not part of the root workspace.artichoke/artichoke declares a
Cargo.toml
workspace like:The workspace is not virtual. There is a root crate that has two bin targets. These bin targets are the only binaries built by this root workspace.
Both
artichoke-fuzz
andspec-runner
are crates at the top-level of the repository, but are not part of the root workspace. These crates declare they are the sole member of a subworkspace with:I would expect to be able to run
cargo install --git https://github.com/artichoke/artichoke --branch trunk
without specifying a target crate, since the root workspace only has one crate with bin targets.Steps
Possible Solution(s)
Notes
Output of
cargo version
:The text was updated successfully, but these errors were encountered: