llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.42k stars 11.74k forks source link

[packaging] libclang-rt-14-dev conflicts with other clang-14 packages #59903

Closed vient closed 1 year ago

vient commented 1 year ago

At least in Ubuntu Focal repo https://apt.llvm.org/focal, libclang-common-14-dev=14.0.6~++20230108112125+f28c006a5895-1~exp1~20230108112200.170 has no include/sanitizer folder which breaks build with sanitizers.

$ dpkg -L libclang-common-14-dev | grep sani
/usr/lib/llvm-14/lib/clang/14.0.6/include/sanitizer

$ sudo apt install libclang-common-14-dev
....

$ dpkg -L libclang-common-14-dev | grep sani
$

It is not possible to downgrade since only latest version is provided.


Update: as @NixFrog noticed, libclang-rt-14-dev (where sanitizers have moved) uses incorrect version schema in its DEBIAN/control which results in

$ sudo apt install libclang-rt-14-dev
...
The following packages will be REMOVED:
  clang-14 clang-tidy-14 clang-tools-14 libclang-common-14-dev
The following NEW packages will be installed:
  lib32gcc-s1 libclang-rt-14-dev

Also, while clang-15 depends on libclang-rt-15-dev, clang-14 merely recommends to install libclang-rt-14-dev which means that builds with sanitizers (or maybe any builds?) won't work by default.

vient commented 1 year ago

Integration tests are failing since yesterday https://llvm-jenkins.debian.net/job/llvm-toolchain-14-integration-test/

j-stephan commented 1 year ago

The missing libraries are part of libclang-rt-14-dev. However, this conflicts with libclang-common-14-dev which in turn leads to clang-14 being uninstalled.

NixFrog commented 1 year ago

I'll try to bring some more information after digging a bit into the issue: The package available on the llvm focal repository for libclang-rt-14-dev_14.0.6 has a version that stills includes the epoch in the package's version, but not in its dependencies (see Version, Breaks and Replaces):

dpkg -I libclang-rt-14-dev_14.0.6\~++20230108112125+f28c006a5895-1\~exp1\~20230108112200.170_amd64.deb
 new Debian package, version 2.0.
 size 3288368 bytes: control archive=3992 bytes.
    1056 bytes,    23 lines      control              
   13976 bytes,   131 lines      md5sums              
 Package: libclang-rt-14-dev
 Source: llvm-toolchain-14
 Version: 1:14.0.6~++20230108112125+f28c006a5895-1~exp1~20230108112200.170
 Architecture: amd64
 Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
 Installed-Size: 43466
 Depends: lib32gcc-s1 (>= 3.0), lib32stdc++6 (>= 4.1.1), libc6 (>= 2.17), libc6-i386 (>= 2.17), libgcc-s1 (>= 3.0), libstdc++6 (>= 4.1.1)
 Breaks: libclang-common-14-dev (<< 1:14.0.6-10~exp4)
 Replaces: libclang-common-14-dev (<< 1:14.0.6-10~exp4)

The issue here being that libclang-common-14-dev also has an epoch in its version, which if I understand things correctly will not work with the specified Breaks

When looking at the latest available package from debian the issue is fixed: there is no longer an epoch in the Version of the various packages & requirements:

dpkg -I libclang-rt-14-dev_14.0.6-10+b1_amd64.deb
 new Debian package, version 2.0.
 size 3274056 bytes: control archive=4000 bytes.
    1020 bytes,    23 lines      control              
   14069 bytes,   132 lines      md5sums              
 Package: libclang-rt-14-dev
 Source: llvm-toolchain-14 (1:14.0.6-10)
 Version: 1:14.0.6-10+b1
 Architecture: amd64
 Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
 Installed-Size: 43008
 Depends: lib32gcc-s1 (>= 3.0), lib32stdc++6 (>= 4.1.1), libc6 (>= 2.34), libc6-i386 (>= 2.34), libgcc-s1 (>= 3.0), libstdc++6 (>= 4.1.1)
 Breaks: libclang-common-14-dev (<< 1:14.0.6-10~exp4)
 Replaces: libclang-common-14-dev (<< 1:14.0.6-10~exp4)

Note that the fixed package seems to be the result of fixes from the following mail thread that relates to missing epochs in packages.

I don't have enough knowledge to dig deeper, but I hope that this may help any maintainer looking at this issue.

In the meantime, I recommend others encountering this issue to work around it by installing the package from debian's repository.

j-stephan commented 1 year ago

A possible workaround: The clang-15 packages seem fine. So if you can upgrade your test infrastructure to clang-15 this is a quick fix.

