Skip to content

Commit 95b12f2

Browse files
committed
[CI] issue: HPCINFRA-3512 Add support for C++14 in cppcheck
Currently cppcheck only supports C++11. In this change we update cppcheck to v2.17.1, which fully supports C++14 and add C++14 standard support in cppcheck.sh. In addition, we split cppcheck and csbuild containers as they require different packages and interfere when run in the same container. Signed-off-by: Viacheslav Login <[email protected]>
1 parent af2121d commit 95b12f2

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

.ci/dockerfiles/Dockerfile.rhel8.6

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,28 @@ RUN echo "${_LOGIN} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
1313
chown -R ${_LOGIN} ${_HOME} && \
1414
mkdir /build && chown -R ${_LOGIN} /build
1515

16-
FROM core as static
17-
ARG _LOGIN=swx-jenkins
16+
FROM core as cppcheck
17+
ENV CPPCHECK_VERSION="2.17.1"
18+
RUN yum install -y curl make gcc gcc-c++ sudo procps-ng autoconf \
19+
automake make libtool libnl3-devel libnl3 rdma-core-devel \
20+
rdma-core bc git \
21+
&& yum clean all \
22+
&& pushd /tmp \
23+
&& curl -L -o "${CPPCHECK_VERSION}".tar.gz "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" \
24+
&& tar xvf "$CPPCHECK_VERSION".tar.gz \
25+
&& cd cppcheck-"$CPPCHECK_VERSION" \
26+
&& make -j8 FILESDIR=/usr/share/cppcheck \
27+
&& make install FILESDIR=/usr/share/cppcheck \
28+
&& popd \
29+
&& rm -rf /tmp/cppcheck-"$CPPCHECK_VERSION"*
30+
ENTRYPOINT [ "/bin/bash", "--login", "--rcfile", "/etc/bashrc", "-c" ]
1831

32+
FROM core as csbuild
33+
ARG _LOGIN=swx-jenkins
1934
RUN yum install -y yum-utils \
20-
&& yum-config-manager --add-repo https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/ \
21-
&& yum --nogpgcheck install -y cppcheck \
2235
&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
23-
&& yum install -y csbuild clang-tools-extra sudo curl autoconf automake make libtool \
36+
&& yum --nogpgcheck install -y curl make gcc gcc-c++ \
37+
&& yum install -y csbuild clang-tools-extra sudo autoconf automake libtool \
2438
libnl3-devel libnl3 rdma-core-devel rdma-core bc \
2539
&& yum clean all
2640

.ci/matrix_job.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ runs_on_dockers:
9595
arch: 'x86_64',
9696
name: 'xlio_static.cppcheck',
9797
uri: '$arch/$name',
98-
tag: '20250304',
99-
build_args: '--no-cache --target static',
98+
tag: '20250425',
99+
build_args: '--no-cache --target cppcheck',
100100
category: 'tool'
101101
}
102102
- {file: '.ci/dockerfiles/Dockerfile.rhel8.6',
103103
arch: 'x86_64',
104104
name: 'xlio_static.csbuild',
105105
uri: '$arch/$name',
106-
tag: '20250304',
107-
build_args: '--no-cache --target static',
106+
tag: '20250425',
107+
build_args: '--no-cache --target csbuild',
108108
category: 'tool'
109109
}
110110

contrib/jenkins_tests/cppcheck.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ${WORKSPACE}/configure $jenkins_test_custom_configure > "${cppcheck_dir}/cppchec
2424

2525
set +eE
2626
eval "find ${WORKSPACE}/src -name '*.h' -o -name '*.cpp' -o -name '*.c' -o -name '*.hpp' | \
27-
${tool_app} --std=c++11 --language=c++ --force --enable=information \
27+
${tool_app} --std=c++14 --language=c++ --force --enable=information \
2828
-I${WORKSPACE}/src \
2929
-I${WORKSPACE}/src/stats \
3030
-I${WORKSPACE}/src/utils \

0 commit comments

Comments
 (0)