You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by ni...@apache.org on 2022/03/26 19:20:26 UTC

[incubator-heron] branch master updated: Update cppcheck to 2.7 (#3804)

This is an automated email from the ASF dual-hosted git repository.

nicknezis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new af7053e  Update cppcheck to 2.7 (#3804)
af7053e is described below

commit af7053ec8162ec43ea7b58d4ddf746ff2b2ab43d
Author: Nicholas Nezis <ni...@gmail.com>
AuthorDate: Sat Mar 26 15:20:21 2022 -0400

    Update cppcheck to 2.7 (#3804)
---
 WORKSPACE                                              |  8 +++-----
 heron/stmgr/tests/cpp/server/stmgr_unittest.cpp        |  2 +-
 third_party/cppcheck/cppcheck-readdir-fix.patch        | 12 ------------
 tools/java/src/org/apache/bazel/cppcheck/CppCheck.java |  1 +
 4 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/WORKSPACE b/WORKSPACE
index 19ec505..5e09596 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -390,11 +390,9 @@ http_archive(
 http_archive(
     name = "com_github_danmar_cppcheck",
     build_file = "@//:third_party/cppcheck/cppcheck.BUILD",
-    patch_args = ["-p2"],
-    patches = ["//third_party/cppcheck:cppcheck-readdir-fix.patch"],
-    sha256 = "cb0e66cbe2d6b655fce430cfaaa74b83ad11c91f221e3926f1ca3211bb7c906b",
-    strip_prefix = "cppcheck-1.90",
-    urls = ["https://github.com/danmar/cppcheck/archive/1.90.zip"],
+    sha256 = "9285bf64af22a07fb24a7431510cc34fba118cf6950190abc2a08c9f7a7084c8",
+    strip_prefix = "cppcheck-2.7",
+    urls = ["https://github.com/danmar/cppcheck/archive/refs/tags/2.7.zip"],
 )
 
 http_archive(
diff --git a/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp b/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp
index 535d56c..58f4e37 100644
--- a/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp
+++ b/heron/stmgr/tests/cpp/server/stmgr_unittest.cpp
@@ -771,7 +771,7 @@ TEST(StMgr, test_pplan_decode) {
               std::find(common.stmgr_ports_.begin(), common.stmgr_ports_.end(),
                         pplan0->stmgrs(i).data_port()));
     EXPECT_NE(common.local_data_ports_.end(),
-              std::find(common.stmgr_ports_.begin(), common.stmgr_ports_.end(),
+              std::find(common.local_data_ports_.begin(), common.local_data_ports_.end(),
                         pplan0->stmgrs(i).local_data_port()));
   }
   EXPECT_EQ(pplan0->instances_size(), common.num_stmgrs_ * num_workers_per_stmgr_);
diff --git a/third_party/cppcheck/cppcheck-readdir-fix.patch b/third_party/cppcheck/cppcheck-readdir-fix.patch
deleted file mode 100644
index bde961a..0000000
--- a/third_party/cppcheck/cppcheck-readdir-fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur cppcheck/cppcheck-1.90/cli/filelister.cpp cppcheck-fixed/cppcheck-1.90/cli/filelister.cpp
---- cppcheck/cppcheck-1.90/cli/filelister.cpp	2020-02-20 22:42:28.000000000 -0500
-+++ cppcheck-fixed/cppcheck-1.90/cli/filelister.cpp	2020-02-20 22:44:48.000000000 -0500
-@@ -194,7 +194,7 @@
-             std::string new_path;
-             new_path.reserve(path.length() + 100);// prealloc some memory to avoid constant new/deletes in loop
- 
--            while ((readdir_r(dir, &entry, &dir_result) == 0) && (dir_result != nullptr)) {
-+            while ((dir_result = readdir(dir)) != NULL) {
- 
-                 if ((std::strcmp(dir_result->d_name, ".") == 0) ||
-                     (std::strcmp(dir_result->d_name, "..") == 0))
diff --git a/tools/java/src/org/apache/bazel/cppcheck/CppCheck.java b/tools/java/src/org/apache/bazel/cppcheck/CppCheck.java
index 0490001..b9bb07d 100644
--- a/tools/java/src/org/apache/bazel/cppcheck/CppCheck.java
+++ b/tools/java/src/org/apache/bazel/cppcheck/CppCheck.java
@@ -136,6 +136,7 @@ public final class CppCheck {
                     Predicates.not(Predicates.containsPattern("third_party/")),
                     Predicates.not(Predicates.containsPattern("config/heron-config.h")),
                     Predicates.not(Predicates.containsPattern(".*cppmap")),
+                    Predicates.not(Predicates.containsPattern(".*srcjar")),
                     Predicates.not(Predicates.containsPattern(".*pb.h$")),
                     Predicates.not(Predicates.containsPattern(".*cc_wrapper.sh$")),
                     Predicates.not(Predicates.containsPattern(".*pb.cc$"))