summaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2024-03-09 18:44:40 -0500
committerXavier Claessens <xclaesse@gmail.com>2024-10-24 11:00:10 -0400
commitafd89440aaf114c00652d799b8043d3d43fb807a (patch)
tree7c700f9d4fa9444c75a76ee874edb9f8f77ac994 /mesonbuild/environment.py
parentc02e0b7b1e2499f3ae18d26e443e18043fff3046 (diff)
downloadmeson-afd89440aaf114c00652d799b8043d3d43fb807a.tar.gz
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 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 2621b9ca2..81a23404a 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -45,6 +45,7 @@ if T.TYPE_CHECKING:
from .compilers import Compiler
from .wrap.wrap import Resolver
+ from . import cargo
CompilersDict = T.Dict[str, Compiler]
@@ -687,6 +688,8 @@ class Environment:
self.default_cmake = ['cmake']
self.default_pkgconfig = ['pkg-config']
self.wrap_resolver: T.Optional['Resolver'] = None
+ # Store a global state of Cargo dependencies
+ self.cargo: T.Optional[cargo.Interpreter] = None
def _load_machine_file_options(self, config: 'ConfigParser', properties: Properties, machine: MachineChoice) -> None:
"""Read the contents of a Machine file and put it in the options store."""