GNU bug report logs - #77750
[PATCH] gnu: cppcheck: Update to 2.17.1

Previous Next

Package: guix-patches;

Reported by: Florent Pruvost <florent.pruvost <at> inria.fr>

Date: Fri, 11 Apr 2025 17:23:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77750 in the body.
You can then email your comments to 77750 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#77750; Package guix-patches. (Fri, 11 Apr 2025 17:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florent Pruvost <florent.pruvost <at> inria.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 11 Apr 2025 17:23:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Florent Pruvost <florent.pruvost <at> inria.fr>
To: guix-patches <at> gnu.org
Cc: Florent Pruvost <florent.pruvost <at> inria.fr>
Subject: [PATCH] gnu: cppcheck: Update to 2.17.1
Date: Fri, 11 Apr 2025 15:42:38 +0200
* gnu/packages/check.scm (cppcheck): Update to 2.17.1.
  [source]: Update hash.
  [arguments]: Add patch to fix basedir in test.
  [patches]: Remove cppcheck-disable-char-signedness-test.patch.
  [patches]: Add cppcheck-fix-basedir-test.patch.

Change-Id: Iebd33e2966ef30a3cd5b7b157f1051fcacbe1884
---
 gnu/local.mk                                  |  2 +-
 gnu/packages/check.scm                        |  6 ++--
 ...ppcheck-disable-char-signedness-test.patch | 27 --------------
 .../patches/cppcheck-fix-basedir-test.patch   | 36 +++++++++++++++++++
 4 files changed, 40 insertions(+), 31 deletions(-)
 delete mode 100644 gnu/packages/patches/cppcheck-disable-char-signedness-test.patch
 create mode 100644 gnu/packages/patches/cppcheck-fix-basedir-test.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 29bf4c72b8..83bb56f304 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1145,7 +1145,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/corefx-mono-5.4.0-patches.patch		\
   %D%/packages/patches/corefx-mono-pre-5.8.0-patches.patch	\
   %D%/packages/patches/coreutils-gnulib-tests.patch		\
-  %D%/packages/patches/cppcheck-disable-char-signedness-test.patch	\
+  %D%/packages/patches/cppcheck-fix-basedir-test.patch	\
   %D%/packages/patches/cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch\
   %D%/packages/patches/cpulimit-with-glib-2.32.patch		\
   %D%/packages/patches/crawl-upgrade-saves.patch		\
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 8193dd785f..db820766eb 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -791,7 +791,7 @@ (define-public cmocka
 (define-public cppcheck
   (package
     (name "cppcheck")
-    (version "2.10.3")
+    (version "2.17.1")
     (source (origin
       (method git-fetch)
       (uri (git-reference
@@ -799,8 +799,8 @@ (define-public cppcheck
              (commit version)))
       (file-name (git-file-name name version))
       (sha256
-       (base32 "1xfxcg00rxjrb9m2k78yd3jjlldkciv67fsbmjb6n3l43hgfxb9k"))
-      (patches (search-patches "cppcheck-disable-char-signedness-test.patch"))))
+       (base32 "19ap9ai9s4vsygyqfa215mrmpz4vki63d5b4qdb89zvbldaf3hlf"))
+       (patches (search-patches "cppcheck-fix-basedir-test.patch"))))
     (build-system cmake-build-system)
     (arguments
      '(#:configure-flags '("-DBUILD_TESTS=ON")))
