silkeh / docker-clang

Dockerfiles for Clang and LLVM
European Union Public License 1.2
100 stars 30 forks source link

Adding Clang 17 #28

Closed veblush closed 1 year ago

veblush commented 1 year ago

Hey, it'd be great to add Clang 17 as Clang 17 is now available; https://github.com/llvm/llvm-project/releases/tag/llvmorg-17.0.3

silkeh commented 1 year ago

Thanks for the letting me know. Most of the images should now be available. Note that the 17, 17-bookworm and 17-bullseye images failed to build due to broken package dependencies for arm64 and s390x (see this pipeline).

jdoubleu commented 1 year ago

I cannot reproduce the issue of broken dependencies in a clean docker container.

Ran the following commands locally without any issues:

$ docker run --rm -it debian:bookworm-slim

# inside the container:
$ apt-get -qq update; \
    apt-get install -qqy --no-install-recommends \
        gnupg2 wget ca-certificates apt-transport-https \
        autoconf automake cmake dpkg-dev file make patch libc6-dev
$ echo "deb https://apt.llvm.org/bookworm llvm-toolchain-bookworm-17 main"         > /etc/apt/sources.list.d/llvm.list &&     wget -qO /etc/apt/trusted.gpg.d/llvm.asc         https://apt.llvm.org/llvm-snapshot.gpg.key &&     apt-get -qq update &&     apt-get install -qqy -t llvm-toolchain-bookworm-17 clang-17 clang-tidy-17 clang-format-17 lld-17 libc++-17-dev libc++abi-17-dev
$ /usr/lib/llvm-17/bin/clang --version
silkeh commented 1 year ago

@jdoubleu are you running that on an arm64 or s390x platform? (amd64 does work for some reason)

jdoubleu commented 1 year ago

Sorry, misread the arm64. I was running the experiment successfully on amd64.

Unfortunately, I cannot pinpoint the exact issue from the build logs, but was able to get more information, when trying to install the arm64 packages using multiarch:

$ apt-get install clang-17:arm64 clang-tidy-17:arm64 clang-format-17:arm64 lld-17:arm64 libc++-17-dev:arm64 libc++abi-17-dev:arm64
...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 clang-17:arm64 : Depends: libclang-common-17-dev:arm64 (= 1:17.0.4~++20231024072958+7f790f9a39e3-1~exp1~20231024073026.58) but it is not installable
                  Depends: llvm-17-linker-tools:arm64 (= 1:17.0.4~++20231024072958+7f790f9a39e3-1~exp1~20231024073026.58) but it is not going to be installed
                  Depends: libclang1-17:arm64 (= 1:17.0.4~++20231024072958+7f790f9a39e3-1~exp1~20231024073026.58) but it is not going to be installed
                  Depends: binutils:arm64 but it is not going to be installed
                  Recommends: llvm-17-dev:arm64 but it is not going to be installed
 clang-tidy-17:arm64 : Depends: libclang-common-17-dev:arm64 but it is not installable
                       Depends: clang-tools-17:arm64 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ apt-get install libclang-common-17-dev:arm64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libclang-common-17-dev:arm64 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libpolly-17-dev:arm64 libclang-rt-17-dev:arm64 libclang-rt-17-dev libclang-rt-17-dev-wasm32
  libclang-rt-17-dev-wasm64 libpolly-17-dev

E: Package 'libclang-common-17-dev:arm64' has no installation candidate

Looks like an issue with the clang apt repository.

Would it still be possible to just upload the amd64 image? You're building all architecture (images) in one job, maybe you can spread the work using matrix builds (or just generating more fine-grained jobs). Then, arm64 and s390x can fail, while amd64 would be unaffected. Would this be an option? I can help contribute that.

silkeh commented 1 year ago

Sorry, misread the arm64. I was running the experiment successfully on amd64.

This always trips me up as well :sweat:

Would it still be possible to just upload the amd64 image?

Not sure if I currently have sufficiently fine-grained control over that with the current scripts, but this should be doable.

You're building all architecture (images) in one job, maybe you can spread the work using matrix builds (or just generating more fine-grained jobs). Then, arm64 and s390x can fail, while amd64 would be unaffected. Would this be an option?

The last time I did some work on this it seemed like the image needed to be pushed for all architectures at the same time. Not sure if I messed something up though. Separate builds would definitely be a welcome improvement.

jdoubleu commented 1 year ago

I just noticed that the builds for clang 17 on bookworm (and buster) succeeded, after I've forked your repo. Could you maybe re-run the failed jobs/pipeline?

Separate builds would definitely be a welcome improvement.

I'll have a look into the build system and try to come up with a solution, when I find the time.