diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index a1aa2334495a..bbfb5bdbd40f 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -112,7 +112,12 @@ def find_tool(self, name: str, depname: str, varname: str, required: bool = True if dep.found() and dep.type_name == 'pkgconfig': value = dep.get_variable(pkgconfig=varname) if value: - return ExternalProgram(value) + progobj = ExternalProgram(value) + if not progobj.found(): + msg = (f'Dependency {depname!r} tool variable {varname!r} contains erroneous value: {value!r}\n\n' + 'This is a distributor issue -- please report it to your {depname} provider.') + raise mesonlib.MesonException(msg) + return progobj # Normal program lookup return self.find_program(name, required=required, wanted=wanted)