diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2024-03-09 18:44:40 -0500 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2024-10-24 11:00:10 -0400 |
commit | afd89440aaf114c00652d799b8043d3d43fb807a (patch) | |
tree | 7c700f9d4fa9444c75a76ee874edb9f8f77ac994 /docs/markdown/snippets | |
parent | c02e0b7b1e2499f3ae18d26e443e18043fff3046 (diff) | |
download | meson-afd89440aaf114c00652d799b8043d3d43fb807a.zip meson-afd89440aaf114c00652d799b8043d3d43fb807a.tar.gz meson-afd89440aaf114c00652d799b8043d3d43fb807a.tar.bz2 |
cargo: Fix feature resolution
Introduce a global Cargo interpreter state that keeps track of enabled
features on each crate.
Before generating AST of a Cargo subproject, it downloads every
sub-subproject and resolves the set of features enabled on each of them
recursively. When it later generates AST for one its dependencies, its
set of features and dependencies is already determined.
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r-- | docs/markdown/snippets/cargo_features.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/markdown/snippets/cargo_features.md b/docs/markdown/snippets/cargo_features.md new file mode 100644 index 0000000..26f1bff --- /dev/null +++ b/docs/markdown/snippets/cargo_features.md @@ -0,0 +1,14 @@ +## Cargo features are resolved globally + +When configuring a Cargo dependency, Meson will now resolve its complete +dependency tree and feature set before generating the subproject AST. +This solves many cases of Cargo subprojects being configured with missing +features that the main project had to enable by hand using e.g. +`default_options: ['foo-rs:feature-default=true']`. + +Note that there could still be issues in the case there are multiple Cargo +entry points. That happens if the main Meson project makes multiple `dependency()` +calls for different Cargo crates that have common dependencies. + +Breaks: This change removes per feature Meson options that were previously +possible to set as shown above or from command line `-Dfoo-rs:feature-foo=true`. |