Closed
Description
Since #4335, --all
is implied for virtual workspaces. This is not appropriate in some cases (like Servo) for two reasons:
- Two of the "top-level" crates (
servo
andgeckolib
) both depend on the same library (style
) and each enable a corresponding Cargo feature. These features are mutually exclusive. (Compilingstyle
only works when exactly one of these two "modes" is enabled.) --all
includes all transitivepath
dependencies, even though one of those (task_info
) is normally only included through a[target.'cfg(target_os = "macos")'.dependencies]
section (and doesn’t compile on other platforms).
Both of these are probably unusual, so #4335 is still a good default. But I’d like there to be a way to opt into a different behavior. It could be something like this:
[workspace]
default-packages = ["servo"]
Running e.g. cargo build
at the top level without more arguments would behave like cargo build -p servo
instead of cargo build --all
.