clang-15 is now broken as well.

xroche commented 1 year ago

Workaround (courtesy of @Turanic):

apt-get update && apt download libclang-rt-14-dev && dpkg --force-all -i libclang-rt-14-dev*
peter-toft-greve commented 1 year ago

Thanx a mil @xroche - does the trick. Look forward to a more permanent fix

opajonk commented 1 year ago

I can confirm the issue and the workaround on Ubuntu Jammy. Thanks! Also looking very much forward to a real fix, of course ;-) Especially since the workaround will essentially break all subsequent apt operations...

peter-toft-greve commented 1 year ago

Focal Fossa / Ubuntu 20.04 is clearly hit by this problem right now. The latest released packages of libclang-common-14-dev lacks all of /usr/lib/llvm-14/lib/

j-stephan commented 1 year ago

The clang-15 packages seem fine.

Disregard that, they are broken now, too. I really hope someone from the packaging team picks this up soon.

Nevermind, it works (again).

vient commented 1 year ago

clang-15 looks fine to me, it now depends on libclang-rt-15-dev where sanitizers moved which is not broken like libclang-rt-14-dev is.

j-stephan commented 1 year ago

Huh, maybe a glitch then. I'm quite certain that it failed in our CI with a similar error message but it is working now.

peter-toft-greve commented 1 year ago

@j-stephan do you mean that it works for you? I have just now upgraded to lastest on Ubuntu 20.04 where I have an apt sources line: deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main

and I have lost the needed libclang_rt.asan_static-x86_64.a needed for ASAN with clang-14

j-stephan commented 1 year ago

Sorry, that was a bit unclear. I was talking about the clang-15 packages in my previous comment. The clang-14 packages are still broken.

peter-toft-greve commented 1 year ago

For sake of understanding - were the new clang-14 packages released while having integration test failures in https://llvm-jenkins.debian.net/view/14/, or did those fails appear after release?

opajonk commented 1 year ago

Did anyone who could in theory fix this issue already see this? Or did it get lost in the 5k+ issues...

peter-toft-greve commented 1 year ago

I just rechecked - no new packages for Ubuntu 20.04 but https://llvm-jenkins.debian.net/job/llvm-toolchain-14-integration-test/ is happy but several others in https://llvm-jenkins.debian.net/ are red

MMory commented 1 year ago

Actually, the succeeding integration test run https://llvm-jenkins.debian.net/job/llvm-toolchain-14-integration-test/ dates back to the date where the issue was not there yet and more recent runs disappeared.

vient commented 1 year ago

I suppose this is some standard mechanism in Jenkins where only last successful and unsuccessful builds are stored. I definitely saw failed build there on January 8.

peter-toft-greve commented 1 year ago

@MMory yep - very odd :)

peter-toft-greve commented 1 year ago

Anyone who know more about progress for this one?

nathanchance commented 1 year ago

For what it's worth, this appears fixed for me and the source seems to agree with me.

https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/a569b6dcf72b6f6f3a0ae7cfd7fed8e647ed9a65

I only tried on bullseye though.

MMory commented 1 year ago

These integration tests keep failing: https://llvm-jenkins.debian.net/view/14/

peter-toft-greve commented 1 year ago

Hoping that the devs can fix them. I still badly need the fixed packages

opajonk commented 1 year ago

Same here. We cannot simply switch to Clang 15 :crying_cat_face:

peter-toft-greve commented 1 year ago

If there is anything test-wise or alike we can contribute with - please share.

peter-toft-greve commented 1 year ago

This has been broken for a month - anyone who can share insights to whether this is about to be resolved "soonish" or whether it is the time to spend time upgrading to e.g.. clang-16?

vient commented 1 year ago

Posted this to LLVM discord and it seems that it was fixed two weeks ago. Checked myself, libclang-rt-14-dev does not break anything on bionic anymore.

Let me know if problem persists for other distributions, I will update OP and post it to Discord.

peter-toft-greve commented 1 year ago

Seems to work fine after also installing libclang-rt-14-dev + latest of all others. @opajonk - I guess you also would like to test now

opajonk commented 1 year ago

Many thanks for the hint! I will give it a spin first thing tomorrow ;-)

opajonk commented 1 year ago

Yep, I can confirm that the asan build works again when I install libclang-rt-14-dev via apt. The new package seems to be from 2023-01-31.

vient commented 1 year ago

So it seems to be fixed, great

DarshanRamakant commented 7 months ago

Yep, I can confirm that the asan build works again when I install libclang-rt-14-dev via apt. The new package seems to be from 2023-01-31.

How to install it in Ubuntu 22, I could not install it