Debug CI build failure.
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 @@
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 @@
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())