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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Florent Pruvost <florent.pruvost@HIDDEN>; Keywords: patch; dated Fri, 11 Apr 2025 17:23:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Apr 2025 17:22:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 11 13:22:32 2025
Received: from localhost ([127.0.0.1]:51638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u3I5H-0003x8-Ni
	for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 13:22:32 -0400
Received: from lists.gnu.org ([2001:470:142::17]:55170)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <florent.pruvost@HIDDEN>)
 id 1u3Eeu-0006l2-LL
 for submit <at> debbugs.gnu.org; Fri, 11 Apr 2025 09:43:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <florent.pruvost@HIDDEN>)
 id 1u3Eem-0003PL-BQ
 for guix-patches@HIDDEN; Fri, 11 Apr 2025 09:42:56 -0400
Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <florent.pruvost@HIDDEN>)
 id 1u3Eei-0002Ed-Je
 for guix-patches@HIDDEN; Fri, 11 Apr 2025 09:42:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc;
 h=from:to:cc:subject:date:message-id:mime-version:
 content-transfer-encoding;
 bh=wqU2t6+24LzPdrqupRlLwylGX6GYCjAAQcgswXohvNU=;
 b=K7Yy1cpZvZ2HT66gPfEzcF/07FsNanXMSGym7W9h/0Ajcl79iAvsKmnk
 SwXsR8cRKSgp36wzXTkV2xWo5cZGid+vPlzewCR4rqdwELFWcAly9b4EU
 KmaboVt5QHOc/1u1zFafIqfvkxog+6uWieM2sM0Sh1Xx5kPTG2PpwpOYb 8=;
Authentication-Results: mail2-relais-roc.national.inria.fr;
 dkim=none (message not signed) header.i=none;
 spf=SoftFail smtp.mailfrom=florent.pruvost@HIDDEN;
 dmarc=fail (p=none dis=none) d=inria.fr
X-IronPort-AV: E=Sophos;i="6.15,205,1739833200"; d="scan'208";a="217495795"
Received: from unknown (HELO esthar.bordeaux.inria.fr) ([193.50.110.177])
 by mail2-relais-roc.national.inria.fr with
 ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2025 15:42:48 +0200
From: Florent Pruvost <florent.pruvost@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: cppcheck: Update to 2.17.1
Date: Fri, 11 Apr 2025 15:42:38 +0200
Message-ID: <20250411134238.320182-1-florent.pruvost@HIDDEN>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=192.134.164.83;
 envelope-from=florent.pruvost@HIDDEN;
 helo=mail2-relais-roc.national.inria.fr
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 11 Apr 2025 13:22:30 -0400
Cc: Florent Pruvost <florent.pruvost@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* 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@HIDDEN>
-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@HIDDEN>
+
+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





Acknowledgement sent to Florent Pruvost <florent.pruvost@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#77750; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 11 Apr 2025 17:30:03 UTC

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