Bug#1041455: libclang-dev fails to install in a cross-build context

Johannes Schauer Marin Rodrigues josch at debian.org
Wed Jul 19 08:54:08 BST 2023


Source: llvm-toolchain-16
Version: 1:16.0.6-4
Severity: normal
X-Debbugs-Cc: debian-cross at lists.debian.org

Hi,

currently, source packages build-depending on libclang-dev fail to
satisfy their cross-build dependencies:

The solver encountered an error of type: ERR_UNSOLVABLE
The following information might help you to understand what is wrong:
The following packages have unmet dependencies:
 clang-14:amd64 : Depends: libclang-common-14-dev:amd64 (= 1:14.0.6-12) but it is not installable
                  Depends: binutils:amd64 but it is not installable
 libclang-14-dev:amd64 : Depends: libclang-common-14-dev:amd64 (= 1:14.0.6-12) but it is not installable

The reason for libclang-common-14-dev not being installable is, that it is an
Architecture:all package which is implicitly treated being of the native
architecture by dpkg and thus cannot satisfy a dependency of packages of
another arch on it. Adding a Multi-Arch:foreign annotation to
libclang-common-14-dev would be wrong because the package this would pull in
native (build) architecture libllvm14 which is likely undesired in a
cross-build context.

I encountered this problem with llvm-toolchain-14 but looking at the package
metadata, this problem still persists with llvm-toolchain-16.

I am unfamiliar with the way that the llvm package is structured and thus I
fear I'm unable to provide you with a good way forward to solve this problem.
If it would be correct to just preserve the architecture of the dependee of
libclang-common-14-dev and pass it on to its dependencies, then one possible
solution would be changing libclang-common-14-dev (or libclang-common-16-dev)
from Architecture:all to Architecture:any. In a cross build context, this would
mean that a host-architecture libclang-14-dev would pull in a host-architectue
libclang-common-14-dev which in turn would pull in a host-architecture
libllvm14. That argument holds for version 16 (against which I'm filing this
bug) as well as it does for version 14.

As the llvm expert, can you think of a possible way forward to improve cross
compilation of source packages depending on libclang-dev in Debian?

Thanks!

cheers, josch



More information about the Pkg-llvm-team mailing list