Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ if(CUSTOM_MALLOC)
include(GetMiMalloc)
set(CUSTOM_MALLOC_LIB mimalloc-static)
elseif (CUSTOM_MALLOC STREQUAL rpmalloc)
include(RpMalloc)
include(GetRpMalloc)
set(CUSTOM_MALLOC_LIB rpmalloc)
else()
message(FATAL_ERROR "Invalid CUSTOM_MALLOC")
Expand All @@ -258,8 +258,7 @@ endif()

# ossp-uuid
if(NOT WIN32)
include(BundledOSSPUUID)
use_bundled_osspuuid(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include(GetOSSPUUID)
endif()

# libsodium
Expand Down Expand Up @@ -321,7 +320,7 @@ if (NOT _gsl_lite_real_target)
endif()
target_compile_definitions(${_gsl_lite_real_target} INTERFACE ${GslDefinitions})

include(Date)
include(GetDate)
include(GetMagicEnum)
include(GetRangeV3)
include(GetAsio)
Expand Down
6 changes: 4 additions & 2 deletions bootstrap/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def run_conan_install(minifi_options: MinifiOptions, package_manager: PackageMan
print("Conan install skipped because USE_CONAN is OFF")
return True
conan_options = add_conan_options_from_cmake_options(["ENABLE_ALL", "ENABLE_LIBARCHIVE", "ENABLE_ROCKSDB", "ENABLE_SFTP", "ENABLE_PROMETHEUS", "ENABLE_BZIP2", "ENABLE_LZMA", "ENABLE_MQTT",
"ENABLE_COUCHBASE", "ENABLE_KAFKA", "ENABLE_OPC", "SKIP_TESTS"], minifi_options)
"ENABLE_COUCHBASE", "ENABLE_KAFKA", "ENABLE_OPC", "ENABLE_GCP", "ENABLE_GRPC_FOR_LOKI", "ENABLE_BUSTACHE", "ENABLE_KUBERNETES",
"ENABLE_AZURE", "ENABLE_LLAMACPP", "ENABLE_AWS", "PORTABLE", "SKIP_TESTS"],
minifi_options)
if minifi_options.custom_malloc is not None and minifi_options.custom_malloc.value not in (None, "OFF"):
conan_options += f' -o "&:custom_malloc={minifi_options.custom_malloc.value}"'

