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

@bonzini bonzini force-pushed the cargo-object branch 4 times, most recently from 54a06b6 to d9eb84a Compare October 2, 2025 10:00
@bonzini bonzini force-pushed the cargo-object branch 2 times, most recently from e9b49dc to 294fcfa Compare October 2, 2025 11:42
@bonzini bonzini force-pushed the cargo-object branch 3 times, most recently from 4353776 to 113afd8 Compare October 17, 2025 16:53
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