Skip to content

Add a 'worskpace.default-packages' config to override implied --all? #4507

Closed
@SimonSapin

Description

@SimonSapin

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 and geckolib) both depend on the same library (style) and each enable a corresponding Cargo feature. These features are mutually exclusive. (Compiling style only works when exactly one of these two "modes" is enabled.)
  • --all includes all transitive path 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions