Skip to content

Commit 21a1ba7

Browse files
authored
Merge branch 'main' into bthomee/prettier
2 parents 9fefa71 + 2582e62 commit 21a1ba7

File tree

12 files changed

+344
-36
lines changed

12 files changed

+344
-36
lines changed

.github/workflows/debian.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ on:
44
push:
55
paths:
66
- .github/workflows/debian.yml
7-
- docker/debian/Dockerfile
7+
- docker/debian/Dockerfile*
88
- test
9+
workflow_dispatch:
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -20,6 +21,7 @@ env:
2021
BUILDKIT_PROGRESS: plain
2122
CONAN_VERSION: 2.19.1
2223
GCOVR_VERSION: 8.3
24+
CMAKE_VERSION: 3.31.6
2325
FALLBACK_GCC: 12
2426
FALLBACK_CLANG: 16
2527

@@ -35,6 +37,9 @@ jobs:
3537
- platform: linux/arm64
3638
runner: ubuntu-24.04-arm
3739
os:
40+
- release: bullseye
41+
compiler_name: gcc
42+
compiler_version: 12
3843
- release: bookworm
3944
compiler_name: gcc
4045
compiler_version: 12
@@ -44,6 +49,9 @@ jobs:
4449
- release: bookworm
4550
compiler_name: gcc
4651
compiler_version: 14
52+
- release: bookworm
53+
compiler_name: gcc
54+
compiler_version: 15
4755
- release: bookworm
4856
compiler_name: clang
4957
compiler_version: 16
@@ -84,6 +92,42 @@ jobs:
8492
echo "CONTAINER_IMAGE=${CONTAINER_REGISTRY}/${CONTAINER_REPO}/debian-${{ matrix.os.release }}" >> $GITHUB_ENV
8593
PLATFORM=${{ matrix.architecture.platform }}
8694
echo "PLATFORM_PAIR=${PLATFORM//\//-}" >> $GITHUB_ENV
95+
if [ "${{ matrix.os.release == 'bullseye' }}" == "true" ]; then
96+
echo "CONTAINER_REPOSITORY_GCC=${CONTAINER_REPO}/debian-gcc" >> $GITHUB_ENV
97+
echo "CONTAINER_IMAGE_GCC=${CONTAINER_REGISTRY}/${CONTAINER_REPO}/debian-gcc" >> $GITHUB_ENV
98+
fi
99+
- name: Prepare gcc image metadata
100+
if: ${{ env.CONTAINER_IMAGE_GCC }}
101+
id: meta-gcc
102+
uses: docker/metadata-action@v5
103+
env:
104+
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,manifest-descriptor
105+
with:
106+
images: ${{ env.CONTAINER_IMAGE_GCC }}
107+
labels: |
108+
org.opencontainers.image.authors=For inquiries, please use https://${{ github.repository }}/issues
109+
org.opencontainers.image.documentation=https://${{ github.repository }}
110+
org.opencontainers.image.vendor=XRPLF
111+
org.opencontainers.image.title=${{ env.CONTAINER_REPOSITORY_GCC }}
112+
- name: Build gcc image
113+
# Note, we always push this image, otherwise steps.build will fail.
114+
# Also, because we always push it, we intentionally do not tag it.
115+
# TODO: Move to separate workflow or job
116+
if: ${{ env.CONTAINER_IMAGE_GCC }}
117+
id: build-gcc
118+
uses: docker/build-push-action@v6
119+
with:
120+
build-args: |
121+
BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom
122+
BUILDKIT_INLINE_CACHE=1
123+
context: .
124+
file: docker/debian/Dockerfile.gcc-${{ matrix.os.compiler_version }}-${{ matrix.os.release }}
125+
outputs: type=image,name=${{ env.CONTAINER_IMAGE_GCC }},push-by-digest=true,name-canonical=true,push=true
126+
platforms: ${{ matrix.architecture.platform }}
127+
provenance: mode=max
128+
push: true
129+
sbom: true
130+
labels: ${{ steps.meta-gcc.outputs.labels }}
87131
- name: Prepare container metadata
88132
id: meta
89133
uses: docker/metadata-action@v5
@@ -110,7 +154,9 @@ jobs:
110154
CONAN_VERSION=${{ env.CONAN_VERSION }}
111155
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
112156
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
157+
CMAKE_VERSION=${{ env.CMAKE_VERSION }}
113158
DEBIAN_VERSION=${{ matrix.os.release }}
159+
BASE_IMAGE=${{ env.CONTAINER_IMAGE_GCC && format('{0}@{1}', env.CONTAINER_IMAGE_GCC, steps.build-gcc.outputs.digest) || format('gcc:{0}-{1}', matrix.os.compiler_version, matrix.os.release) }}
114160
context: .
115161
file: docker/debian/Dockerfile
116162
outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true
@@ -140,6 +186,9 @@ jobs:
140186
strategy:
141187
matrix:
142188
os:
189+
- release: bullseye
190+
compiler_name: gcc
191+
compiler_version: 12
143192
- release: bookworm
144193
compiler_name: gcc
145194
compiler_version: 12
@@ -149,6 +198,9 @@ jobs:
149198
- release: bookworm
150199
compiler_name: gcc
151200
compiler_version: 14
201+
- release: bookworm
202+
compiler_name: gcc
203+
compiler_version: 15
152204
- release: bookworm
153205
compiler_name: clang
154206
compiler_version: 16