diff --git a/gnu/packages/patches/cppcheck-disable-char-signedness-test.patch b/gnu/packages/patches/cppcheck-disable-char-signedness-test.patch
deleted file mode 100644
index d39d300f84..0000000000
--- a/gnu/packages/patches/cppcheck-disable-char-signedness-test.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-https://sources.debian.org/data/main/c/cppcheck/2.10-2/debian/patches/disable-some-tests-about-char-signedness
-https://trac.cppcheck.net/ticket/11537
-
-Description: Disable some tests affected by char signedness.
-Author: Joachim Reichel <reichel <at> debian.org>
-Bug: https://trac.cppcheck.net/ticket/11537
-
-Index: cppcheck/test/testcondition.cpp
-===================================================================
---- cppcheck.orig/test/testcondition.cpp
-+++ cppcheck/test/testcondition.cpp
-@@ -4939,6 +4939,7 @@ private:
-               "}\n");
-         ASSERT_EQUALS("[test.cpp:4]: (style) Condition 'it!=vector.end()' is always true\n", errout.str());
- 
-+#if 0
-         // #11303
-         check("void f(int n) {\n"
-               "    std::vector<char> buffer(n);\n"
-@@ -4947,6 +4948,7 @@ private:
-               "       buffer.back() == '\\0') {}\n"
-               "}\n");
-         ASSERT_EQUALS("[test.cpp:5]: (style) Condition 'buffer.back()=='\\0'' is always false\n", errout.str());
-+#endif
- 
-         // #9353
-         check("typedef struct { std::string s; } X;\n"
diff --git a/gnu/packages/patches/cppcheck-fix-basedir-test.patch b/gnu/packages/patches/cppcheck-fix-basedir-test.patch
new file mode 100644
index 0000000000..06a1422629
--- /dev/null
+++ b/gnu/packages/patches/cppcheck-fix-basedir-test.patch
@@ -0,0 +1,36 @@
+Fix the test "TestFileLister" by giving precisely the source directory instead of guessing it.
+Author: Florent Pruvost <florent.pruvost <at> inria.fr>
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 467e6e95e..d68d83e3d 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -85,6 +85,7 @@ if (BUILD_TESTS)
+             elseif(TEST ${NAME})
+             else()
+                 add_test(NAME ${NAME} COMMAND $<TARGET_FILE:testrunner> ${NAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
++                set_tests_properties(${NAME} PROPERTIES ENVIRONMENT "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}")
+             endif()
+         endfunction()
+ 
+diff --git a/test/testfilelister.cpp b/test/testfilelister.cpp
+index 3e2f56dfc..ecf0f9c6e 100644
+--- a/test/testfilelister.cpp
++++ b/test/testfilelister.cpp
+@@ -45,15 +45,7 @@ private:
+ 
+     // TODO: generate file list instead
+     static std::string findBaseDir() {
+-        std::string basedir;
+-        while (!Path::isDirectory(Path::join(basedir, ".github"))) {
+-            const std::string abspath = Path::getAbsoluteFilePath(basedir);
+-            basedir += "../";
+-            // no more going up
+-            if (Path::getAbsoluteFilePath(basedir) == abspath)
+-                throw std::runtime_error("could not find repository root directory");
+-        }
+-        return basedir;
++        return Path::getAbsoluteFilePath(std::getenv("PROJECT_SOURCE_DIR")) + "/";
+     }
+ 
+     void recursiveAddFiles() const {

base-commit: 6036f1f3053bc9b4f0411b5e8aeaab5bd7f4ec7b
-- 
2.43.0





Reply sent to Ludovic Courtès <ludovic.courtes <at> inria.fr>:
You have taken responsibility. (Tue, 15 Apr 2025 07:45:02 GMT) Full text and rfc822 format available.

Notification sent to Florent Pruvost <florent.pruvost <at> inria.fr>:
bug acknowledged by developer. (Tue, 15 Apr 2025 07:45:02 GMT) Full text and rfc822 format available.

Message #10 received at 77750-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: Florent Pruvost <florent.pruvost <at> inria.fr>
Cc: 77750-done <at> debbugs.gnu.org
Subject: Re: [bug#77750] [PATCH] gnu: cppcheck: Update to 2.17.1
Date: Tue, 15 Apr 2025 09:44:24 +0200
Hello!

Florent Pruvost <florent.pruvost <at> inria.fr> writes:

> * gnu/packages/check.scm (cppcheck): Update to 2.17.1.
>   [source]: Update hash.
>   [arguments]: Add patch to fix basedir in test.
>   [patches]: Remove cppcheck-disable-char-signedness-test.patch.
>   [patches]: Add cppcheck-fix-basedir-test.patch.
>
> Change-Id: Iebd33e2966ef30a3cd5b7b157f1051fcacbe1884

Pushed with a slightly modified commit log.

While running ‘guix build -P1 cppcheck’, I noticed that microscheme
would fail to build, so I added a commit removing cppcheck from its
inputs (it’s not necessary, just a developer helper).

Thanks! :-)

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 May 2025 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 129 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.