diff --git a/.github/workflows/pika.yml b/.github/workflows/pika.yml index f2ab546a97..d7bcf3bb34 100644 --- a/.github/workflows/pika.yml +++ b/.github/workflows/pika.yml @@ -172,7 +172,7 @@ jobs: - name: Configure CMake run: | export CC=/usr/local/opt/gcc@10/bin/gcc-10 - cmake -B build -DCMAKE_C_COMPILER=/usr/local/opt/gcc@10/bin/gcc-10 -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address + cmake -B build -DCMAKE_C_COMPILER=/usr/local/opt/gcc@10/bin/gcc-10 -DUSE_PIKA_TOOLS=ON -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address - name: Build run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c50d3bc65..95ec7e2e02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -630,9 +630,9 @@ option(USE_PIKA_TOOLS "compile pika-tools" OFF) if (USE_PIKA_TOOLS) ExternalProject_Add(hiredis URL - https://github.com/vipshop/hiredis-vip/archive/refs/tags/0.3.0.tar.gz + https://github.com/redis/hiredis/archive/refs/tags/v1.2.0.tar.gz URL_HASH - MD5=e4d4a2928188b11f696d35ca1c52e9a4 + MD5=119767d178cfa79718a80c83e0d0e849 DOWNLOAD_NO_PROGRESS 1 UPDATE_COMMAND @@ -654,7 +654,7 @@ if (USE_PIKA_TOOLS) INSTALL_COMMAND make PREFIX=${STAGED_INSTALL_PREFIX} -j${CPU_CORE} install ) - set(HIREDIS_LIBRARY ${INSTALL_LIBDIR}/libhiredis_vip.a) + set(HIREDIS_LIBRARY ${INSTALL_LIBDIR}/libhiredis.a) ExternalProject_Add(bz2 URL diff --git a/tools/benchmark_client/CMakeLists.txt b/tools/benchmark_client/CMakeLists.txt index 2de0f750d0..ac4c652edd 100644 --- a/tools/benchmark_client/CMakeLists.txt +++ b/tools/benchmark_client/CMakeLists.txt @@ -19,4 +19,5 @@ target_link_libraries(benchmark_client ${HIREDIS_LIBRARY}) set_target_properties(benchmark_client PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CMAKE_COMPILER_IS_GNUCXX TRUE - COMPILE_FLAGS ${CXXFLAGS}) \ No newline at end of file + COMPILE_FLAGS ${CXXFLAGS}) +add_dependencies(benchmark_client snappy hiredis) \ No newline at end of file diff --git a/tools/benchmark_client/benchmark_client.cc b/tools/benchmark_client/benchmark_client.cc index 8edf2d483f..c34cf34382 100644 --- a/tools/benchmark_client/benchmark_client.cc +++ b/tools/benchmark_client/benchmark_client.cc @@ -10,7 +10,7 @@ #include #include -#include "hiredis-vip/hiredis.h" +#include "hiredis/hiredis.h" #include "pstd/include/pstd_status.h" #include "pstd/include/pstd_string.h" diff --git a/tools/pika-port/pika_port_3/CMakeLists.txt b/tools/pika-port/pika_port_3/CMakeLists.txt index 76515d00e6..9c229d7092 100644 --- a/tools/pika-port/pika_port_3/CMakeLists.txt +++ b/tools/pika-port/pika_port_3/CMakeLists.txt @@ -10,10 +10,11 @@ add_executable(pika_port ${BASE_OBJS}) target_include_directories(pika_port PRIVATE ${INSTALL_INCLUDEDIR} PRIVATE ${PROJECT_SOURCE_DIR}) -target_link_libraries(pika_port ${ROCKSDB_LIBRARY} pthread rt net pstd storage ${GLOG_LIBRARY} +target_link_libraries(pika_port ${ROCKSDB_LIBRARY} pthread net pstd storage ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${SNAPPY_LIBRARY} ${ZLIB_LIBRARY} ${BZ2_LIBRARY} ${LZ4_LIBRARY} ${ZSTD_LIBRARY}) set_target_properties(pika_port PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CMAKE_COMPILER_IS_GNUCXX TRUE - COMPILE_FLAGS ${CXXFLAGS}) \ No newline at end of file + COMPILE_FLAGS ${CXXFLAGS}) +add_dependencies(pika_port rocksdb glog gflags snappy zlib bz2 lz4 zstd) \ No newline at end of file diff --git a/tools/pika-port/pika_port_3/main.cc b/tools/pika-port/pika_port_3/main.cc index 268bc33f8e..0fd63bd372 100644 --- a/tools/pika-port/pika_port_3/main.cc +++ b/tools/pika-port/pika_port_3/main.cc @@ -31,7 +31,11 @@ static int lockFile(int fd) { } static void createPidFile(const char* file) { - int fd = open(file, O_RDWR | O_CREAT | O_DIRECT, S_IRUSR | S_IWUSR); + int flags = O_RDWR | O_CREAT; +#if !defined(OS_MACOSX) && !defined(OS_OPENBSD) && !defined(OS_SOLARIS) + flags |= O_DIRECT; +#endif + int fd = open(file, flags, S_IRUSR | S_IWUSR); if (-1 == fd) { LOG(FATAL) << "open(" << file << ") = " << fd; } diff --git a/tools/pika_to_txt/CMakeLists.txt b/tools/pika_to_txt/CMakeLists.txt index 0dd806e2a2..a99781d8f0 100644 --- a/tools/pika_to_txt/CMakeLists.txt +++ b/tools/pika_to_txt/CMakeLists.txt @@ -14,8 +14,9 @@ target_include_directories(pika_to_txt PRIVATE ${INSTALL_INCLUDEDIR} PRIVATE ${PROJECT_SOURCE_DIR}) target_link_libraries(pika_to_txt storage net pstd ${ROCKSDB_LIBRARY} pthread ${SNAPPY_LIBRARY} - ${ZLIB_LIBRARY} ${BZ2_LIBRARY} ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} rt) + ${ZLIB_LIBRARY} ${BZ2_LIBRARY} ${GLOG_LIBRARY} ${GFLAGS_LIBRARY}) set_target_properties(pika_to_txt PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CMAKE_COMPILER_IS_GNUCXX TRUE - COMPILE_FLAGS ${CXXFLAGS}) \ No newline at end of file + COMPILE_FLAGS ${CXXFLAGS}) +add_dependencies(pika_to_txt rocksdb snappy zlib bz2 glog gflags) \ No newline at end of file diff --git a/tools/rdb_to_pika/CMakeLists.txt b/tools/rdb_to_pika/CMakeLists.txt index 0dddd89aa9..5cfb5a36f8 100644 --- a/tools/rdb_to_pika/CMakeLists.txt +++ b/tools/rdb_to_pika/CMakeLists.txt @@ -11,4 +11,5 @@ target_link_libraries(redisConn ${HIREDIS_LIBRARY}) set_target_properties(redisConn PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CMAKE_COMPILER_IS_GNUCXX TRUE - COMPILE_FLAGS ${CXXFLAGS}) \ No newline at end of file + COMPILE_FLAGS ${CXXFLAGS}) +add_dependencies(redisConn hiredis) \ No newline at end of file diff --git a/tools/rdb_to_pika/protocoltopika.cc b/tools/rdb_to_pika/protocoltopika.cc index cb275ec7d6..80d45bb9d3 100644 --- a/tools/rdb_to_pika/protocoltopika.cc +++ b/tools/rdb_to_pika/protocoltopika.cc @@ -3,7 +3,7 @@ #include #include #include -#include "hiredis-vip/hiredis.h" +#include "hiredis/hiredis.h" void Usage() { std::cout << "Usage:" << std::endl; diff --git a/tools/txt_to_pika/CMakeLists.txt b/tools/txt_to_pika/CMakeLists.txt index d8c76fcba6..81ba4d7fc1 100644 --- a/tools/txt_to_pika/CMakeLists.txt +++ b/tools/txt_to_pika/CMakeLists.txt @@ -15,8 +15,9 @@ target_include_directories(txt_to_pika PRIVATE ${INSTALL_INCLUDEDIR} ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(txt_to_pika storage net pstd ${ROCKSDB_LIBRARY} pthread ${SNAPPY_LIBRARY} - ${ZLIB_LIBRARY} ${BZ2_LIBRARY} ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} rt) + ${ZLIB_LIBRARY} ${BZ2_LIBRARY} ${GLOG_LIBRARY} ${GFLAGS_LIBRARY}) set_target_properties(txt_to_pika PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CMAKE_COMPILER_IS_GNUCXX TRUE - COMPILE_FLAGS ${CXXFLAGS}) \ No newline at end of file + COMPILE_FLAGS ${CXXFLAGS}) +add_dependencies(txt_to_pika rocksdb snappy zlib bz2 glog gflags) \ No newline at end of file