Expand All @@ -73,7 +75,7 @@ def run_conan_install(minifi_options: MinifiOptions, package_manager: PackageMan
if not export_custom_conan_recipes(minifi_options, package_manager):
return False

compiler_settings = " --settings=compiler.cppstd=23"
compiler_settings = " -s:a compiler.cppstd=23"
generator_setting = " -c tools.cmake.cmaketoolchain:generator=Ninja" if minifi_options.use_ninja.value == "ON" else ""
conan_remote_add_cmd = "conan remote add nifi-conan https://apache.jfrog.io/artifactory/api/conan/nifi-conan --force"
if not package_manager.run_cmd(conan_remote_add_cmd):
Expand Down
4 changes: 2 additions & 2 deletions cmake/Abseil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ set(PC ${Bash_EXECUTABLE} -c "set -x &&\

FetchContent_Declare(
absl
URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20260107.1.tar.gz
URL_HASH SHA256=4314e2a7cbac89cac25a2f2322870f343d81579756ceff7f431803c2c9090195
URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20260526.0.tar.gz
URL_HASH SHA256=6e1aee535473414164bf83e4ebc40240dec71a4701f8a642d906e95bea1aea0c
PATCH_COMMAND "${PC}"
OVERRIDE_FIND_PACKAGE
SYSTEM
Expand Down
14 changes: 6 additions & 8 deletions cmake/AzureSdkCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,18 @@ set(BUILD_TESTING OFF CACHE INTERNAL "")
set(BUILD_SAMPLES OFF CACHE INTERNAL "")
set(DISABLE_AMQP ON CACHE INTERNAL "")

set(PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/wil.patch")
set(PATCH_FILE_2 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/fix-openssl-helper.patch")
set(PATCH_FILE_3 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/fix-managed-identity.patch")
set(PATCH_FILE_4 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/include-cinttypes-for-uint8_t-gcc15-fix.patch")
set(PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/all/patches/wil.patch")
set(PATCH_FILE_2 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/all/patches/fix-openssl-helper.patch")
set(PATCH_FILE_3 "${CMAKE_SOURCE_DIR}/thirdparty/azure-sdk-cpp/all/patches/include-cinttypes-for-uint8_t-gcc15-fix.patch")

set(PC ${Bash_EXECUTABLE} -c "set -x &&\
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE_1}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE_1}\\\") &&\
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE_2}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE_2}\\\") &&\
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE_3}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE_3}\\\") &&\
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE_4}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE_4}\\\")")
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE_3}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE_3}\\\")")

FetchContent_Declare(asdkext
URL https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-storage-queues_12.7.0.tar.gz
URL_HASH "SHA256=a2d52cf30a36c1000cd6ee87fa60d5e3aa8d5b01a1716e5bc684dd5a507d76d5"
URL https://github.com/Azure/azure-sdk-for-cpp/archive/refs/tags/azure-storage-blobs_12.18.0.tar.gz
URL_HASH "SHA256=0f266f91cf00b79bb6c7c6f99e44942b43a7141db565556a4298f6ebe3a86fcc"
PATCH_COMMAND "${PC}"
SYSTEM
)
Expand Down
8 changes: 4 additions & 4 deletions cmake/BundledAwsSdkCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
function(use_bundled_libaws SOURCE_DIR BINARY_DIR)
find_package(OpenSSL REQUIRED)
find_package(ZLIB REQUIRED)
set(DLL_EXPORT_INJECTION_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/dll-export-injection.patch")
set(FIX_FINDING_S2N_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/fix-finding-s2n.patch")
set(S2N_OPENSSL_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/s2n.patch")
set(AWS_C_CAL_OPENSSL_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/aws-c-cal.patch")
set(DLL_EXPORT_INJECTION_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/all/patches/dll-export-injection.patch")
set(FIX_FINDING_S2N_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/all/patches/fix-finding-s2n.patch")
set(S2N_OPENSSL_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/all/patches/s2n.patch")
set(AWS_C_CAL_OPENSSL_PATCH "${SOURCE_DIR}/thirdparty/aws-sdk-cpp/all/patches/aws-c-cal.patch")

if (WIN32)
set(REMOVE_FIND_CMAKE_COMMAND "powershell -Command \\\"Remove-Item -Path ./* -Include 'FindOpenSSL.cmake', 'Findcrypto.cmake' -Recurse -Force\\\"")
Expand Down
6 changes: 3 additions & 3 deletions cmake/BundledOSSPUUID.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
function(use_bundled_osspuuid SOURCE_DIR BINARY_DIR)
message("Using bundled ossp-uuid")

set(PATCH_FILE1 "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-mac-fix.patch")
set(PATCH_FILE2 "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-no-prog.patch")
set(PATCH_FILE3 "${SOURCE_DIR}/thirdparty/ossp-uuid/ossp-uuid-update-config-guess.patch")
set(PATCH_FILE1 "${SOURCE_DIR}/thirdparty/ossp-uuid/all/patches/ossp-uuid-mac-fix.patch")
set(PATCH_FILE2 "${SOURCE_DIR}/thirdparty/ossp-uuid/all/patches/ossp-uuid-no-prog.patch")
set(PATCH_FILE3 "${SOURCE_DIR}/thirdparty/ossp-uuid/all/patches/ossp-uuid-update-config-guess.patch")
set(PC ${Bash_EXECUTABLE} -c "set -x &&\
(\"${Patch_EXECUTABLE}\" -p1 -R -s -f --dry-run -i \"${PATCH_FILE1}\" || \"${Patch_EXECUTABLE}\" -p1 -N -i \"${PATCH_FILE1}\") &&\
(\"${Patch_EXECUTABLE}\" -p1 -R -s -f --dry-run -i \"${PATCH_FILE2}\" || \"${Patch_EXECUTABLE}\" -p1 -N -i \"${PATCH_FILE2}\") &&\
Expand Down
6 changes: 3 additions & 3 deletions cmake/Bustache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ include(GetFmt)

set(BUSTACHE_USE_FMT ON CACHE STRING "" FORCE)

set(PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/bustache/add-append.patch")
set(PATCH_FILE_2 "${CMAKE_SOURCE_DIR}/thirdparty/bustache/fix-deprecated-literal-operator.patch")
set(PATCH_FILE_3 "${CMAKE_SOURCE_DIR}/thirdparty/bustache/remove_installs.patch")
set(PATCH_FILE_1 "${CMAKE_SOURCE_DIR}/thirdparty/bustache/all/patches/add-append.patch")
set(PATCH_FILE_2 "${CMAKE_SOURCE_DIR}/thirdparty/bustache/all/patches/fix-deprecated-literal-operator.patch")
set(PATCH_FILE_3 "${CMAKE_SOURCE_DIR}/thirdparty/bustache/all/patches/remove_installs.patch")

set(PC ${Bash_EXECUTABLE} -c "set -x &&\
(\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE_1}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE_1}\\\") &&\
Expand Down
29 changes: 0 additions & 29 deletions cmake/Date.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,6 @@

include(FetchContent)

if (WIN32)
# tzdata and windowsZones.xml from unicode cldr-common are required to be installed for date-tz operation on Windows
FetchContent_Declare(tzdata
URL https://data.iana.org/time-zones/releases/tzdata2026b.tar.gz
URL_HASH SHA256=114543d9f19a6bfeb5bca43686aea173d38755a3db1f2eec112647ae92c6f544
SYSTEM
)
FetchContent_GetProperties(tzdata)
if (NOT tzdata_POPULATED)
FetchContent_Populate(tzdata)
endif()

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/tzdata)

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cldr-common-38.1/common/supplemental/windowsZones.xml
DESTINATION ${CMAKE_BINARY_DIR}/tzdata)

file(COPY ${tzdata_SOURCE_DIR}/
DESTINATION ${CMAKE_BINARY_DIR}/tzdata)

install(DIRECTORY ${tzdata_SOURCE_DIR}/
DESTINATION tzdata
COMPONENT bin)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cldr-common-38.1/common/supplemental/windowsZones.xml
DESTINATION tzdata
COMPONENT bin)
endif()

FetchContent_Declare(date_src
URL https://github.com/HowardHinnant/date/archive/refs/tags/v3.0.4.tar.gz
URL_HASH SHA256=56e05531ee8994124eeb498d0e6a5e1c3b9d4fccbecdf555fe266631368fb55f
Expand Down
40 changes: 1 addition & 39 deletions cmake/ExpressionLanguage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,7 @@
# under the License.

if(WIN32)
include(FetchContent)

set(BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")

set(PATCH_FILE "${CMAKE_SOURCE_DIR}/thirdparty/winflexbison/minimum_cmake_version.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}\\\")")

FetchContent_Declare(
winflexbison
URL "https://github.com/lexxmark/winflexbison/archive/refs/tags/v2.5.25.tar.gz"
URL_HASH "SHA256=8e1b71e037b524ba3f576babb0cf59182061df1f19cd86112f085a882560f60b"
PATCH_COMMAND "${PC}"
SYSTEM
)
FetchContent_GetProperties("winflexbison")

if(NOT winflexbison_POPULATED)
FetchContent_Populate("winflexbison")
execute_process(
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release .
WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY
)

execute_process(
COMMAND ${CMAKE_COMMAND} --build . --config Release
WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
COMMAND_ERROR_IS_FATAL ANY
)
endif()

set(BISON_EXECUTABLE "${winflexbison_SOURCE_DIR}/bin/Release/win_bison.exe" CACHE PATH "bison executable")
set(FLEX_EXECUTABLE "${winflexbison_SOURCE_DIR}/bin/Release/win_flex.exe" CACHE PATH "flex executable")

include_directories(${winflexbison_SOURCE_DIR}/flex/src/)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/winflexbison")
include(GetWinFlexBison)
endif()

# On macOS brew installed bison and flex are preferred
Expand Down
70 changes: 70 additions & 0 deletions cmake/GenerateGrafanaLokiProto.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

set(LOKI_PROTOBUF_GENERATED_DIR ${CMAKE_BINARY_DIR}/grafana-loki-protobuf-generated)
file(MAKE_DIRECTORY ${LOKI_PROTOBUF_GENERATED_DIR})

if(MINIFI_GRPC_SOURCE STREQUAL "CONAN")
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)

set(LOKI_PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>)

add_custom_command(
OUTPUT
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.grpc.pb.cc
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.grpc.pb.h
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.pb.h
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.pb.cc
COMMAND ${LOKI_PROTOC_EXECUTABLE}
ARGS
--plugin=protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
--proto_path=.
--grpc_out=${LOKI_PROTOBUF_GENERATED_DIR}
--cpp_out=${LOKI_PROTOBUF_GENERATED_DIR}
grafana-loki-push.proto
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/protos
DEPENDS
protobuf::protoc
gRPC::grpc_cpp_plugin
${CMAKE_CURRENT_SOURCE_DIR}/protos/grafana-loki-push.proto
)
elseif(MINIFI_GRPC_SOURCE STREQUAL "BUILD")
set(LOKI_PROTOBUF_GENERATED_DIR ${CMAKE_BINARY_DIR}/grafana-loki-protobuf-generated)
file(MAKE_DIRECTORY ${LOKI_PROTOBUF_GENERATED_DIR})

add_custom_command(
OUTPUT
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.grpc.pb.cc
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.grpc.pb.h
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.pb.h
${LOKI_PROTOBUF_GENERATED_DIR}/grafana-loki-push.pb.cc
COMMAND ${PROTOBUF_COMPILER}
ARGS
--plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN}
--proto_path=.
--proto_path=${protobuf_SOURCE_DIR}/src
--grpc_out=${LOKI_PROTOBUF_GENERATED_DIR}
--cpp_out=${LOKI_PROTOBUF_GENERATED_DIR}
grafana-loki-push.proto
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/protos
DEPENDS
protobuf::protoc
grpc_cpp_plugin
${CMAKE_CURRENT_SOURCE_DIR}/protos/grafana-loki-push.proto
)
endif()
25 changes: 25 additions & 0 deletions cmake/GetAwsSdkCpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

if(MINIFI_AWS_SDK_CPP_SOURCE STREQUAL "CONAN")
message("Using Conan to install AWS SDK for C++")
find_package(AWSSDK REQUIRED GLOBAL)
elseif(MINIFI_AWS_SDK_CPP_SOURCE STREQUAL "BUILD")
message("Using CMake to build AWS SDK for C++ from source")
include(BundledAwsSdkCpp)
use_bundled_libaws(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
endif()
24 changes: 24 additions & 0 deletions cmake/GetAzureSdkCpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

if(MINIFI_AZURE_SDK_CPP_SOURCE STREQUAL "CONAN")
message("Using Conan to install Azure SDK for C++")
find_package(AzureSDK REQUIRED)
elseif(MINIFI_AZURE_SDK_CPP_SOURCE STREQUAL "BUILD")
message("Using CMake to build Azure SDK for C++ from source")
include(AzureSdkCpp)
endif()
24 changes: 24 additions & 0 deletions cmake/GetBustache.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

if(MINIFI_BUSTACHE_SOURCE STREQUAL "CONAN")
message("Using Conan to install Bustache")
find_package(bustache REQUIRED)
elseif(MINIFI_BUSTACHE_SOURCE STREQUAL "BUILD")
message("Using CMake to build Bustache from source")
include(Bustache)
endif()
Loading
Loading