-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[GitHub][CI] Add missing dependencies to code-lint container #163873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I think we can use Another option is to move to There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 && \ | ||
|
@@ -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 && \ | ||
|
Uh oh!
There was an error while loading. Please reload this page.