Skip to content

Conversation

bonzini
Copy link
Collaborator

@bonzini bonzini commented Oct 1, 2025

This introduces a skeletal implementation of #14639.

For now, rust.workspace() returns an object with no methods but it triggers loading the toplevel Cargo.toml and using its [dependencies] section to prime feature resolution. For example, fixing the infamous sdroege/mandelbrot project only requires adding

ws = import('rust').workspace()

prior to the first invocation of dependency.

It is not meant to be a real implementation, but it shows why Cargo subprojects are currently broken and what logic is missing.

Fixes: #13404
Fixes: #14290

rust.workspace() is the entry point for global feature resolution.
It loads a Cargo.toml file and ensures that all dependencies will be
built with the correct set of features.

Fixes: mesonbuild#13404
Add features property to cargo.Interpreter to make default features configurable;
customization of which features are enabled by default is triggered by
rust.workspace().

Fixes: mesonbuild#14290
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to disable default-features on rust dependencies? When compiling Rust project with meson, dependencies' features are not fully resolved

1 participant