diff --git a/.github/workflows/alpine.yml b/.github/workflows/alpine.yml index 37b4d2471bd8..dbec6d97a913 100644 --- a/.github/workflows/alpine.yml +++ b/.github/workflows/alpine.yml @@ -61,6 +61,7 @@ jobs: -DUSERVER_BUILD_TESTS=1 \ -DUSERVER_FEATURE_JEMALLOC=OFF \ -DUSERVER_FEATURE_KAFKA=OFF \ + -DUSERVER_FEATURE_CLICKHOUSE=OFF \ -DUSERVER_FEATURE_STACKTRACE=OFF \ -DUSERVER_FEATURE_PATCH_LIBPQ=OFF \ -DUSERVER_DOWNLOAD_PACKAGE_PROTOBUF=ON \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8774008cd68b..7332efa8b4aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -290,7 +290,7 @@ jobs: - name: Run tests (mongo) # libbson unnecessarily overaligns structures and GCC-9 does not support overaligned new - if: matrix.info != 'g++-9 + debug + sanitize addr+ub' + if: matrix.info != 'g++-9 + release' run: | sudo apt install mongodb-mongosh cd build_debug diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2bf8f57fbf16..9229d5e5d767 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -22,15 +22,12 @@ jobs: -DUSERVER_BUILD_TESTS=1 -DUSERVER_FEATURE_REDIS_HI_MALLOC=1 -DUSERVER_FEATURE_CRYPTOPP_BLAKE2=0 - -DUSERVER_FEATURE_POSTGRESQL=0 - -DUSERVER_FEATURE_GRPC=0 - -DUSERVER_FEATURE_GRPC_REFLECTION=0 - -DUSERVER_FEATURE_OTLP=0 - -DUSERVER_FEATURE_MYSQL=0 - -DUSERVER_FEATURE_RABBITMQ=0 - -DUSERVER_FEATURE_ROCKS=0 - -DUSERVER_FEATURE_KAFKA=0 - -DUSERVER_FEATURE_EASY=0 + -DUSERVER_FEATURE_MONGODB=1 + -DUSERVER_FEATURE_CLICKHOUSE=1 + -DUSERVER_USE_LD=lld + -DUSERVER_FORCE_DOWNLOAD_ABSEIL=1 + -DUSERVER_FORCE_DOWNLOAD_PROTOBUF=1 + -DUSERVER_FORCE_DOWNLOAD_GRPC=1 steps: - uses: actions/checkout@v4 @@ -44,7 +41,10 @@ jobs: brew install $(cat scripts/docs/en/deps/macos.md) brew install clang-format brew install python@3.11 + brew install lld + brew link postgresql@16 + brew upgrade - name: Run cmake diff --git a/.mapping.json b/.mapping.json index 6933e7e8006e..7ce59d506efc 100644 --- a/.mapping.json +++ b/.mapping.json @@ -454,7 +454,6 @@ "cmake/modules/FindGssApi.cmake":"taxi/uservices/userver/cmake/modules/FindGssApi.cmake", "cmake/modules/FindHiredis.cmake":"taxi/uservices/userver/cmake/modules/FindHiredis.cmake", "cmake/modules/FindJemalloc.cmake":"taxi/uservices/userver/cmake/modules/FindJemalloc.cmake", - "cmake/modules/FindLZ4.cmake":"taxi/uservices/userver/cmake/modules/FindLZ4.cmake", "cmake/modules/FindLibEv.cmake":"taxi/uservices/userver/cmake/modules/FindLibEv.cmake", "cmake/modules/FindNghttp2.cmake":"taxi/uservices/userver/cmake/modules/FindNghttp2.cmake", "cmake/modules/FindPostgreSQLInternal.cmake":"taxi/uservices/userver/cmake/modules/FindPostgreSQLInternal.cmake", @@ -478,6 +477,7 @@ "cmake/modules/Findlibz.cmake":"taxi/uservices/userver/cmake/modules/Findlibz.cmake", "cmake/modules/Findlibzip.cmake":"taxi/uservices/userver/cmake/modules/Findlibzip.cmake", "cmake/modules/Findlibzstd.cmake":"taxi/uservices/userver/cmake/modules/Findlibzstd.cmake", + "cmake/modules/Findlz4.cmake":"taxi/uservices/userver/cmake/modules/Findlz4.cmake", "cmake/modules/Findmongoc.cmake":"taxi/uservices/userver/cmake/modules/Findmongoc.cmake", "cmake/sanitize-macos.blacklist.txt":"taxi/uservices/userver/cmake/sanitize-macos.blacklist.txt", "cmake/sanitize.blacklist.txt":"taxi/uservices/userver/cmake/sanitize.blacklist.txt", diff --git a/cmake/SetupClickhouseCPP.cmake b/cmake/SetupClickhouseCPP.cmake index 40cf4069beca..b04d623ab098 100644 --- a/cmake/SetupClickhouseCPP.cmake +++ b/cmake/SetupClickhouseCPP.cmake @@ -23,6 +23,7 @@ CPMAddPackage( OPTIONS "WITH_SYSTEM_ABSEIL ON" "WITH_SYSTEM_LZ4 ON" + "DEBUG_DEPENDENCIES OFF" ) add_library(clickhouse-cpp ALIAS clickhouse-cpp-lib) diff --git a/cmake/SetupPostgresqlDeps.cmake b/cmake/SetupPostgresqlDeps.cmake index 985808386385..9cb13af39b26 100644 --- a/cmake/SetupPostgresqlDeps.cmake +++ b/cmake/SetupPostgresqlDeps.cmake @@ -46,3 +46,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "BSD") find_package(libintl REQUIRED) target_link_libraries(PostgreSQLInternal INTERFACE libintl) endif() + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + find_package(libintl REQUIRED) + find_package(Iconv REQUIRED) + target_link_libraries(PostgreSQLInternal INTERFACE libintl Iconv::Iconv "-framework Foundation") +endif() diff --git a/cmake/SetupRdKafka.cmake b/cmake/SetupRdKafka.cmake index 66e752826b4d..a94a964d2f73 100644 --- a/cmake/SetupRdKafka.cmake +++ b/cmake/SetupRdKafka.cmake @@ -8,7 +8,7 @@ find_package(OpenSSL COMPONENTS SSL Crypto REQUIRED) find_package(CURL REQUIRED) find_package(libz REQUIRED) find_package(libzstd REQUIRED) -find_package(LZ4 REQUIRED) +find_package(lz4 REQUIRED) if(NOT USERVER_FORCE_DOWNLOAD_PACKAGES) if(USERVER_DOWNLOAD_PACKAGE_KAFKA) diff --git a/cmake/SetupRocksDB.cmake b/cmake/SetupRocksDB.cmake index d883e2218743..39b1c0522aea 100644 --- a/cmake/SetupRocksDB.cmake +++ b/cmake/SetupRocksDB.cmake @@ -4,9 +4,9 @@ option(USERVER_DOWNLOAD_PACKAGE_ROCKS "Download and setup RocksDB if no RocksDB if(NOT USERVER_FORCE_DOWNLOAD_PACKAGES) if(USERVER_DOWNLOAD_PACKAGE_ROCKS) - find_package(RocksDB QUIET) + find_package(RocksDB QUIET CONFIG) else() - find_package(RocksDB REQUIRED) + find_package(RocksDB REQUIRED CONFIG) endif() if(RocksDB_FOUND) @@ -36,3 +36,4 @@ CPMAddPackage( mark_targets_as_system("${rocksdb_SOURCE_DIR}") write_package_stub(rocksdb) +add_library(RocksDB::rocksdb ALIAS rocksdb) diff --git a/cmake/UserverGrpcTargets.cmake b/cmake/UserverGrpcTargets.cmake index 7d69f4529fcd..00249955d4e6 100644 --- a/cmake/UserverGrpcTargets.cmake +++ b/cmake/UserverGrpcTargets.cmake @@ -132,7 +132,7 @@ function(userver_generate_grpc_files) else() set(GENERATED_PROTO_DIR "${CMAKE_CURRENT_BINARY_DIR}/proto") endif() - + get_filename_component(GENERATED_PROTO_DIR "${GENERATED_PROTO_DIR}" REALPATH BASE_DIR "/") if(NOT "${GEN_RPC_SOURCE_PATH}" STREQUAL "") diff --git a/cmake/install/userver-kafka-config.cmake b/cmake/install/userver-kafka-config.cmake index ebe671cf14a0..36a06acf324f 100644 --- a/cmake/install/userver-kafka-config.cmake +++ b/cmake/install/userver-kafka-config.cmake @@ -8,7 +8,8 @@ find_package(userver REQUIRED COMPONENTS core ) -include("${USERVER_CMAKE_DIR}/modules/FindLZ4.cmake") +include("${USERVER_CMAKE_DIR}/modules/Findlibz.cmake") +include("${USERVER_CMAKE_DIR}/modules/Findlz4.cmake") include("${USERVER_CMAKE_DIR}/modules/FindRdKafka.cmake") set(userver_kafka_FOUND TRUE) diff --git a/cmake/modules/Findbson.cmake b/cmake/modules/Findbson.cmake index 169a66b2f124..82f525df10a9 100644 --- a/cmake/modules/Findbson.cmake +++ b/cmake/modules/Findbson.cmake @@ -13,6 +13,7 @@ _userver_module_find_include( PATHS /usr/include/libbson-1.0 /usr/local/opt/mongo-c-driver/include/libbson-1.0 + /opt/homebrew/opt/mongo-c-driver/include/libbson-1.0 ) _userver_module_find_library( diff --git a/cmake/modules/Findlibmariadb.cmake b/cmake/modules/Findlibmariadb.cmake index 2b4b35716850..8dfe8f715d92 100644 --- a/cmake/modules/Findlibmariadb.cmake +++ b/cmake/modules/Findlibmariadb.cmake @@ -2,6 +2,7 @@ _userver_module_begin( NAME libmariadb VERSION 3.0.3 DEBIAN_NAMES libmariadb-dev + FORMULA_NAMES mariadb PKG_CONFIG_NAMES mariadb ) diff --git a/cmake/modules/Findlibzstd.cmake b/cmake/modules/Findlibzstd.cmake index 76b1ebeaa362..54b5f0cbe53b 100644 --- a/cmake/modules/Findlibzstd.cmake +++ b/cmake/modules/Findlibzstd.cmake @@ -1,7 +1,7 @@ _userver_module_begin( NAME libzstd DEBIAN_NAMES libzstd-dev - FORMULA_NAMES libzstd + FORMULA_NAMES zstd RPM_NAMES libzstd-dev PACMAN_NAMES zstd ) diff --git a/cmake/modules/FindLZ4.cmake b/cmake/modules/Findlz4.cmake similarity index 84% rename from cmake/modules/FindLZ4.cmake rename to cmake/modules/Findlz4.cmake index 6a35df651963..d4abb3a4a5d6 100644 --- a/cmake/modules/FindLZ4.cmake +++ b/cmake/modules/Findlz4.cmake @@ -1,5 +1,5 @@ _userver_module_begin( - NAME LZ4 + NAME lz4 VERSION 1.9.2 DEBIAN_NAMES liblz4-dev FORMULA_NAMES lz4 @@ -16,4 +16,4 @@ _userver_module_find_library( _userver_module_end() -add_library(LZ4::LZ4 ALIAS LZ4) +add_library(lz4::lz4 ALIAS lz4) diff --git a/cmake/modules/Findmongoc.cmake b/cmake/modules/Findmongoc.cmake index 9c3a7c884f40..9a4445bc42db 100644 --- a/cmake/modules/Findmongoc.cmake +++ b/cmake/modules/Findmongoc.cmake @@ -13,6 +13,7 @@ _userver_module_find_include( PATHS /usr/include/libmongoc-1.0 /usr/local/opt/mongo-c/include/libmongoc-1.0 + /opt/homebrew/opt/mongo-c-driver/include/libmongoc-1.0 ) _userver_module_find_library( diff --git a/kafka/CMakeLists.txt b/kafka/CMakeLists.txt index c6c52d7fc6b5..80c669b1bceb 100644 --- a/kafka/CMakeLists.txt +++ b/kafka/CMakeLists.txt @@ -13,7 +13,7 @@ endif() userver_module(kafka SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" - LINK_LIBRARIES_PRIVATE RdKafka sasl2 z libzstd LZ4 CURL::libcurl OpenSSL::SSL OpenSSL::Crypto + LINK_LIBRARIES_PRIVATE RdKafka sasl2 libz libzstd lz4::lz4 CURL::libcurl OpenSSL::SSL OpenSSL::Crypto DBTEST_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests" DBTEST_LINK_LIBRARIES userver::kafka-utest DBTEST_DATABASES kafka @@ -37,7 +37,8 @@ endif() _userver_directory_install(COMPONENT kafka FILES "${USERVER_ROOT_DIR}/cmake/modules/FindRdKafka.cmake" - "${USERVER_ROOT_DIR}/cmake/modules/FindLZ4.cmake" + "${USERVER_ROOT_DIR}/cmake/modules/Findlibz.cmake" + "${USERVER_ROOT_DIR}/cmake/modules/Findlz4.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/userver/modules" ) diff --git a/libraries/easy/src/easy.cpp b/libraries/easy/src/easy.cpp index 4bcf0c7c9092..62f23f0805ca 100644 --- a/libraries/easy/src/easy.cpp +++ b/libraries/easy/src/easy.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/mysql/CMakeLists.txt b/mysql/CMakeLists.txt index e7b2b864208e..5cfba0ff793c 100644 --- a/mysql/CMakeLists.txt +++ b/mysql/CMakeLists.txt @@ -4,13 +4,13 @@ find_package(libmariadb REQUIRED) userver_module(mysql SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" - LINK_LIBRARIES_PRIVATE mariadb + LINK_LIBRARIES_PRIVATE libmariadb DBTEST_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests" - UTEST_LINK_LIBRARIES mariadb + UTEST_LINK_LIBRARIES libmariadb DBTEST_DATABASES mysql UBENCH_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/benchmarks" - UBENCH_LINK_LIBRARIES mariadb + UBENCH_LINK_LIBRARIES libmariadb UBENCH_DATABASES mysql ) diff --git a/mysql/functional_tests/basic_chaos/CMakeLists.txt b/mysql/functional_tests/basic_chaos/CMakeLists.txt index 3e32019e13bf..e0864ac582d9 100644 --- a/mysql/functional_tests/basic_chaos/CMakeLists.txt +++ b/mysql/functional_tests/basic_chaos/CMakeLists.txt @@ -1,7 +1,7 @@ project(userver-mysql-tests-basic-chaos CXX) add_executable(${PROJECT_NAME} "mysql_service.cpp") -target_link_libraries(${PROJECT_NAME} userver-mysql mariadb) +target_link_libraries(${PROJECT_NAME} userver::mysql) userver_chaos_testsuite_add( ENV "TESTSUITE_MYSQL_SERVER_START_TIMEOUT=120.0" diff --git a/mysql/include/userver/storages/mysql/statement_result_set.hpp b/mysql/include/userver/storages/mysql/statement_result_set.hpp index 8ffc7e994e98..0fdb85f42d50 100644 --- a/mysql/include/userver/storages/mysql/statement_result_set.hpp +++ b/mysql/include/userver/storages/mysql/statement_result_set.hpp @@ -322,10 +322,10 @@ std::optional StatementResultSet::AsOptionalSingleField() && { return std::move(*this).DoAsOptionalSingleRow(); } -template +template Container StatementResultSet::DoAsContainerMapped() && { static_assert(meta::kIsRange, "The type isn't actually a container"); - using Extractor = impl::io::TypedExtractor; + using Extractor = impl::io::TypedExtractor; Extractor extractor{}; @@ -379,13 +379,13 @@ std::vector MappedStatementResultSet::AsVector(FieldTag) && { template template Container MappedStatementResultSet::AsContainer() && { - return std::move(result_set_).DoAsContainerMapped(); + return std::move(result_set_).template DoAsContainerMapped(); } template template Container MappedStatementResultSet::AsContainer(FieldTag) && { - return std::move(result_set_).DoAsContainerMapped(); + return std::move(result_set_).template DoAsContainerMapped(); } template diff --git a/rocks/CMakeLists.txt b/rocks/CMakeLists.txt index 41d8c8759994..3609e2f98320 100644 --- a/rocks/CMakeLists.txt +++ b/rocks/CMakeLists.txt @@ -4,7 +4,7 @@ include(SetupRocksDB) userver_module(rocks SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" - LINK_LIBRARIES rocksdb + LINK_LIBRARIES RocksDB::rocksdb UTEST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*_test.cpp" ) diff --git a/samples/mysql_service/CMakeLists.txt b/samples/mysql_service/CMakeLists.txt index 5c96ea0396fa..2ca9c10b2266 100644 --- a/samples/mysql_service/CMakeLists.txt +++ b/samples/mysql_service/CMakeLists.txt @@ -5,6 +5,5 @@ find_package(userver COMPONENTS mysql REQUIRED) add_executable(${PROJECT_NAME} "mysql_service.cpp") target_link_libraries(${PROJECT_NAME} userver::mysql) -target_link_libraries(${PROJECT_NAME} mariadbclient) userver_testsuite_add_simple() diff --git a/scripts/docs/en/deps/macos.md b/scripts/docs/en/deps/macos.md index e0654d6a334d..5a2a6b2b01da 100644 --- a/scripts/docs/en/deps/macos.md +++ b/scripts/docs/en/deps/macos.md @@ -8,14 +8,12 @@ ares cctz libev fmt -grpc googletest hiredis jemalloc krb5 nghttp2 ninja -protobuf pugixml openssl yaml-cpp @@ -24,6 +22,7 @@ rocksdb postgresql@16 redis zlib -amqp-cpp c-ares coreutils +mongo-c-driver +mariadb