.github/workflows/rhel.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- .github/workflows/rhel.yml
77
- docker/rhel/Dockerfile
88
- test
9+
workflow_dispatch:
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -21,6 +22,7 @@ env:
2122
BUILDKIT_PROGRESS: plain
2223
CONAN_VERSION: 2.19.1
2324
GCOVR_VERSION: 8.3
25+
CMAKE_VERSION: 3.31.6
2426

2527
jobs:
2628
# Build the Docker image for Red Hat Enterprise Linux using different versions
@@ -38,6 +40,12 @@ jobs:
3840
- release: 9.4
3941
compiler_name: gcc
4042
compiler_version: 12
43+
- release: 9.4
44+
compiler_name: gcc
45+
compiler_version: 13
46+
- release: 9.4
47+
compiler_name: gcc
48+
compiler_version: 14
4149
- release: 9.6
4250
compiler_name: gcc
4351
compiler_version: 13
@@ -106,6 +114,7 @@ jobs:
106114
CONAN_VERSION=${{ env.CONAN_VERSION }}
107115
GCC_VERSION=${{ matrix.os.compiler_version }}
108116
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
117+
CMAKE_VERSION=${{ env.CMAKE_VERSION }}
109118
RHEL_VERSION=${{ matrix.os.release }}
110119
context: .
111120
file: docker/rhel/Dockerfile
@@ -139,6 +148,12 @@ jobs:
139148
- release: 9.4
140149
compiler_name: gcc
141150
compiler_version: 12
151+
- release: 9.4
152+
compiler_name: gcc
153+
compiler_version: 13
154+
- release: 9.4
155+
compiler_name: gcc
156+
compiler_version: 14
142157
- release: 9.6
143158
compiler_name: gcc
144159
compiler_version: 13

.github/workflows/tools-rippled.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
paths:
66
- .github/workflows/tools-rippled.yml
77
- docker/tools-rippled/Dockerfile
8+
workflow_dispatch:
89

910
concurrency:
1011
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/ubuntu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- .github/workflows/ubuntu.yml
77
- docker/ubuntu/Dockerfile
88
- test
9+
workflow_dispatch:
910

1011
concurrency:
1112
group: ${{ github.workflow }}-${{ github.ref }}
@@ -20,6 +21,7 @@ env:
2021
BUILDKIT_PROGRESS: plain
2122
CONAN_VERSION: 2.19.1
2223
GCOVR_VERSION: 8.3
24+
CMAKE_VERSION: 3.31.6
2325
FALLBACK_GCC: 12
2426
FALLBACK_CLANG: 16
2527

@@ -108,6 +110,7 @@ jobs:
108110
CONAN_VERSION=${{ env.CONAN_VERSION }}
109111
GCC_VERSION=${{ matrix.os.compiler_name == 'gcc' && matrix.os.compiler_version || env.FALLBACK_GCC }}
110112
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
113+
CMAKE_VERSION=${{ env.CMAKE_VERSION }}
111114
UBUNTU_VERSION=${{ matrix.os.release }}
112115
context: .
113116
file: docker/ubuntu/Dockerfile

