aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2025-01-07 17:54:33 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2025-01-07 17:54:33 +0200
commitcfcc04f85bfe6b543e5e3d09cf698d5922c981de (patch)
tree50f1bde81ccd17c78ade59b32b67495a53af133a
parent3741a1d173bd189bdf1b29f46e684bb668e71d5c (diff)
downloadmeson-fixenvfail.zip
meson-fixenvfail.tar.gz
meson-fixenvfail.tar.bz2
Debug CI build failure.fixenvfail
-rw-r--r--mesonbuild/dependencies/pkgconfig.py2
-rw-r--r--unittests/internaltests.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py
index c6e6a5e..84abc5e 100644
--- a/mesonbuild/dependencies/pkgconfig.py
+++ b/mesonbuild/dependencies/pkgconfig.py
@@ -128,6 +128,8 @@ class PkgConfigCLI(PkgConfigInterface):
self._detect_pkgbin(pkgbin)
if self.pkgbin and not silent:
mlog.log('Found pkg-config:', mlog.green('YES'), mlog.bold(f'({self.pkgbin.get_path()})'), mlog.blue(self.pkgbin_version))
+ if self.env.get_build_dir() is None:
+ raise RuntimeError('Build dir missing from enviroment object.')
def found(self) -> bool:
return bool(self.pkgbin)
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index 69f52a4..ca1f5be 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -626,7 +626,7 @@ class InternalTests(unittest.TestCase):
with tempfile.TemporaryDirectory() as tmpdir:
pkgbin = ExternalProgram('pkg-config', command=['pkg-config'], silent=True)
- env = get_fake_env()
+ env = get_fake_env(bdir='.')
compiler = detect_c_compiler(env, MachineChoice.HOST)
env.coredata.compilers.host = {'c': compiler}
env.coredata.optstore.set_value_object(OptionKey('c_link_args'), FakeCompilerOptions())