Skip to content

Commit

Permalink
QD-9281 Add more clang versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Jun 19, 2024
1 parent 18591f4 commit 872a724
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 46 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
matrix:
version: [ "next", "2024.1", "2023.3", "2023.2" ]
group: [ "default", "more" ]
include:
- version: "next"
group: "clang"
- version: "2024.1"
group: "clang"
runs-on: ubuntu-latest
steps:
- name: Clean up
Expand Down
27 changes: 13 additions & 14 deletions 2024.1/base/cpp.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG BASE_TAG="bookworm-slim"

FROM debian:$BASE_TAG

ARG CLANG="16"
# renovate: datasource=repology depName=debian_12/ca-certificates versioning=loose
ENV CA_CERTIFICATES_VERSION="20230311"
# renovate: datasource=repology depName=debian_12/curl versioning=loose
Expand Down Expand Up @@ -37,9 +36,9 @@ ENV QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV PATH="/opt/qodana:${PATH}"

ENV CXX="/usr/lib/llvm-16/bin/clang++" \
CC="/usr/lib/llvm-16/bin/clang" \
CPLUS_INCLUDE_PATH="/usr/lib/clang/16/include"
ENV CXX="/usr/lib/llvm-$CLANG/bin/clang++" \
CC="/usr/lib/llvm-$CLANG/bin/clang" \
CPLUS_INCLUDE_PATH="/usr/lib/clang/$CLANG/include"

# hadolint ignore=SC2174,DL3009
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
Expand All @@ -64,19 +63,19 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
libc6-dev=$LIBC6_DEV_VERSION && \
apt-get autoremove -y && apt-get clean

RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" > /etc/apt/sources.list.d/llvm.list && \
RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${CLANG} main" > /etc/apt/sources.list.d/llvm.list && \
curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/llvm.gpg && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "15CF4D18AF4F7421" && \
apt-get -qq update && \
apt-get install -qqy -t \
llvm-toolchain-bookworm-16 \
clang-16 \
clang-tidy-16 \
clang-format-16 \
lld-16 \
libc++-16-dev \
libc++abi-16-dev && \
for f in /usr/lib/llvm-16/bin/*; do ln -sf "$f" /usr/bin; done && \
llvm-toolchain-bookworm-$CLANG \
clang-$CLANG \
clang-tidy-$CLANG \
clang-format-$CLANG \
lld-$CLANG \
libc++-$CLANG-dev \
libc++abi-$CLANG-dev && \
for f in /usr/lib/llvm-$CLANG/bin/*; do ln -sf "$f" /usr/bin; done && \
ln -sf clang /usr/bin/cc && \
ln -sf clang /usr/bin/c89 && \
ln -sf clang /usr/bin/c99 && \
Expand Down
19 changes: 19 additions & 0 deletions 2024.1/base/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ group "more" {
targets = ["other"]
}

group "clang" {
targets = ["cpp"]
}

target "debian" {
tags = [
"registry.jetbrains.team/p/sa/containers/qodana:debian-base-241"
Expand Down Expand Up @@ -61,4 +65,19 @@ target "other" {
]
platforms = ["linux/amd64", "linux/arm64"]
dockerfile = "${edition}.Dockerfile"
}

target "cpp" {
matrix = {
clang = ["15", "16", "17", "18"]
}
name = "cpp-base-${clang}-241"
tags = [
"registry.jetbrains.team/p/sa/containers/qodana:cpp-base-${clang}-241"
]
platforms = ["linux/amd64", "linux/arm64"]
dockerfile = "cpp.Dockerfile"
args = {
CLANG = clang
}
}
28 changes: 13 additions & 15 deletions 2024.1/cpp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_TAG="bookworm-slim"

FROM debian:$BASE_TAG
ARG CLANG="16"

# renovate: datasource=repology depName=debian_12/ca-certificates versioning=loose
ENV CA_CERTIFICATES_VERSION="20230311"
Expand Down Expand Up @@ -32,16 +32,14 @@ ENV MAKE_VERSION="4.3-4.1"
ENV PATCH_VERSION="2.7.6-7"
# renovate: datasource=repology depName=debian_12/libc6-dev versioning=loose
ENV LIBC6_DEV_VERSION="2.36-9+deb12u7"
# renovate: datasource=repology depName=debian_12/wget versioning=loose
ENV WGET_VERSION="1.21.3-1+b1"

ENV QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV PATH="/opt/qodana:${PATH}"

ENV CXX="/usr/lib/llvm-16/bin/clang++" \
CC="/usr/lib/llvm-16/bin/clang" \
CPLUS_INCLUDE_PATH="/usr/lib/clang/16/include"
ENV CXX="/usr/lib/llvm-$CLANG/bin/clang++" \
CC="/usr/lib/llvm-$CLANG/bin/clang" \
CPLUS_INCLUDE_PATH="/usr/lib/clang/$CLANG/include"

# hadolint ignore=SC2174,DL3009
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
Expand All @@ -66,19 +64,19 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
libc6-dev=$LIBC6_DEV_VERSION && \
apt-get autoremove -y && apt-get clean

RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" > /etc/apt/sources.list.d/llvm.list && \
RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-$CLANG main" > /etc/apt/sources.list.d/llvm.list && \
curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/llvm.gpg && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "15CF4D18AF4F7421" && \
apt-get -qq update && \
apt-get install -qqy -t \
llvm-toolchain-bookworm-16 \
clang-16 \
clang-tidy-16 \
clang-format-16 \
lld-16 \
libc++-16-dev \
libc++abi-16-dev && \
for f in /usr/lib/llvm-16/bin/*; do ln -sf "$f" /usr/bin; done && \
llvm-toolchain-bookworm-$CLANG \
clang-$CLANG \
clang-tidy-$CLANG \
clang-format-$CLANG \
lld-$CLANG \
libc++-$CLANG-dev \
libc++abi-$CLANG-dev && \
for f in /usr/lib/llvm-$CLANG/bin/*; do ln -sf "$f" /usr/bin; done && \
ln -sf clang /usr/bin/cc && \
ln -sf clang /usr/bin/c89 && \
ln -sf clang /usr/bin/c99 && \
Expand Down
3 changes: 2 additions & 1 deletion 2024.1/cpp/internal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM registry.jetbrains.team/p/sa/containers/qodana:cpp-base-latest
ARG CLANG_VERSION="16"
FROM registry.jetbrains.team/p/sa/containers/qodana:cpp-base-$CLANG_VERSION-latest

ARG TARGETPLATFORM
COPY $TARGETPLATFORM/qodana-clang /opt/qodana/qodana
Expand Down
27 changes: 13 additions & 14 deletions next/base/cpp.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ARG BASE_TAG="bookworm-slim"

FROM debian:$BASE_TAG

ARG CLANG="16"
# renovate: datasource=repology depName=debian_12/ca-certificates versioning=loose
ENV CA_CERTIFICATES_VERSION="20230311"
# renovate: datasource=repology depName=debian_12/curl versioning=loose
Expand Down Expand Up @@ -37,9 +36,9 @@ ENV QODANA_DATA="/data" \
QODANA_DOCKER="true"
ENV PATH="/opt/qodana:${PATH}"

ENV CXX="/usr/lib/llvm-16/bin/clang++" \
CC="/usr/lib/llvm-16/bin/clang" \
CPLUS_INCLUDE_PATH="/usr/lib/clang/16/include"
ENV CXX="/usr/lib/llvm-$CLANG/bin/clang++" \
CC="/usr/lib/llvm-$CLANG/bin/clang" \
CPLUS_INCLUDE_PATH="/usr/lib/clang/$CLANG/include"

# hadolint ignore=SC2174,DL3009
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
Expand All @@ -64,19 +63,19 @@ RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
libc6-dev=$LIBC6_DEV_VERSION && \
apt-get autoremove -y && apt-get clean

RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-16 main" > /etc/apt/sources.list.d/llvm.list && \
RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${CLANG} main" > /etc/apt/sources.list.d/llvm.list && \
curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor > /etc/apt/trusted.gpg.d/llvm.gpg && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "15CF4D18AF4F7421" && \
apt-get -qq update && \
apt-get install -qqy -t \
llvm-toolchain-bookworm-16 \
clang-16 \
clang-tidy-16 \
clang-format-16 \
lld-16 \
libc++-16-dev \
libc++abi-16-dev && \
for f in /usr/lib/llvm-16/bin/*; do ln -sf "$f" /usr/bin; done && \
llvm-toolchain-bookworm-$CLANG \
clang-$CLANG \
clang-tidy-$CLANG \
clang-format-$CLANG \
lld-$CLANG \
libc++-$CLANG-dev \
libc++abi-$CLANG-dev && \
for f in /usr/lib/llvm-$CLANG/bin/*; do ln -sf "$f" /usr/bin; done && \
ln -sf clang /usr/bin/cc && \
ln -sf clang /usr/bin/c89 && \
ln -sf clang /usr/bin/c99 && \
Expand Down
21 changes: 20 additions & 1 deletion next/base/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ group "more" {
targets = ["other"]
}

group "clang" {
targets = ["cpp"]
}

target "debian" {
tags = [
"registry.jetbrains.team/p/sa/containers/qodana:debian-base-latest"
Expand Down Expand Up @@ -54,11 +58,26 @@ target "python-js" {
target "other" {
name = "${edition}-base-latest"
matrix = {
edition = ["dotnet", "go", "js", "php", "rust", "ruby", "cpp", "cdnet"]
edition = ["dotnet", "go", "js", "php", "rust", "ruby", "cdnet"]
}
tags = [
"registry.jetbrains.team/p/sa/containers/qodana:${edition}-base-latest"
]
platforms = ["linux/amd64", "linux/arm64"]
dockerfile = "${edition}.Dockerfile"
}

target "cpp" {
matrix = {
clang = ["15", "16", "17", "18"]
}
name = "cpp-base-${clang}-latest"
tags = [
"registry.jetbrains.team/p/sa/containers/qodana:cpp-base-${clang}-latest"
]
platforms = ["linux/amd64", "linux/arm64"]
dockerfile = "cpp.Dockerfile"
args = {
CLANG = clang
}
}
2 changes: 1 addition & 1 deletion next/cpp/internal.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.jetbrains.team/p/sa/containers/qodana:cpp-base-latest
FROM registry.jetbrains.team/p/sa/containers/qodana:cpp-base-16-latest

ARG TARGETPLATFORM
COPY $TARGETPLATFORM/qodana-clang /opt/qodana/qodana
Expand Down

0 comments on commit 872a724

Please sign in to comment.