docker/debian/Dockerfile

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# image, even though it is not used for Clang.
99
ARG DEBIAN_VERSION
1010
ARG GCC_VERSION=invalid
11-
FROM gcc:${GCC_VERSION}-${DEBIAN_VERSION} AS gcc-src
11+
ARG BASE_IMAGE=gcc:${GCC_VERSION}-${DEBIAN_VERSION}
12+
FROM ${BASE_IMAGE} AS gcc-src
1213

1314
# ====================== BASE IMAGE ======================
1415
FROM debian:${DEBIAN_VERSION} AS base
@@ -37,18 +38,18 @@ EOF
3738
RUN <<EOF
3839
pkgs=()
3940
pkgs+=(ca-certificates) # Enable TLS verification for HTTPS connections by providing trusted root certificates.
40-
pkgs+=(cmake) # Required build tool.
4141
pkgs+=(curl) # Dependency for tools requiring downloading data.
4242
pkgs+=(dpkg-dev) # Required packaging tool.
43+
pkgs+=(debhelper) # Required packaging tool.
4344
pkgs+=(file) # Required packaging tool.
4445
pkgs+=(git) # Required build tool.
4546
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
4647
pkgs+=(gpg-agent) # Dependency for tools requiring signing or encrypting/decrypting.
4748
pkgs+=(jq) # JSON manipulation.
4849
pkgs+=(libc6-dev) # Required build tool.
4950
pkgs+=(ninja-build) # Required build tool.
50-
pkgs+=(pipx) # Package manager for Python applications.
51-
pkgs+=(python3-jinja2) # Required build tool.
51+
pkgs+=(python3-venv) # Python environment management tool.
52+
pkgs+=(python3-pip) # Package manager for Python applications.
5253
pkgs+=(vim) # Text editor.
5354
pkgs+=(wget) # Required build tool.
5455
apt-get update
@@ -57,14 +58,18 @@ apt-get clean
5758
rm -rf /var/lib/apt/lists/*
5859
EOF
5960

60-
# Install Python-based tools.
61+
# Install Python-based tools and cmake.
6162
ARG CONAN_VERSION
6263
ARG GCOVR_VERSION
63-
ENV PIPX_HOME=/opt/pipx \
64-
PIPX_BIN_DIR=/usr/bin \
65-
PIPX_MAN_DIR=/usr/share/man
66-
RUN pipx install --pip-args='--no-cache' conan==${CONAN_VERSION} && \
67-
pipx install --pip-args='--no-cache' gcovr==${GCOVR_VERSION}
64+
ARG CMAKE_VERSION
65+
66+
ENV VIRTUAL_ENV=/opt/venv
67+
RUN python3 -m venv ${VIRTUAL_ENV}
68+
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
69+
RUN pip install --no-cache \
70+
conan==${CONAN_VERSION} \
71+
gcovr==${GCOVR_VERSION} \
72+
cmake==${CMAKE_VERSION}
6873

6974
# ====================== GCC IMAGE ======================
7075
FROM base AS gcc
@@ -83,6 +88,13 @@ ldconfig -v
8388
dpkg-divert --divert /usr/bin/gcc.orig --rename /usr/bin/gcc
8489
dpkg-divert --divert /usr/bin/g++.orig --rename /usr/bin/g++
8590
dpkg-divert --divert /usr/bin/gfortran.orig --rename /usr/bin/gfortran
91+
dpkg-divert --divert /usr/bin/gcc-ar.orig --rename /usr/bin/gcc-ar
92+
dpkg-divert --divert /usr/bin/gcc-nm.orig --rename /usr/bin/gcc-nm
93+
dpkg-divert --divert /usr/bin/gcc-ranlib.orig --rename /usr/bin/gcc-ranlib
94+
dpkg-divert --divert /usr/bin/gcov.orig --rename /usr/bin/gcov
95+
dpkg-divert --divert /usr/bin/gcov-tool.orig --rename /usr/bin/gcov-tool
96+
dpkg-divert --divert /usr/bin/gcov-dump.orig --rename /usr/bin/gcov-dump
97+
dpkg-divert --divert /usr/bin/lto-dump.orig --rename /usr/bin/lto-dump
8698
update-alternatives \
8799
--install /usr/bin/cc cc /usr/local/bin/gcc 999
88100
update-alternatives \

0 commit comments

Comments
 (0)