Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apt-get update && \
bison \
build-essential \
ca-certificates \
ccache \
clang-tools \
cmake \
cppcheck \
Expand Down Expand Up @@ -80,3 +81,6 @@ RUN git clone https://git.kernel.org/pub/scm/devel/sparse/sparse.git /sparse &&
RUN git clone https://repo.or.cz/smatch.git /smatch && \
cd /smatch && make

# Install clang
COPY download-llvm.sh /
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to just import a LLVM docker file instead of creating a custom script to download it?

Copy link
Copy Markdown
Author

@pv pv May 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @hadess suggests above, the base github ubuntu should contain Clang 22.

But you can copy files between images, https://docs.docker.com/build/building/multi-stage/

If CONTEXT_ANALYSIS starts to require Clang 23 with it probably will https://lore.kernel.org/all/CANpmjNN4O=W70sAc5gaVkTAFdrGGOW+XBMyuehfz3_QMiT=uCw@mail.gmail.com/ I'm thinking unreleased build has to be downloaded from somewhere, unless this is just postponed until Clang 23 is out.

Note the download is done only when building the image, so once when this is triggered manually, not on every CI job.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @pv's work is fine here, there's a good reason to not use the distribution's version.

RUN /download-llvm.sh
16 changes: 16 additions & 0 deletions download-llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh
set -x -e

BASE=llvm-22.1.3-x86_64

cat <<EOF > CHECKSUMS
87579c9ddc3f4a9d8b0253d3c0c4fe07015b40dced8282924afdf6cbec12ce81 ${BASE}.tar.gz
EOF

curl -C - -O "https://mirrors.kernel.org/pub/tools/llvm/files/${BASE}.tar.gz"
sha256sum -c CHECKSUMS
rm -rf "${BASE}" llvm
tar xf "${BASE}.tar.gz"
mkdir -p /opt
mv "${BASE}" /opt/llvm
rm -f "${BASE}.tar.gz" CHECKSUMS