Skip to content
Merged
Changes from 1 commit
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
22 changes: 21 additions & 1 deletion .github/workflows/containers/github-action-ci-tooling/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
ARG LLVM_VERSION=21.1.0
# FIXME: Use "${LLVM_VERSION%%.*}"" instead of "LLVM_VERSION_MAJOR" once we update runners to Ubuntu-26.04 with Buildah >= 1.37
ARG LLVM_VERSION_MAJOR=21
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer if we put a little bit more effort into trying to consolidate these. There's almost certainly a way to get it working.

Is the local/Github difference maybe related to podman versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This syntax is supported in docker/buildkit stack but I couldn't find that it is supported in podman/buildah stack. Locally I have Buildah 1.39 and in CI it's 1.33. I checked https://buildah.io/releases/ but nothing mentioned "variable expansions" in release notes from 1.33 to 1.39, so I have generally no idea how it works locally.

Copy link
Contributor Author

@vbvictor vbvictor Oct 17, 2025

Choose a reason for hiding this comment

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

Oh I found openshift/imagebuilder@88c69f9 (available in v1.2.12 or more) which adds support for %% syntax.

Copy link
Contributor Author

@vbvictor vbvictor Oct 17, 2025

Choose a reason for hiding this comment

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

https://buildah.io/releases/#changes-for-v1370 bumped imagebuilder version to v1.2.14 which supports %% and other shell syntax. So we essentially need to have Buildah 1.37 instead of 1.33 in CI (Ubuntu 24.04).

Copy link
Contributor Author

@vbvictor vbvictor Oct 18, 2025

Choose a reason for hiding this comment

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

So I think we can use LLVM_VERSION_MAJOR and leave a TODO for Ubuntu-26.04 runners, which should have higher version of Buildah (Ubuntu-25.04 has 1.39).

Another option is to move to docker buildx but I don't think we want it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack. I'm fine leaving a TODO for ~6 months given we have an understanding of what the issue is, which we do now. Nice investigation.


FROM docker.io/library/ubuntu:24.04 AS llvm-downloader
ARG LLVM_VERSION
ARG LLVM_VERSION_MAJOR

RUN apt-get update && \
apt-get install -y wget xz-utils && \
wget -O llvm.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/LLVM-${LLVM_VERSION}-Linux-X64.tar.xz && \
mkdir -p /llvm-extract && \
tar -xvJf llvm.tar.xz -C /llvm-extract \
# Only unpack these tools to save space on Github runner.
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-format \
LLVM-${LLVM_VERSION}-Linux-X64/bin/git-clang-format && \
Expand Down Expand Up @@ -50,12 +55,27 @@ RUN pip install -r requirements_formatting.txt --break-system-packages && \

FROM base AS ci-container-code-lint
ARG LLVM_VERSION
ARG LLVM_VERSION_MAJOR

COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy ${LLVM_SYSROOT}/bin/
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-tidy \
/llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/bin/clang-${LLVM_VERSION_MAJOR} \
${LLVM_SYSROOT}/bin/
COPY --from=llvm-downloader /llvm-extract/LLVM-${LLVM_VERSION}-Linux-X64/lib/clang/${LLVM_VERSION_MAJOR}/include \
${LLVM_SYSROOT}/lib/clang/${LLVM_VERSION_MAJOR}/include
COPY clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py ${LLVM_SYSROOT}/bin/clang-tidy-diff.py

RUN ln -s ${LLVM_SYSROOT}/bin/clang-${LLVM_VERSION_MAJOR} ${LLVM_SYSROOT}/bin/clang && \
ln -s ${LLVM_SYSROOT}/bin/clang ${LLVM_SYSROOT}/bin/clang++

ENV PATH=${LLVM_SYSROOT}/bin:${PATH}

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
cmake \
ninja-build && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install dependencies for 'pr-code-lint.yml' job
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
RUN pip install -r requirements_linting.txt --break-system-packages && \
Expand Down
Loading