Skip to content

Commit 317fcd6

Browse files
committed
Fix clang binary call and Conan home directory
1 parent ddd929a commit 317fcd6

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

docker/debian/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ WORKDIR /home/${NONROOT_USER}
9292
# Create a default Conan profile.
9393
RUN conan profile detect
9494
# Fix the C++ dialect.
95-
RUN sed -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
95+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
9696
# Print the Conan profile to verify the configuration.
9797
RUN conan profile show
9898

@@ -123,21 +123,21 @@ WORKDIR /home/${NONROOT_USER}
123123

124124
# Create a default Conan profile.
125125
RUN conan profile detect
126+
# Fix the C++ dialect.
127+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
126128
# To ensure compatibility with a range of Clang compilers, we must add extra
127129
# flags that applies to certain versions of Clang.
128130
RUN <<EOF
129-
if [[ $(clang --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
130-
cat >>${CONAN_HOME}/profiles/default <<EOT
131+
if [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
132+
cat >>~/.conan2/profiles/default <<EOT
131133
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw', '-Wno-deprecated-declarations']
132134
EOT
133-
elif [[ $(clang --version | head -1 | grep -Po 'version \K[0-9]{2}') -eq 19 ]]; then
134-
cat >>${CONAN_HOME}/profiles/default <<EOT
135+
elif [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K[0-9]{2}') -eq 19 ]]; then
136+
cat >>~/.conan2/profiles/default <<EOT
135137
[conf]
136138
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
137139
EOT
138140
fi
139141
EOF
140-
# Fix the C++ dialect.
141-
RUN sed -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
142142
# Print the Conan profile to verify the configuration.
143143
RUN conan profile show

docker/rhel/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ENV CONAN_HOME=/home/${NONROOT_USER}/.conan2
5252
# Create a default Conan profile.
5353
RUN conan profile detect
5454
# Fix the C++ dialect.
55-
RUN sed -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
55+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
5656
# Print the Conan profile to verify the configuration.
5757
RUN conan profile show
5858

@@ -75,6 +75,8 @@ ENV CONAN_HOME=/home/${NONROOT_USER}/.conan2
7575

7676
# Create a default Conan profile.
7777
RUN conan profile detect
78+
# Fix the C++ dialect.
79+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
7880
# To ensure compatibility with a range of Clang compilers, we must add extra
7981
# flags that applies to certain versions of Clang.
8082
RUN <<EOF
@@ -89,7 +91,5 @@ tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
8991
EOT
9092
fi
9193
EOF
92-
# Fix the C++ dialect.
93-
RUN sed -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
9494
# Print the Conan profile to verify the configuration.
9595
RUN conan profile show

docker/ubuntu/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ WORKDIR /home/${NONROOT_USER}
6464
# Create a default Conan profile.
6565
RUN conan profile detect
6666
# Fix the C++ dialect.
67-
RUN sed -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
67+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
6868
# Print the Conan profile to verify the configuration.
6969
RUN conan profile show
7070

@@ -86,21 +86,21 @@ WORKDIR /home/${NONROOT_USER}
8686

8787
# Create a default Conan profile.
8888
RUN conan profile detect
89+
# Fix the C++ dialect.
90+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
8991
# To ensure compatibility with a range of Clang compilers, we must add extra
9092
# flags that applies to certain versions of Clang.
9193
RUN <<EOF
92-
if [[ $(clang --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
93-
cat >>${CONAN_HOME}/profiles/default <<EOT
94+
if [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K[0-9]{2}') -ge 20 ]]; then
95+
cat >>~/.conan2/profiles/default <<EOT
9496
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw', '-Wno-deprecated-declarations']
9597
EOT
96-
elif [[ $(clang --version | head -1 | grep -Po 'version \K[0-9]{2}') -eq 19 ]]; then
97-
cat >>${CONAN_HOME}/profiles/default <<EOT
98+
elif [[ $(clang-${CLANG_VERSION} --version | head -1 | grep -Po 'version \K[0-9]{2}') -eq 19 ]]; then
99+
cat >>~/.conan2/profiles/default <<EOT
98100
[conf]
99101
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
100102
EOT
101103
fi
102104
EOF
103-
# Fix the C++ dialect.
104-
RUN sed -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
105105
# Print the Conan profile to verify the configuration.
106106
RUN conan profile show

0 commit comments

Comments
 (0)