Skip to content

Conversation

@bonzini
Copy link
Collaborator

@bonzini bonzini commented Oct 22, 2025

This introduces a skeletal implementation of #14639, which however is already relatable to what is implemented by the cmake module. In particular, workspace().subproject() works, and allows retrieving the overridden dependency as well as the Cargo features of the crate.

Current WIP full version: https://github.com/bonzini/meson/commits/cargo-object-full

Fixes: #13404
Fixes: #14290

@bonzini bonzini requested a review from jpakkane as a code owner October 22, 2025 17:07
@bonzini bonzini added module:rust Specific to the Rust module dependencies:cargo Issues related to using cargo subprojects labels Oct 22, 2025
@bonzini bonzini force-pushed the cargo-object branch 9 times, most recently from f3af508 to 834dd17 Compare October 23, 2025 15:37
@bonzini bonzini requested a review from dcbaker as a code owner October 23, 2025 15:37
@bonzini bonzini force-pushed the cargo-object branch 6 times, most recently from b724c84 to cd0097f Compare October 25, 2025 15:49
@bonzini bonzini requested a review from mensinda as a code owner October 25, 2025 15:49
@bonzini bonzini force-pushed the cargo-object branch 7 times, most recently from e2a1d59 to 33c8c6c Compare October 28, 2025 17:17
@bonzini bonzini force-pushed the cargo-object branch 2 times, most recently from 5e61207 to 41f55fe Compare October 29, 2025 11:45
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
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This is up to 2x faster because it avoids checks for pkg-config and cmake.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies:cargo Issues related to using cargo subprojects module:rust Specific to the Rust module

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