diff --git a/.github/workflows/ci-pr-validation.yaml b/.github/workflows/ci-pr-validation.yaml index c73ec515..29026e6c 100644 --- a/.github/workflows/ci-pr-validation.yaml +++ b/.github/workflows/ci-pr-validation.yaml @@ -172,7 +172,7 @@ jobs: sudo apt-get install -y libcurl4-openssl-dev libssl-dev \ protobuf-compiler libprotobuf-dev libboost-dev \ libboost-dev libboost-program-options-dev \ - libzstd-dev libsnappy-dev libgmock-dev libgtest-dev libroaring-dev + libzstd-dev libsnappy-dev libgmock-dev libgtest-dev - name: CMake run: cmake -B build -DBUILD_PERF_TOOLS=ON -DCMAKE_CXX_STANDARD=20 - name: Build @@ -341,6 +341,8 @@ jobs: - name: Build packages run: pkg/${{matrix.pkg.type}}/docker-build-${{matrix.pkg.type}}-${{matrix.cpu.platform}}.sh build:latest + # TODO: verify the pre-built package works without linking issue + cpp-build-macos: timeout-minutes: 120 name: Build CPP Client on macOS with static dependencies diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 70f833c3..c877c642 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -60,7 +60,7 @@ jobs: sudo apt-get install -y libcurl4-openssl-dev libssl-dev \ protobuf-compiler libprotobuf-dev libboost-dev \ libboost-dev libboost-program-options-dev \ - libzstd-dev libsnappy-dev libroaring-dev + libzstd-dev libsnappy-dev - name: Build run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 792c2efa..c2610317 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,6 @@ if (INTEGRATE_VCPKG) find_package(protobuf CONFIG REQUIRED) find_package(zstd CONFIG REQUIRED) find_package(Snappy CONFIG REQUIRED) - find_package(roaring CONFIG REQUIRED) set(COMMON_LIBS CURL::libcurl ZLIB::ZLIB OpenSSL::SSL @@ -136,7 +135,6 @@ if (INTEGRATE_VCPKG) protobuf::libprotobuf $,zstd::libzstd_shared,zstd::libzstd_static> Snappy::snappy - roaring::roaring ) if (USE_ASIO) find_package(asio CONFIG REQUIRED) diff --git a/LegacyFindPackages.cmake b/LegacyFindPackages.cmake index 2c70ec27..5004545b 100644 --- a/LegacyFindPackages.cmake +++ b/LegacyFindPackages.cmake @@ -117,25 +117,6 @@ if (NOT ZLIB_INCLUDE_DIRS OR NOT ZLIB_LIBRARIES) message(FATAL_ERROR "Could not find zlib") endif () -find_package(roaring QUIET) -if (NOT ROARING_FOUND) - find_path(ROARING_INCLUDE_DIRS NAMES roaring/roaring.hh) - find_library(ROARING_LIBRARIES NAMES roaring libroaring) -endif () -message("ROARING_INCLUDE_DIRS: " ${ROARING_INCLUDE_DIRS}) -message("ROARING_LIBRARIES: " ${ROARING_LIBRARIES}) -if (NOT ROARING_INCLUDE_DIRS OR NOT ROARING_LIBRARIES) - message(FATAL_ERROR "Could not find libroaring") -endif () -file(READ "${ROARING_INCLUDE_DIRS}/roaring/roaring.hh" ROARING_HEADER_CONTENTS) -string(REGEX MATCH "namespace roaring" ROARING_HAS_NAMESPACE "${ROARING_HEADER_CONTENTS}") -if (ROARING_HAS_NAMESPACE) - message(STATUS "Roaring64Map is in namespace roaring") -else () - message(STATUS "Roaring64Map is in global namespace") - add_definitions(-DROARING_NAMESPACE_GLOBAL) -endif () - if (LINK_STATIC AND NOT VCPKG_TRIPLET) find_library(LIB_ZSTD NAMES libzstd.a) message(STATUS "ZStd: ${LIB_ZSTD}") @@ -148,7 +129,6 @@ if (LINK_STATIC AND NOT VCPKG_TRIPLET) elseif (LINK_STATIC AND VCPKG_TRIPLET) find_package(Protobuf REQUIRED) message(STATUS "Found protobuf static library: " ${Protobuf_LIBRARIES}) - find_package(roaring REQUIRED) if (MSVC AND (${CMAKE_BUILD_TYPE} STREQUAL Debug)) find_library(ZLIB_LIBRARIES NAMES zlibd) else () @@ -251,7 +231,6 @@ include_directories( ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS} - ${ROARING_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${Protobuf_INCLUDE_DIRS} ${GTEST_INCLUDE_PATH} @@ -267,7 +246,6 @@ set(COMMON_LIBS ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} - ${ROARING_LIBRARIES} ${ADDITIONAL_LIBRARIES} ${CMAKE_DL_LIBS} ) diff --git a/lib/NegativeAcksTracker.cc b/lib/NegativeAcksTracker.cc index e5f439da..b691b18c 100644 --- a/lib/NegativeAcksTracker.cc +++ b/lib/NegativeAcksTracker.cc @@ -127,7 +127,7 @@ void NegativeAcksTracker::add(const MessageId &m) { auto trimmedTimestamp = trimLowerBit(now + nackDelay_, nackPrecisionBit_); // If the timestamp is already in the map, we can just add the message to the existing entry // Erase batch id to group all nacks from same batch - nackedMessages_[trimmedTimestamp][msgId.ledgerId()].add((uint64_t)msgId.entryId()); + nackedMessages_[trimmedTimestamp][msgId.ledgerId()].insert(msgId.entryId()); } scheduleTimer(); diff --git a/lib/NegativeAcksTracker.h b/lib/NegativeAcksTracker.h index 8199966c..10578f12 100644 --- a/lib/NegativeAcksTracker.h +++ b/lib/NegativeAcksTracker.h @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #include "AsioDefines.h" #include "AsioTimer.h" @@ -42,11 +42,6 @@ using ClientImplPtr = std::shared_ptr; class ExecutorService; using ExecutorServicePtr = std::shared_ptr; using LedgerId = int64_t; -#ifdef ROARING_NAMESPACE_GLOBAL -using ConditionalRoaringMap = Roaring64Map; -#else -using ConditionalRoaringMap = roaring::Roaring64Map; -#endif class NegativeAcksTracker : public std::enable_shared_from_this { public: @@ -74,7 +69,7 @@ class NegativeAcksTracker : public std::enable_shared_from_this> nackedMessages_; + std::map>> nackedMessages_; const DeadlineTimerPtr timer_; std::atomic_bool closed_{false}; diff --git a/pkg/mac/build-static-library.sh b/pkg/mac/build-static-library.sh index 32c60422..449222b1 100755 --- a/pkg/mac/build-static-library.sh +++ b/pkg/mac/build-static-library.sh @@ -72,5 +72,5 @@ cp ./build-osx/libpulsarwithdeps.a $INSTALL_DIR/lib/ # Test the libraries clang++ win-examples/example.cc -o dynamic.out -std=c++11 -arch $ARCH -I $INSTALL_DIR/include -L $INSTALL_DIR/lib -Wl,-rpath $INSTALL_DIR/lib -lpulsar ./dynamic.out -clang++ win-examples/example.cc -o static.out -std=c++11 -arch $ARCH -I $INSTALL_DIR/include $INSTALL_DIR/lib/libpulsarwithdeps.a $PWD/build-osx/vcpkg_installed/$VCPKG_TRIPLET/lib/libroaring.a +clang++ win-examples/example.cc -o static.out -std=c++11 -arch $ARCH -I $INSTALL_DIR/include $INSTALL_DIR/lib/libpulsarwithdeps.a ./static.out diff --git a/vcpkg.json b/vcpkg.json index 83c926aa..5c40c19e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -43,10 +43,6 @@ "name": "protobuf", "version>=": "3.21.12" }, - { - "name": "roaring", - "version>=": "4.3.1" - }, { "name": "snappy", "version>=": "1.1.10"