Skip to content

Conversation

@vialogi
Copy link
Contributor

@vialogi vialogi commented Apr 25, 2025

Description

Add C++14 support in cppcheck container

What

Update the cppcheck static analysis tool to version 2.12.1 with C++14 support in the cppcheck container.

Why ?

The current cppcheck version from EPEL7 repository is outdated and lacks proper support for C++14 features

How ?

Build cppcheck 2.12.1 from source in the CI container, update cppcheck.sh to use --std=c++14 flag

Change type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

Check list

  • Code follows the style de facto guidelines of this project
  • Comments have been inserted in hard to understand places
  • Documentation has been updated (if necessary)
  • Test has been added (if possible)

@vialogi vialogi force-pushed the HPCINFRA-3512_cppcheck_up_cpp14 branch 16 times, most recently from 7639df3 to 020365a Compare April 29, 2025 14:48
@vialogi vialogi changed the title [CI] HPCINFRA-3512 add support for C++14 in cppcheck container [CI] issue: HPCINFRA-3512 add support for C++14 in cppcheck container Apr 30, 2025
@vialogi vialogi force-pushed the HPCINFRA-3512_cppcheck_up_cpp14 branch 8 times, most recently from 87bf680 to 68e3568 Compare May 6, 2025 13:09
@vialogi
Copy link
Contributor Author

vialogi commented May 6, 2025

@vialogi vialogi force-pushed the HPCINFRA-3512_cppcheck_up_cpp14 branch 2 times, most recently from f9dbd41 to 2b76775 Compare May 6, 2025 14:57
@vialogi
Copy link
Contributor Author

vialogi commented May 6, 2025

bot:retest

@vialogi vialogi requested a review from dpressle May 7, 2025 04:59
@vialogi vialogi requested a review from tomerdbz May 7, 2025 05:09
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]>
@vialogi vialogi force-pushed the HPCINFRA-3512_cppcheck_up_cpp14 branch from 2b76775 to 95b12f2 Compare May 7, 2025 08:50
@vialogi
Copy link
Contributor Author

vialogi commented May 16, 2025

/review

@pr-review-bot-app
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Misconfiguration

The addition of the --std=c++14 flag in the cppcheck command should be validated to ensure it works correctly with the updated cppcheck version and does not cause unexpected issues in the CI pipeline.

${tool_app} --std=c++14 --language=c++ --force --enable=information \
Dependency Management

The Dockerfile introduces a new dependency installation process for cppcheck 2.17.1. Ensure that the build process is stable and does not introduce unnecessary overhead or conflicts with other dependencies.

FROM core as cppcheck
ENV CPPCHECK_VERSION="2.17.1"
RUN yum install -y curl make gcc gcc-c++ sudo procps-ng autoconf \
    automake make libtool libnl3-devel libnl3 rdma-core-devel \
    rdma-core bc git \
 && yum clean all \
 && pushd /tmp \
 && curl -L -o "${CPPCHECK_VERSION}".tar.gz "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" \
 && tar xvf "$CPPCHECK_VERSION".tar.gz \
 && cd cppcheck-"$CPPCHECK_VERSION" \
 && make -j8 FILESDIR=/usr/share/cppcheck \
 && make install FILESDIR=/usr/share/cppcheck \
 && popd \
 && rm -rf /tmp/cppcheck-"$CPPCHECK_VERSION"* 

@dpressle
Copy link
Collaborator

bot:retest

@svc-nbu-swx-media
Copy link

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants