From 27c5ac36c841b047391fae9378684e06dcffea93 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 10 Jul 2025 20:10:23 +0200 Subject: scalapack: Fix exception when MKLROOT is unset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix `scalapack.MKLPkgConfigDependency` not to crash when `MKLROOT` is unset: ``` File "/meson/mesonbuild/dependencies/scalapack.py", line 65, in __init__ super().__init__(name, env, kwargs, language=language) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/meson/mesonbuild/dependencies/pkgconfig.py", line 322, in __init__ self._set_cargs() ~~~~~~~~~~~~~~~^^ File "/meson/mesonbuild/dependencies/scalapack.py", line 141, in _set_cargs cflags = self.pkgconfig.cflags(self.name, allow_system, define_variable=(('prefix', self.__mklroot.as_posix()),)) ^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'as_posix' ``` The code is crashing because the `_set_cargs()` method assumes that `self.__mklroot` will always be set, presumably because it assumes it will only be called only when `MKLPkgConfigDependency.__init__()` finishes with `is_found = True`. However, both `_set_cargs()` and `_set_libs()` are called during `PkgConfigDependency.__init__()`, and therefore they will be called if pkg-config lookup succeeds even without `MKL_ROOT` set. To avoid the issue, check for `self.__mklroot is None` in both functions, and raise a `DependencyException` — effectively causing the pkg-config lookup to fail in a natural way. Fixes #11172 Signed-off-by: Michał Górny --- ci/ciimage/arch/install.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'ci/ciimage/arch') diff --git a/ci/ciimage/arch/install.sh b/ci/ciimage/arch/install.sh index de43cb2ea..4602d8f32 100755 --- a/ci/ciimage/arch/install.sh +++ b/ci/ciimage/arch/install.sh @@ -15,6 +15,7 @@ pkgs=( doxygen vulkan-headers vulkan-icd-loader vulkan-validation-layers openssh mercurial gtk-sharp-2 qt5-tools libwmf cmake netcdf-fortran openmpi nasm gnustep-base gettext python-lxml hotdoc rust-bindgen qt6-base qt6-tools qt6-declarative wayland wayland-protocols + intel-oneapi-mkl # cuda ) -- cgit v1.2.3