From 80ac40b7e724913539a225423cec816a67de5f2d Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 3 Dec 2018 12:26:05 +0000 Subject: [PATCH] pkgconfig: do not generated dependency on itself If a project generates a single pc file but multiple shared libraries with dependencies on each other, the generated pc name will be used to generate a Requires.private dependency, which means the project will depend on itself. This breaks at least some versions of pkg-config (0.27 in RHEL7) which cannot handle the recursion and error out. When adding the dependency using the pc name, check that it's not on the project itself. Fixes #4583 --- mesonbuild/modules/pkgconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 52285c25c..708695af0 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -93,7 +93,7 @@ class DependenciesHelper: for d in pcdeps: processed_reqs.append(d.name) self.add_version_reqs(d.name, obj.version_reqs) - elif hasattr(obj, 'generated_pc'): + elif hasattr(obj, 'generated_pc') and obj.generated_pc != self.name: processed_reqs.append(obj.generated_pc) elif isinstance(obj, dependencies.PkgConfigDependency): if obj.found():