Skip to content

Accumulate workspace features #784

Description

@musjj

What problem does this solve or what need does it fill?

Let's say you have a workspace like this:

.
├── Cargo.lock
├── Cargo.toml
├── src
│   └── main.rs
└── crates
    └── foo
        ├── Cargo.lock
        ├── Cargo.toml
        └── src
            └── main.rs

And the root crate has:

[package.metadata.bevy_cli.native.dev]
features = ["root"]

While the foo crate has:

[package.metadata.bevy_cli.native.dev]
features = ["bar"]

If you build the workspace with bevy build --workspace, bevy will run:

cargo build --workspace --features root --profile dev

It will ignore the features in workspace members.

What solution would you like?

bevy should accumulate all the features from the selected packages.

In the above example, bevy should run:

cargo build --workspace --features root,foo/bar --profile dev

What alternative(s) have you considered?

Build it with --all-features at the cost of extra compile time from features you're not really interested in.

Additional context

The documentation for the --features syntax:

Features of workspace members may be enabled with package-name/feature-name syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-FeatureMake something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions