diff --git a/.github/workflows/gcc13-compat.yml b/.github/workflows/gcc13-compat.yml new file mode 100644 index 0000000000..0c56d2b00b --- /dev/null +++ b/.github/workflows/gcc13-compat.yml @@ -0,0 +1,45 @@ +name: "MiNiFi-CPP verify gcc13 compatibility" +on: [workflow_dispatch] +jobs: + ubuntu_22_04: + name: "ubuntu-22.04-gcc-13" + runs-on: ubuntu-22.04 + timeout-minutes: 120 + steps: + - id: checkout + uses: actions/checkout@v3 + - id: install_deps + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + 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 libsqliteodbc lua5.3 liblua5.3-dev flake8 parallel gcc-13 + echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV + echo -e "127.0.0.1\t$HOSTNAME" | sudo tee -a /etc/hosts > /dev/null + - name: build + run: | + export CC=gcc-13 + export CXX=g++-13 + ./bootstrap.sh -e -t + cd build + cmake -DUSE_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCI_BUILD=ON -DSTRICT_GSL_CHECKS=AUDIT -DFAIL_ON_WARNINGS=ON -DENABLE_ALL=ON .. + make -j$(nproc) VERBOSE=1 + - name: test + id: test + run: | + # Set core file size limit to 1GiB + ulimit -c 1048576 + cd build && make test ARGS="--timeout 300 -j8 --output-on-failure" + - name: check-cores + if: ${{ failure() && steps.test.conclusion == 'failure' }} + run: | + if [ "$(ls -A /var/lib/apport/coredump/)" ]; then echo "CORES_EXIST=true" >> $GITHUB_ENV; fi + - uses: actions/upload-artifact@v3.1.2 + if: ${{ failure() && env.CORES_EXIST == 'true' }} + with: + name: ubuntu-coredumps + path: /var/lib/apport/coredump/ + - uses: actions/upload-artifact@v3.1.2 + if: ${{ failure() && env.CORES_EXIST == 'true' }} + with: + name: ubuntu-binaries + path: build/bin diff --git a/cmake/Abseil.cmake b/cmake/Abseil.cmake index 48bb017129..1afc067574 100644 --- a/cmake/Abseil.cmake +++ b/cmake/Abseil.cmake @@ -22,7 +22,7 @@ set(ABSL_ENABLE_INSTALL ON CACHE INTERNAL "") set(BUILD_TESTING OFF CACHE STRING "" FORCE) FetchContent_Declare( absl - URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz - URL_HASH SHA256=dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4 + URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz + URL_HASH SHA256=91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8 ) FetchContent_MakeAvailable(absl) diff --git a/cmake/BundledAzureSdkCpp.cmake b/cmake/BundledAzureSdkCpp.cmake index 847b2c78a7..3f14598716 100644 --- a/cmake/BundledAzureSdkCpp.cmake +++ b/cmake/BundledAzureSdkCpp.cmake @@ -16,9 +16,13 @@ # under the License. function(use_bundled_libazure SOURCE_DIR BINARY_DIR) - set(PATCH_FILE "${SOURCE_DIR}/thirdparty/azure-sdk-cpp/azure-sdk-cpp-remove-samples.patch") + set(PATCH_FILE1 "${SOURCE_DIR}/thirdparty/azure-sdk-cpp/remove-amqp.patch") + set(PATCH_FILE2 "${SOURCE_DIR}/thirdparty/azure-sdk-cpp/gcc13.patch") set(PC ${Bash_EXECUTABLE} -c "set -x && \ - (\"${Patch_EXECUTABLE}\" -p1 -R -s -f --dry-run -i \"${PATCH_FILE}\" || \"${Patch_EXECUTABLE}\" -p1 -N -i \"${PATCH_FILE}\")") + (\"${Patch_EXECUTABLE}\" -p1 -N -i \"${PATCH_FILE}\")") + set(PC ${Bash_EXECUTABLE} -c "set -x &&\ + (\"${Patch_EXECUTABLE}\" -p1 -N -i \"${PATCH_FILE1}\") &&\ + (\"${Patch_EXECUTABLE}\" -p1 -N -i \"${PATCH_FILE2}\") ") # Define byproducts set(INSTALL_DIR "${BINARY_DIR}/thirdparty/azure-sdk-cpp-install") if (WIN32) @@ -55,14 +59,16 @@ function(use_bundled_libazure SOURCE_DIR BINARY_DIR) set(AZURE_SDK_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS} -DWARNINGS_AS_ERRORS=OFF - -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}) + -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} + -DDISABLE_AZURE_CORE_OPENTELEMETRY=ON + -DBUILD_TRANSPORT_CURL=ON) append_third_party_passthrough_args(AZURE_SDK_CMAKE_ARGS "${AZURE_SDK_CMAKE_ARGS}") # Build project ExternalProject_Add( asdkext # short for azure-sdk-cpp-external due to windows MAX_PATH limitations - URL https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-storage-files-datalake_12.2.0.tar.gz - URL_HASH "SHA256=d4e80ea5e786dc689ddd04825d97ab91f5e1ef2787fa88a3d5ee00f0b820433f" + URL https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-storage-files-datalake_12.7.0.tar.gz + URL_HASH "SHA256=42b9c1df0c15d9e0a3f547eeba8c45708aa86819986da66234e267f4ad728112" SOURCE_DIR "${BINARY_DIR}/thirdparty/azure-sdk-cpp-src" INSTALL_DIR "${BINARY_DIR}/thirdparty/azure-sdk-cpp-install" BUILD_BYPRODUCTS "${AZURESDK_LIBRARIES_LIST}" diff --git a/cmake/GoogleCloudCpp.cmake b/cmake/GoogleCloudCpp.cmake index aca4ac3e05..4612959b4b 100644 --- a/cmake/GoogleCloudCpp.cmake +++ b/cmake/GoogleCloudCpp.cmake @@ -65,4 +65,6 @@ if (WIN32) target_compile_options(google_cloud_cpp_storage PUBLIC /wd4996) else() target_compile_options(google_cloud_cpp_storage PUBLIC -Wno-error=deprecated-declarations) + target_compile_options(google_cloud_cpp_rest_internal PUBLIC -Wno-error) endif() + diff --git a/cmake/KubernetesClientC.cmake b/cmake/KubernetesClientC.cmake index 61878d673b..155e7b4ffc 100644 --- a/cmake/KubernetesClientC.cmake +++ b/cmake/KubernetesClientC.cmake @@ -33,12 +33,13 @@ set(LWS_WITH_SHARED OFF CACHE BOOL "" FORCE) set(LWS_OPENSSL_INCLUDE_DIRS "${OPENSSL_INCLUDE_DIR}" CACHE STRING "" FORCE) set(LWS_OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES}" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS "-fpic" CACHE STRING "" FORCE) +set(DISABLE_WERROR ON CACHE STRING "" FORCE) set(WEBSOCKETS_PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/libwebsockets/fix-include-dirs.patch") set(WEBSOCKETS_PATCH_FILE_2 "${CMAKE_SOURCE_DIR}/thirdparty/libwebsockets/openssl3.patch") set(WEBSOCKETS_PC ${Bash_EXECUTABLE} -c "set -x &&\ (${Patch_EXECUTABLE} -R -p1 -s -f --dry-run -i ${WEBSOCKETS_PATCH_FILE_1} || ${Patch_EXECUTABLE} -p1 -i ${WEBSOCKETS_PATCH_FILE_1}) &&\ - (${Patch_EXECUTABLE} -R -p1 -s -f --dry-run -i ${WEBSOCKETS_PATCH_FILE_2} || ${Patch_EXECUTABLE} -p1 -i ${WEBSOCKETS_PATCH_FILE_2}) ") + (${Patch_EXECUTABLE} -R -p1 -s -f --dry-run -i ${WEBSOCKETS_PATCH_FILE_2} || ${Patch_EXECUTABLE} -p1 -i ${WEBSOCKETS_PATCH_FILE_2})") FetchContent_Declare(websockets URL https://github.com/warmcat/libwebsockets/archive/refs/tags/v4.3.2.tar.gz URL_HASH SHA256=6a85a1bccf25acc7e8e5383e4934c9b32a102880d1e4c37c70b27ae2a42406e1 diff --git a/cmake/curl/dummy/FindCURL.cmake b/cmake/curl/dummy/FindCURL.cmake index 3755b2bd98..77347bac23 100644 --- a/cmake/curl/dummy/FindCURL.cmake +++ b/cmake/curl/dummy/FindCURL.cmake @@ -27,4 +27,5 @@ if(NOT TARGET CURL::libcurl) add_library(CURL::libcurl STATIC IMPORTED) set_target_properties(CURL::libcurl PROPERTIES IMPORTED_LOCATION "${CURL_LIBRARIES}") set_property(TARGET CURL::libcurl APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + target_compile_definitions(CURL::libcurl INTERFACE CURL_STATICLIB) endif() diff --git a/extensions/azure/storage/BlobStorageClient.h b/extensions/azure/storage/BlobStorageClient.h index a7d6443658..4f28e1acc2 100644 --- a/extensions/azure/storage/BlobStorageClient.h +++ b/extensions/azure/storage/BlobStorageClient.h @@ -25,7 +25,7 @@ #include #include -#include "azure/storage/blobs/protocol/blob_rest_client.hpp" +#include "azure/storage/blobs/blob_responses.hpp" #include "AzureStorageCredentials.h" #include "utils/gsl.h" #include "utils/Enum.h" diff --git a/extensions/azure/storage/DataLakeStorageClient.h b/extensions/azure/storage/DataLakeStorageClient.h index 4fd653daf6..839302da72 100644 --- a/extensions/azure/storage/DataLakeStorageClient.h +++ b/extensions/azure/storage/DataLakeStorageClient.h @@ -28,7 +28,7 @@ #include "utils/gsl.h" #include "io/InputStream.h" -#include "azure/storage/files/datalake/protocol/datalake_rest_client.hpp" +#include "azure/storage/files/datalake/datalake_responses.hpp" #include "utils/Enum.h" #include "utils/RegexUtils.h" diff --git a/extensions/http-curl/tests/HTTPHandlers.h b/extensions/http-curl/tests/HTTPHandlers.h index ef6a2ca0a7..7ab6a56495 100644 --- a/extensions/http-curl/tests/HTTPHandlers.h +++ b/extensions/http-curl/tests/HTTPHandlers.h @@ -249,7 +249,7 @@ class FlowFileResponder : public ServerAwareHandler { } flow->attributes[name] = value; } - uint64_t length; + uint64_t length{}; { const auto read = stream.read(length); if (!isServerRunning()) return false; diff --git a/extensions/sftp/client/SFTPClient.cpp b/extensions/sftp/client/SFTPClient.cpp index e2167bfca5..71365c00db 100644 --- a/extensions/sftp/client/SFTPClient.cpp +++ b/extensions/sftp/client/SFTPClient.cpp @@ -279,13 +279,10 @@ bool SFTPClient::connect() { /* Getting socket from curl */ #ifdef WIN32 curl_socket_t sockfd; - /* Only CURLINFO_ACTIVESOCKET works on Win64 */ - curl_res = curl_easy_getinfo(easy_, CURLINFO_ACTIVESOCKET, &sockfd); #else long sockfd; // NOLINT(runtime/int) long due to libcurl API - /* Some older cURL versions only support CURLINFO_LASTSOCKET */ - curl_res = curl_easy_getinfo(easy_, CURLINFO_LASTSOCKET, &sockfd); #endif + curl_res = curl_easy_getinfo(easy_, CURLINFO_ACTIVESOCKET, &sockfd); if (curl_res != CURLE_OK) { return false; } diff --git a/extensions/sftp/processors/ListSFTP.cpp b/extensions/sftp/processors/ListSFTP.cpp index 42490b260c..61f823a072 100644 --- a/extensions/sftp/processors/ListSFTP.cpp +++ b/extensions/sftp/processors/ListSFTP.cpp @@ -535,9 +535,9 @@ void ListSFTP::listByTrackingTimestamps( /* Determine the minimum reliable timestamp based on precision */ auto minimum_reliable_timestamp = now - listing_lag; if (remote_system_timestamp_precision == TARGET_SYSTEM_TIMESTAMP_PRECISION_SECONDS) { - std::chrono::floor(minimum_reliable_timestamp); + minimum_reliable_timestamp = std::chrono::floor(minimum_reliable_timestamp); } else { - std::chrono::floor(minimum_reliable_timestamp); + minimum_reliable_timestamp = std::chrono::floor(minimum_reliable_timestamp); } /* If the latest timestamp is not old enough, we wait another cycle */ if (latest_listed_entry_timestamp_this_cycle && minimum_reliable_timestamp < latest_listed_entry_timestamp_this_cycle) { diff --git a/libminifi/include/core/Resource.h b/libminifi/include/core/Resource.h index d030c2b61d..3a6c563509 100644 --- a/libminifi/include/core/Resource.h +++ b/libminifi/include/core/Resource.h @@ -67,11 +67,13 @@ class StaticClassType { getClassLoader().unregisterClass(construction_name); } } - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdangling-reference" static const StaticClassType& get(const std::string& name, const std::vector& construction_names) { static const StaticClassType instance(name, construction_names); return instance; } +#pragma GCC diagnostic pop private: std::string name_; diff --git a/libminifi/src/utils/TimeUtil.cpp b/libminifi/src/utils/TimeUtil.cpp index 58aaec3a2f..1bde905d2b 100644 --- a/libminifi/src/utils/TimeUtil.cpp +++ b/libminifi/src/utils/TimeUtil.cpp @@ -37,7 +37,7 @@ void setClock(std::shared_ptr clock) { std::optional parseRfc3339(const std::string& str) { std::istringstream stream(str); - date::year_month_day date_part; + date::year_month_day date_part{}; date::from_stream(stream, "%F", date_part); if (stream.fail()) diff --git a/libminifi/test/TestBase.cpp b/libminifi/test/TestBase.cpp index 1a08f71b4d..71cd2bcdc7 100644 --- a/libminifi/test/TestBase.cpp +++ b/libminifi/test/TestBase.cpp @@ -52,8 +52,7 @@ std::shared_ptr LogTestController::getInstance(const std::sha } else { // in practice I'd use a derivation here or another paradigm entirely but for the purposes of this test code // having extra overhead is negligible. this is the most readable and least impactful way - auto instance = std::shared_ptr(new LogTestController(logger_properties)); - map.insert(std::make_pair(logger_properties, instance)); + map.insert(std::make_pair(logger_properties, std::shared_ptr(new LogTestController(logger_properties)))); return map.find(logger_properties)->second; } } diff --git a/thirdparty/azure-sdk-cpp/azure-sdk-cpp-remove-samples.patch b/thirdparty/azure-sdk-cpp/azure-sdk-cpp-remove-samples.patch deleted file mode 100644 index c9e5ea658b..0000000000 --- a/thirdparty/azure-sdk-cpp/azure-sdk-cpp-remove-samples.patch +++ /dev/null @@ -1,23 +0,0 @@ -# Samples require OpenSSL library on host that should not be required -diff --git a/sdk/identity/azure-identity/CMakeLists.txt b/sdk/identity/azure-identity/CMakeLists.txt -index 5a099b0e..ba8920dc 100644 ---- a/sdk/identity/azure-identity/CMakeLists.txt -+++ b/sdk/identity/azure-identity/CMakeLists.txt -@@ -92,6 +92,3 @@ if (BUILD_PERFORMANCE_TESTS) - add_subdirectory(test/perf) - endif() - --if (AZ_ALL_LIBRARIES) -- add_subdirectory(samples) --endif() - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 173bca57..e5e4e9a0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -95,4 +95,3 @@ add_subdirectory(sdk/identity) - add_subdirectory(sdk/keyvault) - add_subdirectory(sdk/storage) - add_subdirectory(sdk/template) --add_subdirectory(samples/integration/vcpkg-keyvault) - diff --git a/thirdparty/azure-sdk-cpp/gcc13.patch b/thirdparty/azure-sdk-cpp/gcc13.patch new file mode 100644 index 0000000000..41db6ff51f --- /dev/null +++ b/thirdparty/azure-sdk-cpp/gcc13.patch @@ -0,0 +1,44 @@ +diff '--color=auto' -rupN azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/core/azure-core/inc/azure/core/base64.hpp azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/core/azure-core/inc/azure/core/base64.hpp +--- azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/core/azure-core/inc/azure/core/base64.hpp 2023-07-11 04:18:12.000000000 +0200 ++++ azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/core/azure-core/inc/azure/core/base64.hpp 2023-07-31 10:24:28.267049474 +0200 +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace Azure { namespace Core { + +diff '--color=auto' -rupN azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/core/azure-core/inc/azure/core/uuid.hpp azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/core/azure-core/inc/azure/core/uuid.hpp +--- azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/core/azure-core/inc/azure/core/uuid.hpp 2023-07-11 04:18:12.000000000 +0200 ++++ azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/core/azure-core/inc/azure/core/uuid.hpp 2023-07-31 10:29:58.670195225 +0200 +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + namespace Azure { namespace Core { + /** +diff '--color=auto' -rupN azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/keyvault/azure-security-keyvault-keys/src/private/key_sign_parameters.hpp azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/keyvault/azure-security-keyvault-keys/src/private/key_sign_parameters.hpp +--- azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/keyvault/azure-security-keyvault-keys/src/private/key_sign_parameters.hpp 2023-07-11 04:18:12.000000000 +0200 ++++ azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/keyvault/azure-security-keyvault-keys/src/private/key_sign_parameters.hpp 2023-07-31 10:42:25.125314240 +0200 +@@ -11,6 +11,7 @@ + + #include + #include ++#include + + namespace Azure { + namespace Security { +diff '--color=auto' -rupN azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/keyvault/azure-security-keyvault-keys/src/private/key_verify_parameters.hpp azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/keyvault/azure-security-keyvault-keys/src/private/key_verify_parameters.hpp +--- azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0/sdk/keyvault/azure-security-keyvault-keys/src/private/key_verify_parameters.hpp 2023-07-11 04:18:12.000000000 +0200 ++++ azure-sdk-for-cpp-azure-storage-files-datalake_12.7.0-patched/sdk/keyvault/azure-security-keyvault-keys/src/private/key_verify_parameters.hpp 2023-07-31 11:02:08.775192072 +0200 +@@ -11,6 +11,7 @@ + + #include + #include ++#include + + namespace Azure { + namespace Security { diff --git a/thirdparty/azure-sdk-cpp/remove-amqp.patch b/thirdparty/azure-sdk-cpp/remove-amqp.patch new file mode 100644 index 0000000000..daacddd01b --- /dev/null +++ b/thirdparty/azure-sdk-cpp/remove-amqp.patch @@ -0,0 +1,15 @@ +diff -rupN a/sdk/core/CMakeLists.txt b/sdk/core/CMakeLists.txt +--- a/sdk/core/CMakeLists.txt 2023-07-11 04:18:12.000000000 +0200 ++++ b/sdk/core/CMakeLists.txt 2023-07-25 16:58:17.919348377 +0200 +@@ -10,11 +10,6 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + + add_subdirectory(azure-core) + +-if (NOT BUILD_WINDOWS_UWP) +- message(STATUS "Including AMQP library") +- add_subdirectory(azure-core-amqp) +-endif() +- + if (NOT DISABLE_AZURE_CORE_OPENTELEMETRY) + add_subdirectory(azure-core-tracing-opentelemetry) + endif()