-
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
workspace.default-members causes cargo run --bin from-other-crate to fail with an unhelpful error #14544
Comments
Could you provide full reproduction steps and example failure output? |
cargo new crate1
cargo new crate2
[workspace]
members = ["crate1", "crate2"]
default-members = ["crate1"] and cargo r --bin crate2 gives
Alternatively, without
with
but it could be more helpful if it also looked at other workspace members and suggested |
From a users perspective, it seems reasonable to improve. My only question is how much it would take to get the right information into the right place. |
The cargo/src/cargo/util/workspace.rs Lines 12 to 18 in 3b784a4
cargo/src/cargo/ops/cargo_compile/packages.rs Lines 114 to 120 in 3b784a4
So And See the cargo/src/cargo/core/workspace.rs Lines 77 to 87 in 3b784a4
This is explains why We could use |
Problem
In a workspace with
default-members
set,cargo run --bin
considers only these members as expected. However, when specifying another workspace binary without-p
, the error message is unhelpful, because it doesn't hint which package needs to be selected.Steps
cargo run --bin other
where the binary is in the workspace, but not in the default workspace member.Possible Solution(s)
The error message could search other crates in the workspace and list which have a binary with the given name.
Notes
No response
Version
The text was updated successfully, but these errors were encountered: