Skip to content
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

Resolve feature and optional dependencies for workspace as a whole #5210

Open
ishitatsuyuki opened this issue Mar 20, 2018 · 1 comment
Open
Labels
A-features Area: features — conditional compilation A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@ishitatsuyuki
Copy link
Contributor

ishitatsuyuki commented Mar 20, 2018

Currently, a dependency's feature set is determined by what package is getting built, without considering other packages in the workspace. This will likely cause a crate to be compiled more than once with different feature sets.

Instead, we should consider the full workspace when resolving features. We have a few choices:

  • Assuming all of the features are enabled when resolving/compiling dependencies
    This will minimize the possibility we will be building a crate twice, but this can be unwanted behavior sometimes.
  • Assuming default features for all crate in the workspace
    This will be less surprising though it doesn't cover all the feature combinations that are possible.

Note that specifying features in workspace doesn't work anyway ¯\_(ツ)_/¯: #5015

Related: #4463

@epage
Copy link
Contributor

epage commented Oct 18, 2023

As a workaround, there is https://crates.io/crates/cargo-hakari to help create a "workspace hack" that enables all of the relevant features for all packages.

We have competing needs

  • Workspaces that publish their content independently need to be able to have their features tested individually
  • Workspaces with a product broken into packages need a quick way to move around the product and build pieces without rebuilding dependencies with different features selected

The challenge will be in having a solution that easily let's people navigate between those needs, including when they co-exist within the same workspace.

@epage epage added the S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. label Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-features Area: features — conditional compilation A-workspaces Area: workspaces C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

4 participants