@@ -44,13 +44,13 @@ pkgs+=(file) # Required packaging tool.
4444pkgs+=(git) # Required build tool.
4545pkgs+=(gpg) # Dependency for tools requiring signing or encrypting/decrypting.
4646pkgs+=(gpg-agent) # Dependency for tools requiring signing or encrypting/decrypting.
47- pkgs+=(jq) # Pretty printing .
47+ pkgs+=(jq) # JSON manipulation .
4848pkgs+=(libc6-dev) # Required build tool.
4949pkgs+=(ninja-build) # Required build tool.
5050pkgs+=(pipx) # Package manager for Python applications.
5151pkgs+=(python3-jinja2) # Required build tool.
52- pkgs+=(wget) # Required build tool.
5352pkgs+=(vim) # Text editor.
53+ pkgs+=(wget) # Required build tool.
5454apt-get update
5555apt-get install -y --no-install-recommends "${pkgs[@]}"
5656apt-get clean
@@ -72,6 +72,7 @@ FROM base AS gcc
7272# These are not inherited from base image.
7373ARG DEBIAN_VERSION
7474ARG 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.
104105ENV CC=/usr/bin/gcc
105106ENV 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.
111109RUN <<EOF
112110CC_VER=$(${CC} -dumpversion)
113111CC_VER=${CC_VER%%.*}
@@ -135,14 +133,20 @@ conan profile detect
135133rm -rf /tmp/*
136134EOF
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.
139147RUN <<EOF
140148cat >> $(conan config home)/global.conf <<EOT
141149tools.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
146150EOT
147151EOF
148152
@@ -164,9 +168,8 @@ FROM base AS clang
164168ARG DEBIAN_VERSION
165169ARG 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.
170173ARG CLANG_VERSION
171174RUN <<EOF
172175apt-get update
@@ -225,14 +228,20 @@ conan profile detect
225228rm -rf /tmp/*
226229EOF
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.
229242RUN <<EOF
230243cat >> $(conan config home)/global.conf <<EOT
231244tools.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
236245EOT
237246EOF
238247
0 commit comments