From 6cb3f5e0a872eb35496ce5275e26515aa4c4fef7 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Tue, 28 Nov 2023 12:02:33 +0800 Subject: [PATCH] refactor(regex): use std::regex instead of boost::regex (#1697) This patch removes to build and link Boost::filesystem library, and use std::regex instead of boost::regex. --- cmake_modules/BaseFunctions.cmake | 2 +- src/aio/test/CMakeLists.txt | 2 +- src/base/test/CMakeLists.txt | 2 +- src/block_service/test/CMakeLists.txt | 2 +- src/client/test/CMakeLists.txt | 2 +- src/common/test/CMakeLists.txt | 2 +- src/failure_detector/test/CMakeLists.txt | 2 +- src/geo/bench/CMakeLists.txt | 2 +- src/geo/test/CMakeLists.txt | 2 +- src/http/test/CMakeLists.txt | 2 +- src/meta/CMakeLists.txt | 2 +- src/meta/test/CMakeLists.txt | 2 +- .../test/balancer_simulator/CMakeLists.txt | 2 +- src/meta/test/meta_state/CMakeLists.txt | 2 +- src/nfs/test/CMakeLists.txt | 2 +- src/perf_counter/test/CMakeLists.txt | 2 +- src/redis_protocol/proxy/CMakeLists.txt | 2 +- src/redis_protocol/proxy_ut/CMakeLists.txt | 2 +- src/replica/CMakeLists.txt | 2 +- src/replica/backup/test/CMakeLists.txt | 2 +- src/replica/bulk_load/test/CMakeLists.txt | 2 +- src/replica/duplication/test/CMakeLists.txt | 2 +- src/replica/split/test/CMakeLists.txt | 2 +- src/replica/storage/simple_kv/CMakeLists.txt | 2 +- .../storage/simple_kv/test/CMakeLists.txt | 2 +- src/replica/test/CMakeLists.txt | 2 +- src/runtime/test/CMakeLists.txt | 2 +- src/sample/CMakeLists.txt | 6 +---- src/server/CMakeLists.txt | 2 +- src/server/test/CMakeLists.txt | 2 +- src/shell/CMakeLists.txt | 6 +---- src/test/bench_test/CMakeLists.txt | 2 +- .../backup_restore/CMakeLists.txt | 2 +- .../function_test/base_api/CMakeLists.txt | 2 +- .../function_test/bulk_load/CMakeLists.txt | 2 +- .../detect_hotspot/CMakeLists.txt | 2 +- .../partition_split/CMakeLists.txt | 2 +- .../function_test/recovery/CMakeLists.txt | 2 +- src/test/function_test/restore/CMakeLists.txt | 2 +- .../function_test/throttle/CMakeLists.txt | 2 +- src/test/kill_test/CMakeLists.txt | 2 +- src/test/pressure_test/CMakeLists.txt | 2 +- src/utils/CMakeLists.txt | 2 +- src/utils/fail_point.cpp | 22 +++++-------------- src/utils/long_adder_bench/CMakeLists.txt | 2 +- src/utils/test/CMakeLists.txt | 2 +- .../test/nth_element_bench/CMakeLists.txt | 2 +- src/zookeeper/test/CMakeLists.txt | 2 +- thirdparty/CMakeLists.txt | 2 +- 49 files changed, 54 insertions(+), 72 deletions(-) diff --git a/cmake_modules/BaseFunctions.cmake b/cmake_modules/BaseFunctions.cmake index 1c50d630a4..b55bd05768 100644 --- a/cmake_modules/BaseFunctions.cmake +++ b/cmake_modules/BaseFunctions.cmake @@ -319,7 +319,7 @@ function(dsn_setup_thirdparty_libs) set(CMAKE_PREFIX_PATH ${THIRDPARTY_INSTALL_DIR};${CMAKE_PREFIX_PATH}) message(STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") - find_package(Boost COMPONENTS system filesystem regex REQUIRED) + find_package(Boost COMPONENTS system filesystem REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) find_library(THRIFT_LIB NAMES libthrift.a PATHS ${THIRDPARTY_INSTALL_DIR}/lib NO_DEFAULT_PATH) diff --git a/src/aio/test/CMakeLists.txt b/src/aio/test/CMakeLists.txt index 357499a9c8..b8d4ad675b 100644 --- a/src/aio/test/CMakeLists.txt +++ b/src/aio/test/CMakeLists.txt @@ -35,7 +35,7 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS gtest dsn_runtime dsn_aio test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES diff --git a/src/base/test/CMakeLists.txt b/src/base/test/CMakeLists.txt index 8af554bc5f..651e0c0551 100644 --- a/src/base/test/CMakeLists.txt +++ b/src/base/test/CMakeLists.txt @@ -33,7 +33,7 @@ set(MY_PROJ_LIBS pegasus_base gtest) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config.ini run.sh) diff --git a/src/block_service/test/CMakeLists.txt b/src/block_service/test/CMakeLists.txt index 0a6d66e406..78202667dd 100644 --- a/src/block_service/test/CMakeLists.txt +++ b/src/block_service/test/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/client/test/CMakeLists.txt b/src/client/test/CMakeLists.txt index bcae3897aa..cfe591ce0f 100644 --- a/src/client/test/CMakeLists.txt +++ b/src/client/test/CMakeLists.txt @@ -29,7 +29,7 @@ set(MY_PROJ_LIBS gtest rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 1cdf58407f..9be225417c 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -32,7 +32,7 @@ set(MY_PROJ_LIBS gtest rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/failure_detector/test/CMakeLists.txt b/src/failure_detector/test/CMakeLists.txt index ed4a9703d6..6bd1e05553 100644 --- a/src/failure_detector/test/CMakeLists.txt +++ b/src/failure_detector/test/CMakeLists.txt @@ -43,7 +43,7 @@ set(MY_PROJ_LIBS hashtable rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES diff --git a/src/geo/bench/CMakeLists.txt b/src/geo/bench/CMakeLists.txt index c55feb512c..6df54a6bcb 100644 --- a/src/geo/bench/CMakeLists.txt +++ b/src/geo/bench/CMakeLists.txt @@ -38,7 +38,7 @@ set(MY_PROJ_LIBS dsn_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "config.ini") diff --git a/src/geo/test/CMakeLists.txt b/src/geo/test/CMakeLists.txt index 69435f085d..e29d506ae1 100644 --- a/src/geo/test/CMakeLists.txt +++ b/src/geo/test/CMakeLists.txt @@ -37,7 +37,7 @@ set(MY_PROJ_LIBS dsn_utils gtest) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) add_definitions(-Wno-attributes) diff --git a/src/http/test/CMakeLists.txt b/src/http/test/CMakeLists.txt index 85f2c3798a..5ebc142a55 100644 --- a/src/http/test/CMakeLists.txt +++ b/src/http/test/CMakeLists.txt @@ -29,7 +29,7 @@ set(MY_PROJ_LIBS rocksdb ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/run.sh" diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 9a8b2c44b0..3e4d4d4134 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -55,7 +55,7 @@ set(MY_PROJ_LIBS hdfs rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/meta/test/CMakeLists.txt b/src/meta/test/CMakeLists.txt index 108c111298..60f02c691c 100644 --- a/src/meta/test/CMakeLists.txt +++ b/src/meta/test/CMakeLists.txt @@ -60,7 +60,7 @@ set(MY_PROJ_LIBS gtest hdfs) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES clear.sh run.sh config-test.ini suite1 suite2) diff --git a/src/meta/test/balancer_simulator/CMakeLists.txt b/src/meta/test/balancer_simulator/CMakeLists.txt index fcf8a1edbe..7fe9925dac 100644 --- a/src/meta/test/balancer_simulator/CMakeLists.txt +++ b/src/meta/test/balancer_simulator/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS hashtable gtest) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/meta/test/meta_state/CMakeLists.txt b/src/meta/test/meta_state/CMakeLists.txt index 71c60be222..9f480e7808 100644 --- a/src/meta/test/meta_state/CMakeLists.txt +++ b/src/meta/test/meta_state/CMakeLists.txt @@ -42,7 +42,7 @@ set(MY_PROJ_LIBS gtest ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES diff --git a/src/nfs/test/CMakeLists.txt b/src/nfs/test/CMakeLists.txt index d3f26cc006..0160389925 100644 --- a/src/nfs/test/CMakeLists.txt +++ b/src/nfs/test/CMakeLists.txt @@ -35,7 +35,7 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_nfs dsn_runtime gtest dsn_aio rocksdb test_utils) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES diff --git a/src/perf_counter/test/CMakeLists.txt b/src/perf_counter/test/CMakeLists.txt index 434d97dc11..2e02cf868f 100644 --- a/src/perf_counter/test/CMakeLists.txt +++ b/src/perf_counter/test/CMakeLists.txt @@ -35,7 +35,7 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS gtest dsn_runtime rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES diff --git a/src/redis_protocol/proxy/CMakeLists.txt b/src/redis_protocol/proxy/CMakeLists.txt index f93bc506aa..956ccce76c 100644 --- a/src/redis_protocol/proxy/CMakeLists.txt +++ b/src/redis_protocol/proxy/CMakeLists.txt @@ -38,7 +38,7 @@ set(MY_PROJ_LIBS pegasus.rproxylib set(MY_BINPLACES "config.ini") -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Avoid megabytes of warnings like: # thirdparty/output/include/s2/s1angle.h:288:28: error: diff --git a/src/redis_protocol/proxy_ut/CMakeLists.txt b/src/redis_protocol/proxy_ut/CMakeLists.txt index 521abddc20..cf7bb1df37 100644 --- a/src/redis_protocol/proxy_ut/CMakeLists.txt +++ b/src/redis_protocol/proxy_ut/CMakeLists.txt @@ -27,7 +27,7 @@ set(MY_PROJ_SRC "") # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_PROJ_LIBS pegasus.rproxylib pegasus_base diff --git a/src/replica/CMakeLists.txt b/src/replica/CMakeLists.txt index d4609d9e58..005967def1 100644 --- a/src/replica/CMakeLists.txt +++ b/src/replica/CMakeLists.txt @@ -77,7 +77,7 @@ set(MY_PROJ_LIBS PocoJSON rocksdb) -set(MY_BOOST_LIBS Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/replica/backup/test/CMakeLists.txt b/src/replica/backup/test/CMakeLists.txt index e3dc0ec05b..063246df02 100644 --- a/src/replica/backup/test/CMakeLists.txt +++ b/src/replica/backup/test/CMakeLists.txt @@ -32,7 +32,7 @@ set(MY_PROJ_LIBS dsn_meta_server gtest rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/replica/bulk_load/test/CMakeLists.txt b/src/replica/bulk_load/test/CMakeLists.txt index 86ca7e8b3b..0b0d083851 100644 --- a/src/replica/bulk_load/test/CMakeLists.txt +++ b/src/replica/bulk_load/test/CMakeLists.txt @@ -30,7 +30,7 @@ set(MY_PROJ_LIBS dsn_meta_server test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex rocksdb test_utils) +set(MY_BOOST_LIBS Boost::system Boost::filesystem rocksdb test_utils) set(MY_BINPLACES config-test.ini diff --git a/src/replica/duplication/test/CMakeLists.txt b/src/replica/duplication/test/CMakeLists.txt index b0abc3bd9f..5cc139f916 100644 --- a/src/replica/duplication/test/CMakeLists.txt +++ b/src/replica/duplication/test/CMakeLists.txt @@ -33,7 +33,7 @@ set(MY_PROJ_LIBS dsn_meta_server test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/replica/split/test/CMakeLists.txt b/src/replica/split/test/CMakeLists.txt index 19961ec6dd..7e77ba7302 100644 --- a/src/replica/split/test/CMakeLists.txt +++ b/src/replica/split/test/CMakeLists.txt @@ -29,7 +29,7 @@ set(MY_PROJ_LIBS dsn_meta_server gtest ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config-test.ini diff --git a/src/replica/storage/simple_kv/CMakeLists.txt b/src/replica/storage/simple_kv/CMakeLists.txt index 667b4ab862..8584848f11 100644 --- a/src/replica/storage/simple_kv/CMakeLists.txt +++ b/src/replica/storage/simple_kv/CMakeLists.txt @@ -39,7 +39,7 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_replica_server dsn_meta_server dsn_client dsn_runtime hashtable rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(INI_FILES "") file(GLOB diff --git a/src/replica/storage/simple_kv/test/CMakeLists.txt b/src/replica/storage/simple_kv/test/CMakeLists.txt index de86358d09..a1e0a69b21 100644 --- a/src/replica/storage/simple_kv/test/CMakeLists.txt +++ b/src/replica/storage/simple_kv/test/CMakeLists.txt @@ -42,7 +42,7 @@ set(MY_PROJ_LIBS dsn_replica_server dsn_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed FILE(GLOB CASE_FILES "case-*") diff --git a/src/replica/test/CMakeLists.txt b/src/replica/test/CMakeLists.txt index 587826baad..cd309ba2e8 100644 --- a/src/replica/test/CMakeLists.txt +++ b/src/replica/test/CMakeLists.txt @@ -50,7 +50,7 @@ set(MY_PROJ_LIBS dsn_meta_server test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) #Extra files that will be installed set(MY_BINPLACES clear.sh run.sh config-test.ini) diff --git a/src/runtime/test/CMakeLists.txt b/src/runtime/test/CMakeLists.txt index 01f17e8c50..cd5e0daac8 100644 --- a/src/runtime/test/CMakeLists.txt +++ b/src/runtime/test/CMakeLists.txt @@ -36,7 +36,7 @@ set(MY_PROJ_LIBS gtest rocksdb ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config-test-corrupt-message.ini" diff --git a/src/sample/CMakeLists.txt b/src/sample/CMakeLists.txt index 788bdfc234..b0618dfca8 100644 --- a/src/sample/CMakeLists.txt +++ b/src/sample/CMakeLists.txt @@ -23,11 +23,7 @@ set(MY_PROJ_LIBS pegasus_client_static ) -set(MY_BOOST_LIBS - Boost::filesystem - Boost::system - Boost::regex - ) +set(MY_BOOST_LIBS Boost::filesystem Boost::system) set(MY_BINPLACES config.ini run.sh) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 8139ffa900..a61b75d36e 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -53,7 +53,7 @@ set(MY_PROJ_LIBS hashtable ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config.ini") diff --git a/src/server/test/CMakeLists.txt b/src/server/test/CMakeLists.txt index 836aee4768..4c3ea8a838 100644 --- a/src/server/test/CMakeLists.txt +++ b/src/server/test/CMakeLists.txt @@ -63,7 +63,7 @@ set(MY_PROJ_LIBS add_definitions(-DPEGASUS_UNIT_TEST) add_definitions(-DENABLE_FAIL) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES config.ini run.sh) diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 109df61658..f35ead8e85 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -59,11 +59,7 @@ set(MY_PROJ_LIBS set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config.ini") -set(MY_BOOST_LIBS - Boost::system - Boost::filesystem - Boost::regex # dsn_replica_server.so needs - ) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) SET(CMAKE_INSTALL_RPATH ".") SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/src/test/bench_test/CMakeLists.txt b/src/test/bench_test/CMakeLists.txt index eaf02da84b..307d543d09 100644 --- a/src/test/bench_test/CMakeLists.txt +++ b/src/test/bench_test/CMakeLists.txt @@ -36,7 +36,7 @@ set(MY_PROJ_LIBS krb5 ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "config.ini") diff --git a/src/test/function_test/backup_restore/CMakeLists.txt b/src/test/function_test/backup_restore/CMakeLists.txt index 1d28869f56..51fea317ea 100644 --- a/src/test/function_test/backup_restore/CMakeLists.txt +++ b/src/test/function_test/backup_restore/CMakeLists.txt @@ -32,7 +32,7 @@ set(MY_PROJ_LIBS function_test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/base_api/CMakeLists.txt b/src/test/function_test/base_api/CMakeLists.txt index cfac09357b..3e688f3a17 100644 --- a/src/test/function_test/base_api/CMakeLists.txt +++ b/src/test/function_test/base_api/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/bulk_load/CMakeLists.txt b/src/test/function_test/bulk_load/CMakeLists.txt index ea27eed37b..f9f1976491 100644 --- a/src/test/function_test/bulk_load/CMakeLists.txt +++ b/src/test/function_test/bulk_load/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/detect_hotspot/CMakeLists.txt b/src/test/function_test/detect_hotspot/CMakeLists.txt index 65f7ad2d26..64f5d09d44 100644 --- a/src/test/function_test/detect_hotspot/CMakeLists.txt +++ b/src/test/function_test/detect_hotspot/CMakeLists.txt @@ -39,7 +39,7 @@ set(MY_PROJ_LIBS function_test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/partition_split/CMakeLists.txt b/src/test/function_test/partition_split/CMakeLists.txt index a82e8fe161..b2cff9f606 100644 --- a/src/test/function_test/partition_split/CMakeLists.txt +++ b/src/test/function_test/partition_split/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/recovery/CMakeLists.txt b/src/test/function_test/recovery/CMakeLists.txt index 7fadd12fc7..c83e94324f 100644 --- a/src/test/function_test/recovery/CMakeLists.txt +++ b/src/test/function_test/recovery/CMakeLists.txt @@ -39,7 +39,7 @@ set(MY_PROJ_LIBS function_test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/restore/CMakeLists.txt b/src/test/function_test/restore/CMakeLists.txt index 0382b0591e..f30f901857 100644 --- a/src/test/function_test/restore/CMakeLists.txt +++ b/src/test/function_test/restore/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/function_test/throttle/CMakeLists.txt b/src/test/function_test/throttle/CMakeLists.txt index 09470bc39c..70460d0c5d 100644 --- a/src/test/function_test/throttle/CMakeLists.txt +++ b/src/test/function_test/throttle/CMakeLists.txt @@ -40,7 +40,7 @@ set(MY_PROJ_LIBS test_utils ) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_BINPLACES "../config.ini" "../run.sh") diff --git a/src/test/kill_test/CMakeLists.txt b/src/test/kill_test/CMakeLists.txt index 6e2ab5d6c2..df97448737 100644 --- a/src/test/kill_test/CMakeLists.txt +++ b/src/test/kill_test/CMakeLists.txt @@ -41,7 +41,7 @@ set(MY_PROJ_LIBS ) set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config.ini") -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) if (UNIX) SET(CMAKE_INSTALL_RPATH ".") diff --git a/src/test/pressure_test/CMakeLists.txt b/src/test/pressure_test/CMakeLists.txt index b26cc10b58..42e29b7366 100644 --- a/src/test/pressure_test/CMakeLists.txt +++ b/src/test/pressure_test/CMakeLists.txt @@ -37,7 +37,7 @@ set(MY_PROJ_LIBS set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config-pressure.ini") -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) if (UNIX) SET(CMAKE_INSTALL_RPATH ".") diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index c3cbc3db88..e9129fa51f 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -29,7 +29,7 @@ set(MY_PROJ_NAME dsn_utils) # "GLOB" for non-recursive search set(MY_SRC_SEARCH_MODE "GLOB") -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_PROJ_LIBS dsn_http rocksdb) diff --git a/src/utils/fail_point.cpp b/src/utils/fail_point.cpp index 75287d6dd1..45c809c020 100644 --- a/src/utils/fail_point.cpp +++ b/src/utils/fail_point.cpp @@ -28,27 +28,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include -#include -// IWYU pragma: no_include -// IWYU pragma: no_include -// IWYU pragma: no_include #include #include -#include -#include +#include #include #include +#include "absl/strings/string_view.h" #include "fail_point_impl.h" #include "utils/fail_point.h" #include "utils/fmt_logging.h" #include "utils/rand.h" -#include "absl/strings/string_view.h" namespace dsn { namespace fail { @@ -115,13 +105,13 @@ bool fail_point::parse_from_string(absl::string_view action) _max_cnt = -1; _freq = 100; - boost::regex regex(R"((\d+\%)?(\d+\*)?(\w+)(\((.*)\))?)"); - boost::smatch match; + std::regex regex(R"((\d+\%)?(\d+\*)?(\w+)(\((.*)\))?)"); + std::smatch match; std::string tmp(action.data(), action.length()); - if (boost::regex_match(tmp, match, regex)) { + if (std::regex_match(tmp, match, regex)) { if (match.size() == 6) { - boost::ssub_match sub_match = match[1]; + std::ssub_match sub_match = match[1]; if (!sub_match.str().empty()) { sscanf(sub_match.str().data(), "%d%%", &_freq); } diff --git a/src/utils/long_adder_bench/CMakeLists.txt b/src/utils/long_adder_bench/CMakeLists.txt index 480b048079..d5ace78cac 100644 --- a/src/utils/long_adder_bench/CMakeLists.txt +++ b/src/utils/long_adder_bench/CMakeLists.txt @@ -29,7 +29,7 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime dsn_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt index d77464c360..684a5faaf0 100644 --- a/src/utils/test/CMakeLists.txt +++ b/src/utils/test/CMakeLists.txt @@ -36,7 +36,7 @@ set(MY_PROJ_LIBS dsn_http test_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "${CMAKE_CURRENT_SOURCE_DIR}/config-bad-section.ini" diff --git a/src/utils/test/nth_element_bench/CMakeLists.txt b/src/utils/test/nth_element_bench/CMakeLists.txt index 2bd530690c..7bf0af804b 100644 --- a/src/utils/test/nth_element_bench/CMakeLists.txt +++ b/src/utils/test/nth_element_bench/CMakeLists.txt @@ -29,7 +29,7 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime dsn_utils rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES "") diff --git a/src/zookeeper/test/CMakeLists.txt b/src/zookeeper/test/CMakeLists.txt index 5a06fa6933..cdb6d4cec2 100644 --- a/src/zookeeper/test/CMakeLists.txt +++ b/src/zookeeper/test/CMakeLists.txt @@ -41,7 +41,7 @@ set(MY_PROJ_LIBS gtest rocksdb) -set(MY_BOOST_LIBS Boost::system Boost::filesystem Boost::regex) +set(MY_BOOST_LIBS Boost::system Boost::filesystem) # Extra files that will be installed set(MY_BINPLACES diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index b8608dc363..bbe99ece78 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -61,7 +61,7 @@ ExternalProject_Add(boost URL ${OSS_URL_PREFIX}/boost_1_69_0.tar.bz2 https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2 URL_MD5 a1332494397bf48332cb152abfefcec2 - CONFIGURE_COMMAND ./bootstrap.sh --prefix=. --with-libraries=system,filesystem,regex --with-toolset=gcc + CONFIGURE_COMMAND ./bootstrap.sh --prefix=. --with-libraries=system,filesystem --with-toolset=gcc BUILD_COMMAND ./b2 toolset=gcc cxxflags=-fPIC cxxstd=11 install INSTALL_COMMAND cp -R include/boost ${TP_OUTPUT}/include && cp -R lib ${TP_OUTPUT}/ BUILD_IN_SOURCE 1