Skip to content

Commit 624dfa3

Browse files
authored
Sets distro-specific OS name (#24)
Packages generally are configured to have the architecture, OS, and compiler+version determine the package ID. This change adds a new OS option per CI image to support the distro being used, e.g. "debian-bookworm".
1 parent fe80c49 commit 624dfa3

File tree

9 files changed

+84
-51
lines changed

9 files changed

+84
-51
lines changed

.github/workflows/debian.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818
env:
1919
CONTAINER_REGISTRY: ghcr.io
2020
BUILDKIT_PROGRESS: plain
21-
CONAN_VERSION: 2.18.0
21+
CONAN_VERSION: 2.19.1
2222
GCOVR_VERSION: 8.3
2323
FALLBACK_GCC: 12
2424
FALLBACK_CLANG: 16

.github/workflows/rhel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
CONTAINER_REGISTRY: ghcr.io
2020
REDHAT_REGISTRY: registry.redhat.io
2121
BUILDKIT_PROGRESS: plain
22-
CONAN_VERSION: 2.18.0
22+
CONAN_VERSION: 2.19.1
2323
GCOVR_VERSION: 8.3
2424

2525
jobs:

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defaults:
1818
env:
1919
CONTAINER_REGISTRY: ghcr.io
2020
BUILDKIT_PROGRESS: plain
21-
CONAN_VERSION: 2.18.0
21+
CONAN_VERSION: 2.19.1
2222
GCOVR_VERSION: 8.3
2323
FALLBACK_GCC: 12
2424
FALLBACK_CLANG: 16

docker/debian/Dockerfile

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ pkgs+=(file) # Required packaging tool.
4444
pkgs+=(git) # Required build tool.
4545
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
4646
pkgs+=(gpg-agent) # Dependency for tools requiring signing or encrypting/decrypting.
47-
pkgs+=(jq) # Pretty printing.
47+
pkgs+=(jq) # JSON manipulation.
4848
pkgs+=(libc6-dev) # Required build tool.
4949
pkgs+=(ninja-build) # Required build tool.
5050
pkgs+=(pipx) # Package manager for Python applications.
5151
pkgs+=(python3-jinja2) # Required build tool.
52-
pkgs+=(wget) # Required build tool.
5352
pkgs+=(vim) # Text editor.
53+
pkgs+=(wget) # Required build tool.
5454
apt-get update
5555
apt-get install -y --no-install-recommends "${pkgs[@]}"
5656
apt-get clean
@@ -72,6 +72,7 @@ FROM base AS gcc
7272
# These are not inherited from base image.
7373
ARG DEBIAN_VERSION
7474
ARG DEBIAN_FRONTEND=noninteractive
75+
ARG GCC_VERSION
7576

7677
# Copy GCC from the source image, make the package manager aware of its
7778
# existence, and create the necessary symlinks.
@@ -104,10 +105,7 @@ EOF
104105
ENV CC=/usr/bin/gcc
105106
ENV CXX=/usr/bin/g++
106107

107-
# Check that the installed GCC version matches the expected version. We must
108-
# repeat the GCC_VERSION argument here, as it is not inherited from the source
109-
# image.
110-
ARG GCC_VERSION
108+
# Check that the installed GCC version matches the expected version.
111109
RUN <<EOF
112110
CC_VER=$(${CC} -dumpversion)
113111
CC_VER=${CC_VER%%.*}
@@ -135,14 +133,20 @@ conan profile detect
135133
rm -rf /tmp/*
136134
EOF
137135

138-
# Explicitly set the compiler flags and the distribution name and version.
136+
# Add the distribution name and version, so they can be taken into account when
137+
# building dependencies. This requires setting the `os` field in the activated
138+
# profile where this image is used to the appropriate value.
139+
RUN <<EOF
140+
cat >> $(conan config home)/settings_user.yml <<EOT
141+
os:
142+
debian-${DEBIAN_VERSION}:
143+
EOT
144+
EOF
145+
146+
# Explicitly set the compiler flags.
139147
RUN <<EOF
140148
cat >> $(conan config home)/global.conf <<EOT
141149
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
142-
tools.info.package_id:confs+=["Debian", "${DEBIAN_VERSION}"]
143-
core.package_id:default_build_mode=full_mode
144-
core.package_id:default_embed_mode=full_mode
145-
core.package_id:default_non_embed_mode=full_mode
146150
EOT
147151
EOF
148152

@@ -164,9 +168,8 @@ FROM base AS clang
164168
ARG DEBIAN_VERSION
165169
ARG DEBIAN_FRONTEND=noninteractive
166170

167-
# Install Clang. Use the LLVM apt repository to access the latest versions. We
168-
# must repeat the DEBIAN_VERSION argument here, as it is not inherited from the
169-
# base or source images. Some build dependencies require GCC to be also available.
171+
# Install Clang. Use the LLVM apt repository to access the latest versions. Some
172+
# build dependencies require GCC to be also available.
170173
ARG CLANG_VERSION
171174
RUN <<EOF
172175
apt-get update
@@ -225,14 +228,20 @@ conan profile detect
225228
rm -rf /tmp/*
226229
EOF
227230

231+
# Add the distribution name and version, so they can be taken into account when
232+
# building dependencies. This requires setting the `os` field in the activated
233+
# profile where this image is used to the appropriate value.
234+
RUN <<EOF
235+
cat >> $(conan config home)/settings_user.yml <<EOT
236+
os:
237+
debian-${DEBIAN_VERSION}:
238+
EOT
239+
EOF
240+
228241
# Explicitly set the compiler flags and the distribution name and version.
229242
RUN <<EOF
230243
cat >> $(conan config home)/global.conf <<EOT
231244
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
232-
tools.info.package_id:confs+=["Debian", "${DEBIAN_VERSION}"]
233-
core.package_id:default_build_mode=full_mode
234-
core.package_id:default_embed_mode=full_mode
235-
core.package_id:default_non_embed_mode=full_mode
236245
EOT
237246
EOF
238247

docker/debian/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ registry.
4545
```shell
4646
DEBIAN_VERSION=bookworm
4747
GCC_VERSION=12
48-
CONAN_VERSION=2.18.0
48+
CONAN_VERSION=2.19.1
4949
GCOVR_VERSION=8.3
5050
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:gcc-${GCC_VERSION}
5151

@@ -69,7 +69,7 @@ registry.
6969
```shell
7070
DEBIAN_VERSION=bookworm
7171
CLANG_VERSION=17
72-
CONAN_VERSION=2.18.0
72+
CONAN_VERSION=2.19.1
7373
GCOVR_VERSION=8.3
7474
CONTAINER_IMAGE=xrplf/ci/debian-${DEBIAN_VERSION}:clang-${CLANG_VERSION}
7575

docker/rhel/Dockerfile

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ pkgs+=(file) # Required packaging tool.
1919
pkgs+=(git) # Required build tool.
2020
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
2121
pkgs+=(gnupg2) # Dependency for tools requiring signing or encrypting/decrypting.
22-
pkgs+=(jq) # Pretty printing.
22+
pkgs+=(jq) # JSON manipulation.
2323
pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
2424
pkgs+=(ninja-build) # Required build tool.
2525
pkgs+=(perl-FindBin) # Required to compile OpenSSL.
2626
pkgs+=(python3-jinja2) # Required build tool.
2727
pkgs+=(python3-pip) # Package manager for Python applications.
2828
pkgs+=(rpm-build) # Required packaging tool.
2929
pkgs+=(rpmdevtools) # Required packaging tool.
30-
pkgs+=(wget) # Required build tool.
3130
pkgs+=(vim) # Text editor.
31+
pkgs+=(wget) # Required build tool.
3232
dnf install -y --allowerasing --setopt=tsflags=nodocs "${pkgs[@]}"
3333
dnf clean -y all
3434
rm -rf /var/cache/dnf/*
@@ -103,14 +103,20 @@ conan profile detect
103103
rm -rf /tmp/*
104104
EOF
105105

106-
# Explicitly set the compiler flags and the distribution name and version.
106+
# Add the distribution name and version, so they can be taken into account when
107+
# building dependencies. This requires setting the `os` field in the activated
108+
# profile where this image is used to the appropriate value.
109+
RUN <<EOF
110+
cat >> $(conan config home)/settings_user.yml <<EOT
111+
os:
112+
rhel-${RHEL_VERSION}:
113+
EOT
114+
EOF
115+
116+
# Explicitly set the compiler flags.
107117
RUN <<EOF
108118
cat >> $(conan config home)/global.conf <<EOT
109119
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
110-
tools.info.package_id:confs+=["RHEL", "${RHEL_VERSION}"]
111-
core.package_id:default_build_mode=full_mode
112-
core.package_id:default_embed_mode=full_mode
113-
core.package_id:default_non_embed_mode=full_mode
114120
EOT
115121
EOF
116122

@@ -178,14 +184,20 @@ conan profile detect
178184
rm -rf /tmp/*
179185
EOF
180186

181-
# Explicitly set the compiler flags and the distribution name and version.
187+
# Add the distribution name and version, so they can be taken into account when
188+
# building dependencies. This requires setting the `os` field in the activated
189+
# profile where this image is used to the appropriate value.
190+
RUN <<EOF
191+
cat >> $(conan config home)/settings_user.yml <<EOT
192+
os:
193+
rhel-${RHEL_VERSION}:
194+
EOT
195+
EOF
196+
197+
# Explicitly set the compiler flags.
182198
RUN <<EOF
183199
cat >> $(conan config home)/global.conf <<EOT
184200
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
185-
tools.info.package_id:confs+=["RHEL", "${RHEL_VERSION}"]
186-
core.package_id:default_build_mode=full_mode
187-
core.package_id:default_embed_mode=full_mode
188-
core.package_id:default_non_embed_mode=full_mode
189201
EOT
190202
EOF
191203

docker/rhel/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ registry.
6060
```shell
6161
RHEL_VERSION=9.6
6262
GCC_VERSION=13
63-
CONAN_VERSION=2.18.0
63+
CONAN_VERSION=2.19.1
6464
GCOVR_VERSION=8.3
6565
CONTAINER_IMAGE=xrplf/ci/rhel-${RHEL_VERSION}:gcc-${GCC_VERSION}
6666

@@ -83,7 +83,7 @@ registry.
8383

8484
```shell
8585
RHEL_VERSION=9.6
86-
CONAN_VERSION=2.18.0
86+
CONAN_VERSION=2.19.1
8787
GCOVR_VERSION=8.3
8888
CONTAINER_IMAGE=xrplf/ci/rhel-${RHEL_VERSION}:clang-${CLANG_VERSION}
8989

docker/ubuntu/Dockerfile

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ pkgs+=(file) # Required packaging tool.
3333
pkgs+=(git) # Required build tool.
3434
pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
3535
pkgs+=(gpg-agent) # Dependency for tools requiring signing or encrypting/decrypting.
36-
pkgs+=(jq) # Pretty printing.
36+
pkgs+=(jq) # JSON manipulation.
3737
pkgs+=(libc6-dev) # Required build tool.
3838
pkgs+=(ninja-build) # Required build tool.
3939
pkgs+=(pipx) # Package manager for Python applications.
4040
pkgs+=(python3-jinja2) # Required build tool.
41-
pkgs+=(wget) # Required build tool.
4241
pkgs+=(vim) # Text editor.
42+
pkgs+=(wget) # Required build tool.
4343
apt-get update
4444
apt-get install -y --no-install-recommends "${pkgs[@]}"
4545
apt-get clean
@@ -119,14 +119,20 @@ conan profile detect
119119
rm -rf /tmp/*
120120
EOF
121121

122-
# Explicitly set the compiler flags and the distribution name and version.
122+
# Add the distribution name and version, so they can be taken into account when
123+
# building dependencies. This requires setting the `os` field in the activated
124+
# profile where this image is used to the appropriate value.
125+
RUN <<EOF
126+
cat >> $(conan config home)/settings_user.yml <<EOT
127+
os:
128+
ubuntu-${UBUNTU_VERSION}:
129+
EOT
130+
EOF
131+
132+
# Explicitly set the compiler flags.
123133
RUN <<EOF
124134
cat >> $(conan config home)/global.conf <<EOT
125135
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
126-
tools.info.package_id:confs+=["Ubuntu", "${UBUNTU_VERSION}"]
127-
core.package_id:default_build_mode=full_mode
128-
core.package_id:default_embed_mode=full_mode
129-
core.package_id:default_non_embed_mode=full_mode
130136
EOT
131137
EOF
132138

@@ -205,14 +211,20 @@ conan profile detect
205211
rm -rf /tmp/*
206212
EOF
207213

208-
# Explicitly set the compiler flags and the distribution name and version.
214+
# Add the distribution name and version, so they can be taken into account when
215+
# building dependencies. This requires setting the `os` field in the activated
216+
# profile where this image is used to the appropriate value.
217+
RUN <<EOF
218+
cat >> $(conan config home)/settings_user.yml <<EOT
219+
os:
220+
ubuntu-${UBUNTU_VERSION}:
221+
EOT
222+
EOF
223+
224+
# Explicitly set the compiler flags.
209225
RUN <<EOF
210226
cat >> $(conan config home)/global.conf <<EOT
211227
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
212-
tools.info.package_id:confs+=["Ubuntu", "${UBUNTU_VERSION}"]
213-
core.package_id:default_build_mode=full_mode
214-
core.package_id:default_embed_mode=full_mode
215-
core.package_id:default_non_embed_mode=full_mode
216228
EOT
217229
EOF
218230

docker/ubuntu/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ registry.
4141
```shell
4242
UBUNTU_VERSION=noble
4343
GCC_VERSION=14
44-
CONAN_VERSION=2.18.0
44+
CONAN_VERSION=2.19.1
4545
GCOVR_VERSION=8.3
4646
CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:gcc-${GCC_VERSION}
4747

@@ -65,7 +65,7 @@ registry.
6565
```shell
6666
UBUNTU_VERSION=noble
6767
CLANG_VERSION=18
68-
CONAN_VERSION=2.18.0
68+
CONAN_VERSION=2.19.1
6969
GCOVR_VERSION=8.3
7070
CONTAINER_IMAGE=xrplf/ci/ubuntu-${UBUNTU_VERSION}:clang-${CLANG_VERSION}
7171

0 commit comments

Comments
 (0)