From 4adcdd43a614c41faa08bab598ca03542d1b0a90 Mon Sep 17 00:00:00 2001 From: Bart Thomee <11445373+bthomee@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:57:02 -0400 Subject: [PATCH 01/10] Cleanup CI images, add distro release and version --- .github/workflows/debian.yml | 11 ++++++++--- .github/workflows/rhel.yml | 11 ++++++++--- .github/workflows/tools-rippled.yml | 11 ++++++++--- .github/workflows/ubuntu.yml | 11 ++++++++--- docker/debian/Dockerfile | 24 +++++++++--------------- docker/rhel/Dockerfile | 23 ++++++++--------------- docker/ubuntu/Dockerfile | 23 ++++++++--------------- 7 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index b07eaf7..a5dfe3f 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -7,6 +7,14 @@ on: - docker/debian/Dockerfile - test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + env: CONTAINER_REGISTRY: ghcr.io BUILDKIT_PROGRESS: plain @@ -114,7 +122,6 @@ jobs: target: ${{ matrix.os.compiler_name }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} - shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -196,13 +203,11 @@ jobs: type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- - name: Create manifest list and push working-directory: /tmp/digests - shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image - shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/rhel.yml b/.github/workflows/rhel.yml index 9fdca4e..b58f757 100644 --- a/.github/workflows/rhel.yml +++ b/.github/workflows/rhel.yml @@ -7,6 +7,14 @@ on: - docker/rhel/Dockerfile - test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + env: CONTAINER_REGISTRY: ghcr.io REDHAT_REGISTRY: registry.redhat.io @@ -104,7 +112,6 @@ jobs: target: ${{ matrix.os.compiler_name }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} - shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -171,13 +178,11 @@ jobs: type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- - name: Create manifest list and push working-directory: /tmp/digests - shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image - shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/tools-rippled.yml b/.github/workflows/tools-rippled.yml index dd040b2..68e9fd3 100644 --- a/.github/workflows/tools-rippled.yml +++ b/.github/workflows/tools-rippled.yml @@ -6,6 +6,14 @@ on: - .github/workflows/tools-rippled.yml - docker/tools-rippled/Dockerfile +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + env: CONTAINER_REGISTRY: ghcr.io BUILDKIT_PROGRESS: plain @@ -84,7 +92,6 @@ jobs: target: ${{ matrix.tool }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} - shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -143,13 +150,11 @@ jobs: type=raw,value=latest - name: Create manifest list and push working-directory: /tmp/digests - shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image - shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f715819..3edf8b9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,6 +7,14 @@ on: - docker/ubuntu/Dockerfile - test +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + env: CONTAINER_REGISTRY: ghcr.io BUILDKIT_PROGRESS: plain @@ -112,7 +120,6 @@ jobs: target: ${{ matrix.os.compiler_name }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} - shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -191,13 +198,11 @@ jobs: type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- - name: Create manifest list and push working-directory: /tmp/digests - shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image - shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index c5471f2..5c3775f 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -116,10 +116,10 @@ if [[ "${CXX_VER}" != "${GCC_VERSION}" ]]; then fi EOF +# Set the Conan home directory, so the users of this image can find the default +# profile. ENV HOME=/root WORKDIR ${HOME} - -# Set Conan home directory, so the users of this image can find default profile ENV CONAN_HOME=${HOME}/.conan2 # Create a default Conan profile. @@ -128,14 +128,14 @@ conan profile detect rm -rf /tmp/* EOF -# Fix the C++ dialect. -RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default -# Explicitly set the compiler flags. +# Explicitly set the compiler flags and the distribution name and version. RUN <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf < Date: Mon, 28 Jul 2025 14:58:56 -0400 Subject: [PATCH 02/10] Cleanup CI images, add distro release and version --- docker/debian/Dockerfile | 4 ++-- docker/ubuntu/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 5c3775f..68b11e6 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -131,7 +131,7 @@ EOF # Explicitly set the compiler flags and the distribution name and version. RUN <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf < Date: Mon, 28 Jul 2025 15:02:08 -0400 Subject: [PATCH 03/10] Cleanup CI images, add distro release and version --- docker/debian/Dockerfile | 4 ++-- docker/rhel/Dockerfile | 4 ++-- docker/ubuntu/Dockerfile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 68b11e6..03978df 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -131,8 +131,8 @@ EOF # Explicitly set the compiler flags and the distribution name and version. RUN <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf < Date: Mon, 28 Jul 2025 17:53:49 -0400 Subject: [PATCH 04/10] Add gcc and g++ to Debian and Ubuntu clang images --- docker/debian/Dockerfile | 18 +++++++++++++++++- docker/debian/README.md | 2 ++ docker/rhel/Dockerfile | 3 ++- docker/ubuntu/Dockerfile | 18 +++++++++++++++++- docker/ubuntu/README.md | 2 ++ 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 1be5fd2..f6d501e 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -95,6 +95,7 @@ update-alternatives --install \ update-alternatives --auto cc update-alternatives --auto gcc EOF +# Set the compiler environment variables to point to the GCC binaries. ENV CC=/usr/bin/gcc ENV CXX=/usr/bin/g++ @@ -154,6 +155,21 @@ FROM base AS clang # This is not inherited from base image, ensure no manual interaction needed. ARG DEBIAN_FRONTEND=noninteractive +# Some build dependencies require GCC to be available. +COPY --from=gcc-src /usr/local/ /usr/local/ +COPY --from=gcc-src /etc/ld.so.conf.d/*.conf /etc/ld.so.conf.d/ +RUN < Date: Mon, 28 Jul 2025 18:57:21 -0400 Subject: [PATCH 05/10] Add gcc and g++ to Debian and Ubuntu clang images --- .github/workflows/debian.yml | 11 +++-------- .github/workflows/rhel.yml | 11 +++-------- .github/workflows/tools-rippled.yml | 11 +++-------- .github/workflows/ubuntu.yml | 11 +++-------- docker/debian/Dockerfile | 27 ++++++++++++++++----------- docker/rhel/Dockerfile | 26 ++++++++++++++++---------- docker/ubuntu/Dockerfile | 26 ++++++++++++++++---------- 7 files changed, 60 insertions(+), 63 deletions(-) diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml index a5dfe3f..b07eaf7 100644 --- a/.github/workflows/debian.yml +++ b/.github/workflows/debian.yml @@ -7,14 +7,6 @@ on: - docker/debian/Dockerfile - test -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - env: CONTAINER_REGISTRY: ghcr.io BUILDKIT_PROGRESS: plain @@ -122,6 +114,7 @@ jobs: target: ${{ matrix.os.compiler_name }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} + shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -203,11 +196,13 @@ jobs: type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- - name: Create manifest list and push working-directory: /tmp/digests + shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image + shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/rhel.yml b/.github/workflows/rhel.yml index b58f757..9fdca4e 100644 --- a/.github/workflows/rhel.yml +++ b/.github/workflows/rhel.yml @@ -7,14 +7,6 @@ on: - docker/rhel/Dockerfile - test -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - env: CONTAINER_REGISTRY: ghcr.io REDHAT_REGISTRY: registry.redhat.io @@ -112,6 +104,7 @@ jobs: target: ${{ matrix.os.compiler_name }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} + shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -178,11 +171,13 @@ jobs: type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- - name: Create manifest list and push working-directory: /tmp/digests + shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image + shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/tools-rippled.yml b/.github/workflows/tools-rippled.yml index 68e9fd3..dd040b2 100644 --- a/.github/workflows/tools-rippled.yml +++ b/.github/workflows/tools-rippled.yml @@ -6,14 +6,6 @@ on: - .github/workflows/tools-rippled.yml - docker/tools-rippled/Dockerfile -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - env: CONTAINER_REGISTRY: ghcr.io BUILDKIT_PROGRESS: plain @@ -92,6 +84,7 @@ jobs: target: ${{ matrix.tool }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} + shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -150,11 +143,13 @@ jobs: type=raw,value=latest - name: Create manifest list and push working-directory: /tmp/digests + shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image + shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3edf8b9..f715819 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,14 +7,6 @@ on: - docker/ubuntu/Dockerfile - test -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - env: CONTAINER_REGISTRY: ghcr.io BUILDKIT_PROGRESS: plain @@ -120,6 +112,7 @@ jobs: target: ${{ matrix.os.compiler_name }} - name: Export digest if: ${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch }} + shell: bash run: | mkdir -p /tmp/digests DIGEST="${{ steps.build.outputs.digest }}" @@ -198,11 +191,13 @@ jobs: type=sha,prefix=${{ matrix.os.compiler_name }}-${{ matrix.os.compiler_version }}-sha- - name: Create manifest list and push working-directory: /tmp/digests + shell: bash run: | eval "docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(jq -cr '.annotations | map("--annotation \"" + . + "\"") | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.CONTAINER_IMAGE }}@sha256:%s ' *)" - name: Inspect image + shell: bash run: | docker buildx imagetools inspect ${{ env.CONTAINER_IMAGE }}:${{ steps.meta.outputs.version }} diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index f6d501e..829f31e 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -95,7 +95,6 @@ update-alternatives --install \ update-alternatives --auto cc update-alternatives --auto gcc EOF -# Set the compiler environment variables to point to the GCC binaries. ENV CC=/usr/bin/gcc ENV CXX=/usr/bin/g++ @@ -118,10 +117,10 @@ if [[ "${CXX_VER}" != "${GCC_VERSION}" ]]; then fi EOF -# Set the Conan home directory, so the users of this image can find the default -# profile. ENV HOME=/root WORKDIR ${HOME} + +# Set Conan home directory, so the users of this image can find default profile ENV CONAN_HOME=${HOME}/.conan2 # Create a default Conan profile. @@ -130,14 +129,14 @@ conan profile detect rm -rf /tmp/* EOF -# Explicitly set the compiler flags and the distribution name and version. +# Fix the C++ dialect. +RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default +# Explicitly set the compiler flags. RUN <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf < Date: Tue, 29 Jul 2025 10:30:59 +0100 Subject: [PATCH 06/10] Pick the default gcc/g++ from distro --- docker/debian/Dockerfile | 21 +++++++-------------- docker/rhel/Dockerfile | 9 +++++---- docker/ubuntu/Dockerfile | 15 ++++----------- test/run.sh | 3 ++- test/src/main.cpp | 9 +++++++++ 5 files changed, 27 insertions(+), 30 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 829f31e..65a16b6 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -143,7 +143,7 @@ RUN conan profile show # Test the image by compiling a simple C++ program. RUN --mount=type=bind,source=test,target=/test,readonly < Date: Tue, 29 Jul 2025 10:49:15 +0100 Subject: [PATCH 07/10] Add /usr/bin/c++ symlink for the selected compiler --- docker/debian/Dockerfile | 26 ++++++++++++++++--------- docker/rhel/Dockerfile | 24 +++++++++++++++-------- docker/ubuntu/Dockerfile | 42 ++++++++++++++++++++++++---------------- 3 files changed, 58 insertions(+), 34 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 65a16b6..56f651e 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -81,9 +81,12 @@ ldconfig -v dpkg-divert --divert /usr/bin/gcc.orig --rename /usr/bin/gcc dpkg-divert --divert /usr/bin/g++.orig --rename /usr/bin/g++ dpkg-divert --divert /usr/bin/gfortran.orig --rename /usr/bin/gfortran -update-alternatives --install /usr/bin/cc cc /usr/local/bin/gcc 999 -update-alternatives --install \ - /usr/bin/gcc gcc /usr/local/bin/gcc 100 \ +update-alternatives \ + --install /usr/bin/cc cc /usr/local/bin/gcc 999 +update-alternatives \ + --install /usr/bin/c++ c++ /usr/local/bin/g++ 999 +update-alternatives \ + --install /usr/bin/gcc gcc /usr/local/bin/gcc 100 \ --slave /usr/bin/g++ g++ /usr/local/bin/g++ \ --slave /usr/bin/gcc-ar gcc-ar /usr/local/bin/gcc-ar \ --slave /usr/bin/gcc-nm gcc-nm /usr/local/bin/gcc-nm \ @@ -93,6 +96,7 @@ update-alternatives --install \ --slave /usr/bin/gcov-dump gcov-dump /usr/local/bin/gcov-dump \ --slave /usr/bin/lto-dump lto-dump /usr/local/bin/lto-dump update-alternatives --auto cc +update-alternatives --auto c++ update-alternatives --auto gcc EOF ENV CC=/usr/bin/gcc @@ -176,13 +180,17 @@ apt-get update apt-get install -t llvm-toolchain-${DEBIAN_VERSION}-${CLANG_VERSION} -y --no-install-recommends clang-${CLANG_VERSION} llvm-${CLANG_VERSION} apt-get clean rm -rf /var/lib/apt/lists/* -update-alternatives --install /usr/bin/cc cc /usr/bin/clang-${CLANG_VERSION} 999 -update-alternatives --install \ - /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 100 \ - --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} -update-alternatives --install \ - /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${CLANG_VERSION} 100 +update-alternatives \ + --install /usr/bin/cc cc /usr/bin/clang-${CLANG_VERSION} 999 +update-alternatives \ + --install /usr/bin/c++ c++ /usr/bin/clang++-${CLANG_VERSION} 999 +update-alternatives \ + --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 100 \ + --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} +update-alternatives \ + --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${CLANG_VERSION} 100 update-alternatives --auto cc +update-alternatives --auto c++ update-alternatives --auto clang update-alternatives --auto llvm-cov EOF diff --git a/docker/rhel/Dockerfile b/docker/rhel/Dockerfile index c626821..2c279cc 100644 --- a/docker/rhel/Dockerfile +++ b/docker/rhel/Dockerfile @@ -53,15 +53,19 @@ dnf remove -y gcc gcc-c++ dnf install -y --setopt=tsflags=nodocs gcc-toolset-${GCC_VERSION}-gcc gcc-toolset-${GCC_VERSION}-gcc-c++ dnf clean -y all rm -rf /var/cache/dnf/* -update-alternatives --install /usr/bin/cc cc /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcc 999 update-alternatives \ - --install /usr/bin/gcc gcc /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcc 100 \ - --slave /usr/bin/g++ g++ /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/g++ \ - --slave /usr/bin/cpp cpp /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/cpp \ - --slave /usr/bin/gcov gcov /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcov \ - --slave /usr/bin/gcov-dump gcov-dump /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcov-dump-${GCC_VERSION} \ - --slave /usr/bin/gcov-tool gcov-tool /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcov-tool-${GCC_VERSION} + --install /usr/bin/cc cc /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcc 999 +update-alternatives \ + --install /usr/bin/c++ c++ /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/g++ 999 +update-alternatives \ + --install /usr/bin/gcc gcc /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcc 100 \ + --slave /usr/bin/g++ g++ /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/g++ \ + --slave /usr/bin/cpp cpp /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/cpp \ + --slave /usr/bin/gcov gcov /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcov \ + --slave /usr/bin/gcov-dump gcov-dump /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcov-dump-${GCC_VERSION} \ + --slave /usr/bin/gcov-tool gcov-tool /opt/rh/gcc-toolset-${GCC_VERSION}/root/usr/bin/gcov-tool-${GCC_VERSION} update-alternatives --auto cc +update-alternatives --auto c++ update-alternatives --auto gcc EOF ENV CC=/usr/bin/gcc @@ -125,8 +129,12 @@ RUN < Date: Tue, 29 Jul 2025 11:00:33 +0100 Subject: [PATCH 08/10] Remove GCC_VERSION from README.md files --- docker/debian/README.md | 2 -- docker/ubuntu/README.md | 2 -- 2 files changed, 4 deletions(-) diff --git a/docker/debian/README.md b/docker/debian/README.md index 86baff3..50e7d1f 100644 --- a/docker/debian/README.md +++ b/docker/debian/README.md @@ -70,7 +70,6 @@ registry. DEBIAN_VERSION=bookworm CLANG_VERSION=17 CONAN_VERSION=2.18.0 -GCC_VERSION=12 GCOVR_VERSION=8.3 CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:clang-${CLANG_VERSION} @@ -82,7 +81,6 @@ docker buildx build . \ --build-arg CLANG_VERSION=${CLANG_VERSION} \ --build-arg CONAN_VERSION=${CONAN_VERSION} \ --build-arg DEBIAN_VERSION=${DEBIAN_VERSION} \ - --build-arg GCC_VERSION=${GCC_VERSION} \ --build-arg GCOVR_VERSION=${GCOVR_VERSION} \ --tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE} ``` diff --git a/docker/ubuntu/README.md b/docker/ubuntu/README.md index 59af322..8804a89 100644 --- a/docker/ubuntu/README.md +++ b/docker/ubuntu/README.md @@ -66,7 +66,6 @@ registry. UBUNTU_VERSION=noble CLANG_VERSION=18 CONAN_VERSION=2.18.0 -GCC_VERSION=14 GCOVR_VERSION=8.3 CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:clang-${CLANG_VERSION} @@ -77,7 +76,6 @@ docker buildx build . \ --build-arg BUILDKIT_INLINE_CACHE=1 \ --build-arg CLANG_VERSION=${CLANG_VERSION} \ --build-arg CONAN_VERSION=${CONAN_VERSION} \ - --build-arg GCC_VERSION=${GCC_VERSION} \ --build-arg GCOVR_VERSION=${GCOVR_VERSION} \ --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} \ --tag ${CONTAINER_REGISTRY}/${CONTAINER_IMAGE} From 9d534eb8cb1be151364a8851e18a693ae4a7808f Mon Sep 17 00:00:00 2001 From: Bronek Kozicki Date: Tue, 29 Jul 2025 11:07:01 +0100 Subject: [PATCH 09/10] Consolidate RUN for gcc install with other RUN --- docker/debian/Dockerfile | 12 +++--------- docker/ubuntu/Dockerfile | 14 ++++---------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index 56f651e..dc75851 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -158,20 +158,14 @@ FROM base AS clang # This is not inherited from base image, ensure no manual interaction needed. ARG DEBIAN_FRONTEND=noninteractive -# Some build dependencies require GCC to be also available. -RUN < Date: Tue, 29 Jul 2025 11:16:03 +0100 Subject: [PATCH 10/10] Add package_id --- docker/debian/Dockerfile | 2 ++ docker/rhel/Dockerfile | 2 ++ docker/ubuntu/Dockerfile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile index dc75851..907a114 100644 --- a/docker/debian/Dockerfile +++ b/docker/debian/Dockerfile @@ -139,6 +139,7 @@ RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home) RUN <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <> $(conan config home)/global.conf <