From ba3f524d26312683e3100b8694148439819d51df Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Tue, 5 Dec 2023 14:00:32 +0800 Subject: [PATCH] fix snappy more --- .licenserc.yaml | 1 + src/aio/CMakeLists.txt | 2 +- src/aio/test/CMakeLists.txt | 2 +- src/block_service/hdfs/CMakeLists.txt | 2 +- src/block_service/local/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/http/test/CMakeLists.txt | 2 +- src/meta/CMakeLists.txt | 2 +- src/nfs/test/CMakeLists.txt | 2 +- src/perf_counter/test/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/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/server/CMakeLists.txt | 2 +- src/server/test/CMakeLists.txt | 2 +- src/shell/CMakeLists.txt | 2 +- src/test/bench_test/CMakeLists.txt | 2 +- .../function_test/bulk_load/CMakeLists.txt | 2 +- src/test_util/CMakeLists.txt | 2 +- src/utils/CMakeLists.txt | 2 +- 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 +- .../fix_snappy-Wsign-compare-warning.patch | 26 +++++++++++++++++++ 35 files changed, 60 insertions(+), 33 deletions(-) create mode 100644 thirdparty/fix_snappy-Wsign-compare-warning.patch diff --git a/.licenserc.yaml b/.licenserc.yaml index 185ee7757b1..eb931bf65cd 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -69,6 +69,7 @@ header: - 'thirdparty/fix_libevent_for_macos.patch' - 'thirdparty/fix_prometheus-cpp_limits.patch' - 'thirdparty/fix_rocksdb-cmake-PORTABLE-option.patch' + - 'thirdparty/fix_snappy-Wsign-compare-warning.patch' - 'thirdparty/fix_s2_build_with_absl_and_gtest.patch' - 'thirdparty/fix_thrift_for_cpp11.patch' # TODO(yingchun): shell/* files are import from thirdparties, we can move them to thirdparty later. diff --git a/src/aio/CMakeLists.txt b/src/aio/CMakeLists.txt index aead830d3f0..3a27fbe01ae 100644 --- a/src/aio/CMakeLists.txt +++ b/src/aio/CMakeLists.txt @@ -35,9 +35,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime + rocksdb lz4 zstd - rocksdb snappy) #Extra files that will be installed diff --git a/src/aio/test/CMakeLists.txt b/src/aio/test/CMakeLists.txt index 2caa8852556..a9378612afc 100644 --- a/src/aio/test/CMakeLists.txt +++ b/src/aio/test/CMakeLists.txt @@ -38,9 +38,9 @@ set(MY_PROJ_LIBS dsn_runtime dsn_aio test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/block_service/hdfs/CMakeLists.txt b/src/block_service/hdfs/CMakeLists.txt index d453a0568c8..ae821f2bf21 100644 --- a/src/block_service/hdfs/CMakeLists.txt +++ b/src/block_service/hdfs/CMakeLists.txt @@ -28,9 +28,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS hdfs + rocksdb lz4 zstd - rocksdb snappy) #Extra files that will be installed diff --git a/src/block_service/local/CMakeLists.txt b/src/block_service/local/CMakeLists.txt index 0bc44af012c..8fdd0d53acd 100644 --- a/src/block_service/local/CMakeLists.txt +++ b/src/block_service/local/CMakeLists.txt @@ -27,9 +27,9 @@ set(MY_PROJ_SRC "") set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS + rocksdb lz4 zstd - rocksdb snappy) #Extra files that will be installed diff --git a/src/block_service/test/CMakeLists.txt b/src/block_service/test/CMakeLists.txt index dab33febd5b..b8aaad6520a 100644 --- a/src/block_service/test/CMakeLists.txt +++ b/src/block_service/test/CMakeLists.txt @@ -32,9 +32,9 @@ set(MY_PROJ_LIBS gtest_main hdfs test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/client/test/CMakeLists.txt b/src/client/test/CMakeLists.txt index c4c4e8045e8..60f37627602 100644 --- a/src/client/test/CMakeLists.txt +++ b/src/client/test/CMakeLists.txt @@ -27,9 +27,9 @@ set(MY_PROJ_LIBS dsn_runtime dsn_utils gtest + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 6cff0b62687..069d2c4211b 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -30,9 +30,9 @@ set(MY_PROJ_LIBS dsn_replication_common dsn_runtime gtest + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/failure_detector/test/CMakeLists.txt b/src/failure_detector/test/CMakeLists.txt index 4613eed556e..5b5a6832a95 100644 --- a/src/failure_detector/test/CMakeLists.txt +++ b/src/failure_detector/test/CMakeLists.txt @@ -41,9 +41,9 @@ set(MY_PROJ_LIBS dsn.failure_detector gtest hashtable + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/geo/bench/CMakeLists.txt b/src/geo/bench/CMakeLists.txt index e69ef92d650..559747b59de 100644 --- a/src/geo/bench/CMakeLists.txt +++ b/src/geo/bench/CMakeLists.txt @@ -34,9 +34,9 @@ set(MY_PROJ_LIBS s2testing s2 pegasus_client_static + rocksdb lz4 zstd - rocksdb snappy dsn_utils) diff --git a/src/http/test/CMakeLists.txt b/src/http/test/CMakeLists.txt index 4cf5b44595c..4400c0183f7 100644 --- a/src/http/test/CMakeLists.txt +++ b/src/http/test/CMakeLists.txt @@ -26,9 +26,9 @@ set(MY_PROJ_LIBS dsn_runtime curl gtest + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/meta/CMakeLists.txt b/src/meta/CMakeLists.txt index 38981635454..fcc3a123296 100644 --- a/src/meta/CMakeLists.txt +++ b/src/meta/CMakeLists.txt @@ -47,9 +47,9 @@ set(MY_PROJ_LIBS zookeeper hashtable hdfs + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/nfs/test/CMakeLists.txt b/src/nfs/test/CMakeLists.txt index f9f111d6901..ebe7686dcab 100644 --- a/src/nfs/test/CMakeLists.txt +++ b/src/nfs/test/CMakeLists.txt @@ -38,9 +38,9 @@ set(MY_PROJ_LIBS dsn_runtime gtest dsn_aio + rocksdb lz4 zstd - rocksdb snappy test_utils) diff --git a/src/perf_counter/test/CMakeLists.txt b/src/perf_counter/test/CMakeLists.txt index 2005cf5c993..b2c8b157fc9 100644 --- a/src/perf_counter/test/CMakeLists.txt +++ b/src/perf_counter/test/CMakeLists.txt @@ -36,9 +36,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS gtest dsn_runtime + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/CMakeLists.txt b/src/replica/CMakeLists.txt index d558e86f132..5bcd3f57bc8 100644 --- a/src/replica/CMakeLists.txt +++ b/src/replica/CMakeLists.txt @@ -69,9 +69,9 @@ set(MY_PROJ_LIBS dsn_runtime dsn_aio dsn_meta_server + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::filesystem) diff --git a/src/replica/backup/test/CMakeLists.txt b/src/replica/backup/test/CMakeLists.txt index 664507c7e3b..fed60e3120f 100644 --- a/src/replica/backup/test/CMakeLists.txt +++ b/src/replica/backup/test/CMakeLists.txt @@ -29,9 +29,9 @@ set(MY_PROJ_LIBS dsn_meta_server dsn_utils hashtable gtest + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/bulk_load/test/CMakeLists.txt b/src/replica/bulk_load/test/CMakeLists.txt index 620c5e0c9cf..bda1a898198 100644 --- a/src/replica/bulk_load/test/CMakeLists.txt +++ b/src/replica/bulk_load/test/CMakeLists.txt @@ -28,9 +28,9 @@ set(MY_PROJ_LIBS dsn_meta_server hashtable gtest test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/duplication/test/CMakeLists.txt b/src/replica/duplication/test/CMakeLists.txt index 9e3723e2ddd..26e461bd759 100644 --- a/src/replica/duplication/test/CMakeLists.txt +++ b/src/replica/duplication/test/CMakeLists.txt @@ -31,9 +31,9 @@ set(MY_PROJ_LIBS dsn_meta_server hashtable gtest test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/storage/simple_kv/CMakeLists.txt b/src/replica/storage/simple_kv/CMakeLists.txt index c61dcadf155..a2f8506770c 100644 --- a/src/replica/storage/simple_kv/CMakeLists.txt +++ b/src/replica/storage/simple_kv/CMakeLists.txt @@ -43,9 +43,9 @@ set(MY_PROJ_LIBS dsn_client dsn_runtime hashtable + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/storage/simple_kv/test/CMakeLists.txt b/src/replica/storage/simple_kv/test/CMakeLists.txt index f0be3f693e2..0bce41b7124 100644 --- a/src/replica/storage/simple_kv/test/CMakeLists.txt +++ b/src/replica/storage/simple_kv/test/CMakeLists.txt @@ -41,9 +41,9 @@ set(MY_PROJ_LIBS hashtable gtest dsn_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/replica/test/CMakeLists.txt b/src/replica/test/CMakeLists.txt index 590ad5139f7..94b5c89348a 100644 --- a/src/replica/test/CMakeLists.txt +++ b/src/replica/test/CMakeLists.txt @@ -48,9 +48,9 @@ set(MY_PROJ_LIBS hashtable gtest test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/runtime/test/CMakeLists.txt b/src/runtime/test/CMakeLists.txt index 689610f6f31..38e52a4f5be 100644 --- a/src/runtime/test/CMakeLists.txt +++ b/src/runtime/test/CMakeLists.txt @@ -34,9 +34,9 @@ set(MY_PROJ_LIBS dsn_runtime dsn_aio dsn_meta_server + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt index 56adc8d2a22..02f89c4087c 100644 --- a/src/server/CMakeLists.txt +++ b/src/server/CMakeLists.txt @@ -36,9 +36,9 @@ set(MY_PROJ_LIBS dsn.failure_detector dsn.replication.zookeeper_provider dsn_utils + rocksdb lz4 zstd - rocksdb snappy pegasus_reporter pegasus_base diff --git a/src/server/test/CMakeLists.txt b/src/server/test/CMakeLists.txt index 0af2682480f..c9ca108e486 100644 --- a/src/server/test/CMakeLists.txt +++ b/src/server/test/CMakeLists.txt @@ -46,9 +46,9 @@ set(MY_PROJ_LIBS dsn.replication.zookeeper_provider dsn_utils pegasus_reporter + rocksdb lz4 zstd - rocksdb snappy pegasus_client_static event diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index 00fb6d68345..81271006e1f 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -41,9 +41,9 @@ set(MY_PROJ_LIBS dsn.failure_detector pegasus_client_static pegasus_geo_lib + rocksdb lz4 zstd - rocksdb snappy absl::flat_hash_set absl::strings diff --git a/src/test/bench_test/CMakeLists.txt b/src/test/bench_test/CMakeLists.txt index 5fe5b58e339..5a52808d8db 100644 --- a/src/test/bench_test/CMakeLists.txt +++ b/src/test/bench_test/CMakeLists.txt @@ -30,9 +30,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS pegasus_client_static dsn_utils + rocksdb lz4 zstd - rocksdb snappy sasl2 gssapi_krb5 diff --git a/src/test/function_test/bulk_load/CMakeLists.txt b/src/test/function_test/bulk_load/CMakeLists.txt index f94a04ebcd8..ce17323ea7e 100644 --- a/src/test/function_test/bulk_load/CMakeLists.txt +++ b/src/test/function_test/bulk_load/CMakeLists.txt @@ -38,9 +38,9 @@ set(MY_PROJ_LIBS krb5 function_test_utils test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/test_util/CMakeLists.txt b/src/test_util/CMakeLists.txt index da831a6d10f..fd4cf1dc167 100644 --- a/src/test_util/CMakeLists.txt +++ b/src/test_util/CMakeLists.txt @@ -24,9 +24,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS gtest + rocksdb lz4 zstd - rocksdb snappy) dsn_add_static_library() diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index acc9f7b91d3..d3feffab065 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -33,9 +33,9 @@ set(MY_BOOST_LIBS Boost::system Boost::filesystem) set(MY_PROJ_LIBS dsn_http + rocksdb lz4 zstd - rocksdb snappy) # Extra files that will be installed diff --git a/src/utils/long_adder_bench/CMakeLists.txt b/src/utils/long_adder_bench/CMakeLists.txt index a775eba4a31..71568c61aee 100644 --- a/src/utils/long_adder_bench/CMakeLists.txt +++ b/src/utils/long_adder_bench/CMakeLists.txt @@ -30,9 +30,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime dsn_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt index d2c33a10c35..8502cabb767 100644 --- a/src/utils/test/CMakeLists.txt +++ b/src/utils/test/CMakeLists.txt @@ -35,9 +35,9 @@ set(MY_PROJ_LIBS dsn_utils gtest test_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/utils/test/nth_element_bench/CMakeLists.txt b/src/utils/test/nth_element_bench/CMakeLists.txt index e0876cee513..3aae31e4a6a 100644 --- a/src/utils/test/nth_element_bench/CMakeLists.txt +++ b/src/utils/test/nth_element_bench/CMakeLists.txt @@ -30,9 +30,9 @@ set(MY_SRC_SEARCH_MODE "GLOB") set(MY_PROJ_LIBS dsn_runtime dsn_utils + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/src/zookeeper/test/CMakeLists.txt b/src/zookeeper/test/CMakeLists.txt index 426244151df..7dabd1faf5d 100644 --- a/src/zookeeper/test/CMakeLists.txt +++ b/src/zookeeper/test/CMakeLists.txt @@ -39,9 +39,9 @@ set(MY_PROJ_LIBS zookeeper hashtable gtest + rocksdb lz4 zstd - rocksdb snappy) set(MY_BOOST_LIBS Boost::system Boost::filesystem) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 7f0cad4ff0d..e43a5fb3a66 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -381,7 +381,7 @@ ExternalProject_Add(snappy URL ${OSS_URL_PREFIX}/snappy-1.1.10.tar.gz https://github.com/google/snappy/archive/refs/tags/1.1.10.tar.gz URL_MD5 70153395ebe6d72febe2cf2e40026a44 - PATCH_COMMAND "" + PATCH_COMMAND patch -p1 < ${TP_DIR}/fix_snappy-Wsign-compare-warning.patch CMAKE_ARGS ${SNAPPY_OPTIONS} BUILD_COMMAND make -j${PARALLEL} INSTALL_COMMAND make install diff --git a/thirdparty/fix_snappy-Wsign-compare-warning.patch b/thirdparty/fix_snappy-Wsign-compare-warning.patch new file mode 100644 index 00000000000..0540d0177ce --- /dev/null +++ b/thirdparty/fix_snappy-Wsign-compare-warning.patch @@ -0,0 +1,26 @@ +From 27f34a580be4a3becf5f8c0cba13433f53c21337 Mon Sep 17 00:00:00 2001 +From: Richard O'Grady +Date: Wed, 12 Jul 2023 10:12:01 -0700 +Subject: [PATCH] Fix -Wsign-compare warning + +PiperOrigin-RevId: 547529709 +--- + snappy.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/snappy.cc b/snappy.cc +index 688065b..6473123 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1289,7 +1289,7 @@ std::pair DecompressBranchless( + DeferMemCopy(&deferred_src, &deferred_length, from, len); + } + } while (ip < ip_limit_min_slop && +- (op + deferred_length) < op_limit_min_slop); ++ static_cast(op + deferred_length) < op_limit_min_slop); + exit: + ip--; + assert(ip <= ip_limit); +-- +2.42.1 +