diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-07 19:41:55 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-03-07 20:35:43 -0500 |
commit | 2540ad6e9e08370ddd0b6753fdc9314945a672f0 (patch) | |
tree | 33b5ecf5e4621653da6b3d7dece609f0eaddeb65 | |
parent | c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e (diff) | |
download | meson-2540ad6e9e08370ddd0b6753fdc9314945a672f0.zip meson-2540ad6e9e08370ddd0b6753fdc9314945a672f0.tar.gz meson-2540ad6e9e08370ddd0b6753fdc9314945a672f0.tar.bz2 |
fix correctly detecting whether python is found if link args are empty
There are two cases where we can assume we found the python dependency
with its requisite libraries using sysconfig:
- we found the library with find_library and are prepared to link to it
- the library is not actually part of the dependency, so its presence or
absence is irrelevant
In the latter case, we should consider it found if link_libpython is
False. Originally we did this, but the logic was inverted in commit
5b422fce87826beff3bca85e9c9081f22b3f45b7 in an unrelated change and
without explanation, likely by accident.
Normally this doesn't much matter, since a python invariably comes with
a predictably located libpython and the first condition evaluates true.
But that is not true for pypy, and in fact that is the reason the
link_libpython check was originally added in commit
1bd14b52b26b0f4ec207bf7e38813b82bfc15f86.
Restore that original logic.
Fixes #8570
-rw-r--r-- | mesonbuild/modules/python.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 486c63b..0f2d59f 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -158,7 +158,7 @@ class PythonSystemDependency(SystemDependency, _PythonDependencyBase): if largs is not None: self.link_args = largs - self.is_found = largs is not None or self.link_libpython + self.is_found = largs is not None or not self.link_libpython inc_paths = mesonlib.OrderedSet([ self.variables.get('INCLUDEPY'), |