-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Imply --all
argument for virtual manifest.
#4021
Comments
👍 |
I've started to try to implement this. However, as I said in #4016, I'm a rust beginner and my code might not be idiomatic ;) What I've tried for now is creating a method in pub fn is_virtual(&self) -> bool {
match *self.packages.get(&self.current_manifest) {
MaybePackage::Package(..) => false,
MaybePackage::Virtual(..) => true
}
} and then instead of let spec = if options.flag_all {
// ...
} I have this: let spec = if options.flag_all || ws.is_virtual() {
// ...
} Does it seem sound to you? Or is there a better way for the At first I thought of using the existing |
Should help close rust-lang#4021
Should help close rust-lang#4021
Rebased and fixed 4025: Apply --all if workspace is virtual - fixes #4021 - rebased #4025 - fixed issue issue described by @matklad in #4025 (review) - added test `build_virtual_manifest_one_project` which covers the fix
If I run
cargo build
in a workspace, I often get:The fix is to run
cargo build --all
instead. I think Cargo can figure this out automatically?If the current package is virtual, and we are running one of
--all
enabled commands,--all
should be the default.The fix would involve changing this logic in all relevant commands (there's quite a bit of duplication:( ).
The text was updated successfully, but these errors were encountered: