Bug#1149391: python-opencascade-pywrap: uses hardcoded llvm with no runtime dependency on it

Gianfranco Costamagna locutusofborg at debian.org
Tue Sep 29 20:44:56 BST 2026


Source: python-opencascade-pywrap
Version: 0.0~git20251205135501.e4d7570-3
Severity: serious

Hello, the Config.set_library_file('/usr/lib/llvm-21/lib/libclang.so')
in patch debian/patches/0003-Use-system-clang.patch works until llvm-default switches to new release (e.g. experimental).


This is an example of python-ocp failure with default clang to 22

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/clang/cindex.py", line 4474, in get_cindex_library
library = cdll.LoadLibrary(self.get_filename())
File "/usr/lib/python3.14/ctypes/__init__.py", line 554, in LoadLibrary
return self._dlltype(name)
~~~~~~~~~~~~~^^^^^^
File "/usr/lib/python3.14/ctypes/__init__.py", line 433, in __init__
self._handle = self._load_library(name, mode, handle, winmode)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/ctypes/__init__.py", line 475, in _load_library
return _dlopen(name, mode)
OSError: /usr/lib/llvm-21/lib/libclang.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/joblib/externals/loky/process_executor.py", line 490, in _process_worker
r = call_item()
File "/usr/lib/python3/dist-packages/joblib/externals/loky/process_executor.py", line 291, in __call__
return self.fn(*self.args, **self.kwargs)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/joblib/parallel.py", line 607, in __call__
return [func(*args, **kwargs) for func, args, kwargs in self.items]
~~~~^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/bindgen/__init__.py", line 346, in _process_module
return ModuleInfo(name, path, files, module_names, settings, target_platform)
File "/usr/lib/python3/dist-packages/bindgen/module.py", line 56, in __init__
self.headers.append(process_header(
~~~~~~~~~~~~~~^
p, prefix, settings, name, target_platform))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/bindgen/header.py", line 1054, in process_header
hi.parse(path, input_folder, settings, module_name, target_platform)
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/bindgen/header.py", line 987, in parse
tr_unit = parse_tu(
path,
...<7 lines>...
target_platform=target_platform,
)
File "/usr/lib/python3/dist-packages/bindgen/translation_unit.py", line 46, in parse_tu
ix = get_index()
File "/usr/lib/python3/dist-packages/bindgen/utils.py", line 90, in get_index
init_clang()
~~~~~~~~~~^^
File "/usr/lib/python3/dist-packages/bindgen/utils.py", line 63, in init_clang
monkeypatch_cursor("is_virtual", "clang_isVirtualBase", [Cursor], c_uint)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/bindgen/cymbal.py", line 57, in monkeypatch_cursor
monkeypatch_helper(clang.cindex.Cursor, method_name, library_function, args, result)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/bindgen/cymbal.py", line 42, in monkeypatch_helper
f = find_libclang_function(library_function)
File "/usr/lib/python3/dist-packages/bindgen/cymbal.py", line 31, in find_libclang_function
return getattr(clang.cindex.conf.lib, function)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/clang/cindex.py", line 251, in __get__
value = self.wrapped(instance)
File "/usr/lib/python3/dist-packages/clang/cindex.py", line 4446, in lib
lib = self.get_cindex_library()
File "/usr/lib/python3/dist-packages/clang/cindex.py", line 4482, in get_cindex_library
raise LibclangError(msg)
clang.cindex.LibclangError: /usr/lib/llvm-21/lib/libclang.so: cannot open shared object file: No such file or directoryTo provide the path to the directory containing libclang, you can use the environment variable LIBCLANG_LIBRARY_PATH or call Config.set_library_path(). Alternatively, you can specify the path of the library file using LIBCLANG_LIBRARY_FILE or Config.set_library_file().
"""



G.



More information about the debian-science-maintainers mailing list