From patchwork Fri Apr 11 13:42:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florent Pruvost X-Patchwork-Id: 41596 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 43E1127BC49; Fri, 11 Apr 2025 21:31:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D41C927BC4B for ; Fri, 11 Apr 2025 21:31:17 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u3L1i-0000rp-GM; Fri, 11 Apr 2025 16:31:04 -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 ) id 1u3I5m-0007W1-8k for guix-patches@gnu.org; Fri, 11 Apr 2025 13:23:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u3I5m-0004OV-06 for guix-patches@gnu.org; Fri, 11 Apr 2025 13:23:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=wqU2t6+24LzPdrqupRlLwylGX6GYCjAAQcgswXohvNU=; b=XQtXLScJn+uZ4LbzX5ofILXfp/xRsfsDjlyMJmK600HDk1Z0TEuGRG+/LxW7V4bdqlUoOziE1Fns9/pKN7gcxk8FFCyxSZf7wVxTEsyIoGOInhHbiN0NHy2YA5xvNn3mg97lB/MOJmtknqkmGCxgoPQKyXKlP8ns7ocrOV5TK30y2Q1xG4JHZVs9V5ocCabGGbg/raMGe6z1vEBbk7j5CMocFj6unXjg6cBKbGYC712kpPK+LJsZkrGsZEbY2l6/V6NSfOMmeUr2u88+X1DT74WPEivAjguJnWKcXAB/D8iYKn4zNp6uD0hXaj/PkkiC9jz2qGa86LjDmn7OcQ19TQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u3I5l-0003y6-RA for guix-patches@gnu.org; Fri, 11 Apr 2025 13:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77750] [PATCH] gnu: cppcheck: Update to 2.17.1 Resent-From: Florent Pruvost Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Apr 2025 17:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77750 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77750@debbugs.gnu.org Cc: Florent Pruvost X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174439215315205 (code B ref -1); Fri, 11 Apr 2025 17:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Apr 2025 17:22:33 +0000 Received: from localhost ([127.0.0.1]:51638 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3I5H-0003x8-Ni for submit@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 ) id 1u3Eeu-0006l2-LL for submit@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 ) id 1u3Eem-0003PL-BQ for guix-patches@gnu.org; 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 ) id 1u3Eei-0002Ed-Je for guix-patches@gnu.org; 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@inria.fr; 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 Date: Fri, 11 Apr 2025 15:42:38 +0200 Message-ID: <20250411134238.320182-1-florent.pruvost@inria.fr> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=192.134.164.83; envelope-from=florent.pruvost@inria.fr; 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-Mailman-Approved-At: Fri, 11 Apr 2025 13:22:30 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 11 Apr 2025 16:30:51 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 base-commit: 6036f1f3053bc9b4f0411b5e8aeaab5bd7f4ec7b 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 -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 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 + +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 $ ${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 {