@@ -9,10 +9,11 @@ ENTRYPOINT ["/bin/bash"]
99# Ensure any packages installed directly or indirectly via dpkg do not require
1010# manual interaction.
1111ARG DEBIAN_FRONTEND=noninteractive
12- RUN apt update && apt upgrade -y
1312RUN <<EOF
1413set -ex
1514ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
15+ apt update
16+ apt upgrade -y
1617apt install -y tzdata
1718dpkg-reconfigure --frontend noninteractive tzdata
1819EOF
@@ -34,7 +35,8 @@ pkgs+=(libc6-dev) # Required build tool.
3435pkgs+=(ninja-build) # Required build tool.
3536pkgs+=(pipx) # Package manager for Python applications.
3637pkgs+=(wget) # Required build tool.
37- apt update && apt install -y "${pkgs[@]}"
38+ apt update
39+ apt install -y "${pkgs[@]}"
3840EOF
3941
4042# Install Conan.
@@ -55,7 +57,7 @@ FROM base AS gcc
5557ARG GCC_VERSION
5658RUN apt install -y gcc-${GCC_VERSION} g++-${GCC_VERSION}
5759ENV CC=/usr/bin/gcc-${GCC_VERSION}
58- ENV CXX=/usr/bin/gcc -${GCC_VERSION}
60+ ENV CXX=/usr/bin/g++ -${GCC_VERSION}
5961
6062# Clean up unnecessary files to reduce image size.
6163RUN rm -rf /var/lib/apt/lists/* && apt clean
@@ -68,6 +70,13 @@ WORKDIR /home/${NONROOT_USER}
6870RUN conan profile detect
6971# Fix the C++ dialect.
7072RUN sed -i -e 's|^compiler\. cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
73+ # Explicitly set the compiler flags.
74+ RUN <<EOF
75+ cat >>~/.conan2/profiles/default <<EOT
76+ [conf]
77+ tools.build:compiler_executables={"c" : "${CC}" , "cpp" : "${CXX}" }
78+ EOT
79+ EOF
7180# Print the Conan profile to verify the configuration.
7281RUN conan profile show
7382
@@ -91,17 +100,21 @@ WORKDIR /home/${NONROOT_USER}
91100RUN conan profile detect
92101# Fix the C++ dialect.
93102RUN sed -i -e 's|^compiler\. cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
94- # To ensure compatibility with a range of Clang compilers, we must add extra
95- # flags that apply to certain versions of Clang.
96- # TODO: Move this into the rippled repository as a custom Conan profile.
103+ # Explicitly set the compiler flags. To ensure compatibility with a range of
104+ # Clang compilers, we must also add extra flags that apply to certain versions
105+ # of Clang.
106+ # TODO: Move extra flags into the rippled repository as a custom Conan profile.
97107RUN <<EOF
108+ cat >>~/.conan2/profiles/default <<EOT
109+ [conf]
110+ tools.build:compiler_executables={"c" : "${CC}" , "cpp" : "${CXX}" }
111+ EOT
98112if [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K [0-9]{2}' ) -ge 20 ]]; then
99113 cat >>~/.conan2/profiles/default <<EOT
100114tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw' , '-Wno-deprecated-declarations' ]
101115EOT
102116elif [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K [0-9]{2}' ) -eq 19 ]]; then
103117 cat >>~/.conan2/profiles/default <<EOT
104- [conf]
105118tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw' ]
106119EOT
107120fi
0 commit comments