From cedbf5db2c96dcd80287bc7d0d16a5af9afb6f7f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 14 Feb 2023 14:52:39 -0500 Subject: python dependency: verify that the python header is installed for sysconfig We may or may not care that the library can be found. If link_libpython is false, we allow it to be missing and still find the dependency. (cherry picked from commit e22dd4345cad8e28536c83921a83915d50b56c69) [backported to apply pre-code move] # Conflicts: # mesonbuild/dependencies/python.py --- mesonbuild/modules/python.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 0c3d6a1..7e4469e 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -152,6 +152,9 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase): else: self._find_libpy(installation, environment) + if not self.clib_compiler.has_header('Python.h', '', environment, extra_args=self.compile_args): + self.is_found = False + def _find_libpy(self, python_holder: 'PythonInstallation', environment: 'Environment') -> None: if python_holder.is_pypy: if self.major_version == 3: -- cgit v1.1