From e1164f616db78050b935e85fbc2cdb9f731e1511 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 24 Oct 2025 14:55:15 -0700 Subject: dependencies: Require 'native' be passed in kwargs This simplifies a bunch of cases, and likely fixes some annoying bugs in cross compile situations where should have been passing this and weren't. --- mesonbuild/modules/python.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/modules/python.py') diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 96ba1e0f0..23b2aa788 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -170,7 +170,7 @@ class PythonInstallation(_ExternalProgramHolder['PythonExternalProgram']): new_deps = mesonlib.extract_as_list(kwargs, 'dependencies') pydep = next((dep for dep in new_deps if isinstance(dep, _PythonDependencyBase)), None) if pydep is None: - pydep = self._dependency_method_impl({}) + pydep = self._dependency_method_impl({'native': kwargs['native']}) if not pydep.found(): raise mesonlib.MesonException('Python dependency not found') new_deps.append(pydep) @@ -259,7 +259,7 @@ class PythonInstallation(_ExternalProgramHolder['PythonExternalProgram']): return '0x{:02x}{:02x}0000'.format(major, minor) def _dependency_method_impl(self, kwargs: DependencyObjectKWs) -> Dependency: - for_machine = kwargs.get('native', MachineChoice.HOST) + for_machine = kwargs['native'] identifier = get_dep_identifier(self._full_path(), kwargs) dep = self.interpreter.coredata.deps[for_machine].get(identifier) -- cgit v1.2.3