You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ab...@apache.org on 2021/03/23 08:07:45 UTC

[nifi-minifi-cpp] branch main updated: MINIFICPP-1531 Use release build type for Ubuntu 20.04 job

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

aboda pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 4bb1fd9  MINIFICPP-1531 Use release build type for Ubuntu 20.04 job
4bb1fd9 is described below

commit 4bb1fd97f5df103d5bee9a884839b24e2f77a2c5
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Thu Mar 18 18:20:23 2021 +0100

    MINIFICPP-1531 Use release build type for Ubuntu 20.04 job
    
    Fix exception catch warning in ListS3Tests
    
    Signed-off-by: Arpad Boda <ab...@apache.org>
    
    This closes #1034
---
 .github/workflows/ci.yml                   | 4 ++--
 controller/Controller.h                    | 2 +-
 extensions/http-curl/tests/HTTPHandlers.h  | 2 ++
 libminifi/test/aws-tests/ListS3Tests.cpp   | 2 +-
 libminifi/test/rocksdb-tests/RepoTests.cpp | 1 +
 nanofi/include/sitetosite/CPeer.h          | 3 +--
 6 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 40f2cda..89ab136 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -159,7 +159,7 @@ jobs:
           sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev
           echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
       - id: build
-        run: ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= -DENABLE_BUSTACHE=ON -DENABLE_SQLITE=ON -DENABLE_PCAP=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && make -j4 VERBOSE=1  && make test ARGS="--timeout 300 -j2 --output-on-failure"
+        run: ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DENABLE_BUSTACHE=ON -DENABLE_SQLITE=ON -DENABLE_PCAP=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON .. && make -j4 VERBOSE=1  && make test ARGS="--timeout 300 -j2 --output-on-failure"
   ubuntu_20_04_all_clang:
     name: "ubuntu-20.04-all-clang"
     runs-on: ubuntu-20.04
@@ -181,7 +181,7 @@ jobs:
           sudo apt install -y ccache libfl-dev libpcap-dev libboost-all-dev openjdk-8-jdk maven libusb-1.0-0-dev libpng-dev libgps-dev
           echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
       - id: build
-        run: ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_MQTT=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_MQTT=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. &&  cmake --build . --parallel 4  && make test ARGS="--timeout 300 -j8 --o [...]
+        run: ./bootstrap.sh -e -t && cd build  && cmake -DUSE_SHARED_LIBS= -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENWSMAN=ON -DENABLE_OPENCV=ON -DENABLE_MQTT=ON -DENABLE_GPS=ON -DENABLE_USB_CAMERA=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_OPC=ON -DENABLE_SFTP=ON -DENABLE_MQTT=ON -DENABLE_COAP=ON -DENABLE_PYTHON=ON -DENABLE_SQL=ON -DENABLE_AWS=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .. &&  cmake --build . --parallel 4  && make test  [...]
   ubuntu_16_04_all:
     name: "ubuntu-16.04-all"
     runs-on: ubuntu-16.04
diff --git a/controller/Controller.h b/controller/Controller.h
index 6c1f77c..0544f50 100644
--- a/controller/Controller.h
+++ b/controller/Controller.h
@@ -146,7 +146,7 @@ int getJstacks(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out) {
 
     for (uint64_t i = 0; i < size; i++) {
       std::string name;
-      uint64_t lines;
+      uint64_t lines = 0;
       socket->read(name);
       socket->read(lines);
       for (uint64_t j = 0; j < lines; j++) {
diff --git a/extensions/http-curl/tests/HTTPHandlers.h b/extensions/http-curl/tests/HTTPHandlers.h
index af9b0a8..76015e4 100644
--- a/extensions/http-curl/tests/HTTPHandlers.h
+++ b/extensions/http-curl/tests/HTTPHandlers.h
@@ -416,6 +416,7 @@ class HeartbeatHandler : public ServerAwareHandler {
       }
     }
     assert(found);
+    (void)found;  // unused in release builds
   }
 
   virtual void handleHeartbeat(const rapidjson::Document& root, struct mg_connection *) {
@@ -431,6 +432,7 @@ class HeartbeatHandler : public ServerAwareHandler {
       rapidjson::Document root;
       rapidjson::ParseResult ok = root.Parse(post_data.data(), post_data.size());
       assert(ok);
+      (void)ok;  // unused in release builds
       std::string operation = root["operation"].GetString();
       if (operation == "heartbeat") {
         handleHeartbeat(root, conn);
diff --git a/libminifi/test/aws-tests/ListS3Tests.cpp b/libminifi/test/aws-tests/ListS3Tests.cpp
index dcdb12e..56d29c4 100644
--- a/libminifi/test/aws-tests/ListS3Tests.cpp
+++ b/libminifi/test/aws-tests/ListS3Tests.cpp
@@ -69,7 +69,7 @@ TEST_CASE_METHOD(ListS3TestsFixture, "Test required property not set", "[awsS3Er
     plan->setProperty(s3_processor, "Region", "");
   }
 
-  REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception);
+  REQUIRE_THROWS_AS(test_controller.runSession(plan, true), minifi::Exception&);
 }
 
 TEST_CASE_METHOD(ListS3TestsFixture, "Test proxy setting", "[awsS3Proxy]") {
diff --git a/libminifi/test/rocksdb-tests/RepoTests.cpp b/libminifi/test/rocksdb-tests/RepoTests.cpp
index 9248dc8..73b2223 100644
--- a/libminifi/test/rocksdb-tests/RepoTests.cpp
+++ b/libminifi/test/rocksdb-tests/RepoTests.cpp
@@ -342,6 +342,7 @@ TEST_CASE("Test FlowFile Restore", "[TestFFR6]") {
     return newFlow != nullptr;
   };
   assert(verifyEventHappenedInPollTime(std::chrono::seconds(10), flowFileArrivedInOutput, std::chrono::milliseconds(50)));
+  (void)flowFileArrivedInOutput;  // unused in release builds
   REQUIRE(expiredFiles.empty());
 
   LogTestController::getInstance().reset();
diff --git a/nanofi/include/sitetosite/CPeer.h b/nanofi/include/sitetosite/CPeer.h
index 7b618cb..ec5cc21 100644
--- a/nanofi/include/sitetosite/CPeer.h
+++ b/nanofi/include/sitetosite/CPeer.h
@@ -73,9 +73,8 @@ static inline void setHostName(struct SiteToSiteCPeer * peer, const char * hostn
   peer->_host = (char*)malloc(host_len + 1);  // +1 for trailing zero
   peer->_url = (char*)malloc(host_len + 14);  // +1 for trailing zero, 1 for ':', at most 5 for port, 7 for "nifi://" suffix
   memset(peer->_url, 0, host_len + 14);  // make sure to have zero padding no matter the length of the port
-  strncpy(peer->_host, hostname, host_len);
+  snprintf(peer->_host, host_len + 1, "%s", hostname);
   snprintf(peer->_url, host_len + 14, "nifi://%s:", hostname);
-  peer->_host[host_len] = '\0';
   if(peer->_port != 0) {
     snprintf(peer->_url + host_len + 8, 6, "%d", peer->_port);
   }