Bug#1154039: python-opencascade-pywrap: hardcodes /usr/lib/llvm-21/lib/libclang.so, python-ocp FTBFS with LLVM 23 as default

Sylvestre Ledru sylvestre at debian.org
Sun Nov 15 11:02:46 GMT 2026


Source: python-opencascade-pywrap
Version: 0.0~git20251205135501.e4d7570-3
Severity: important
Tags: patch
User: pkg-llvm-team at lists.alioth.debian.org
Usertags: llvm-23-default
Control: affects -1 + src:llvm-defaults src:python-ocp
Control: block 1154024 by -1

Hello,

We are going to switch the default LLVM version to 23 (transition bug
#1154024). llvm-defaults 0.75~exp1, in experimental, already points to
23.

python-ocp then fails to build, because its bindings generator, the
bindgen module of python3-opencascade-pywrap, loads LLVM 21's libclang:

clang.cindex.LibclangError: /usr/lib/llvm-21/lib/libclang.so: cannot
open shared object file: No such file or directory

The path is hardcoded in bindgen/utils.py by
debian/patches/0003-Use-system-clang.patch:

        Config.set_library_file('/usr/lib/llvm-21/lib/libclang.so')

It also ignores the libclang passed by python-ocp (-l
/usr/lib/llvm-23/lib/libclang.so). The attached debdiff uses that path
when given, and otherwise lets python3-clang pick its default libclang,
so it won't break again at the next transition.

With it, python-ocp builds with LLVM 23 as default.

To reproduce, build python-ocp with sbuild:

  sbuild -d unstable \
    --extra-repository='deb http://deb.debian.org/debian experimental main' \
    --build-dep-resolver=aptitude \
    --add-depends='clang (>= 1:23~), llvm-dev (>= 1:23~), libclang-dev (>= 1:23~)' \
    python-ocp

The --add-depends forces the llvm-defaults packages from experimental
(the default apt resolver won't pick them, aptitude does), everything
else comes from unstable.

The severity will be raised to serious once llvm-defaults 23 is in
unstable.

Cheers,
Sylvestre



More information about the debian-science-maintainers mailing list