Skip to content

Commit

Permalink
fix snappy more
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 5, 2023
1 parent c0dc4af commit ba3f524
Show file tree
Hide file tree
Showing 35 changed files with 60 additions and 33 deletions.
1 change: 1 addition & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/aio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/aio/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/block_service/hdfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/block_service/local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/block_service/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/client/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/common/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/failure_detector/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/geo/bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ set(MY_PROJ_LIBS
s2testing
s2
pegasus_client_static
rocksdb
lz4
zstd
rocksdb
snappy
dsn_utils)

Expand Down
2 changes: 1 addition & 1 deletion src/http/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ set(MY_PROJ_LIBS
zookeeper
hashtable
hdfs
rocksdb
lz4
zstd
rocksdb
snappy)

set(MY_BOOST_LIBS Boost::system Boost::filesystem)
Expand Down
2 changes: 1 addition & 1 deletion src/nfs/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ set(MY_PROJ_LIBS
dsn_runtime
gtest
dsn_aio
rocksdb
lz4
zstd
rocksdb
snappy
test_utils)

Expand Down
2 changes: 1 addition & 1 deletion src/perf_counter/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/backup/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/bulk_load/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/duplication/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/storage/simple_kv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/storage/simple_kv/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/server/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/bench_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/function_test/bulk_load/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test_util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ set(MY_SRC_SEARCH_MODE "GLOB")

set(MY_PROJ_LIBS
gtest
rocksdb
lz4
zstd
rocksdb
snappy)

dsn_add_static_library()
2 changes: 1 addition & 1 deletion src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/utils/long_adder_bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/test/nth_element_bench/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/zookeeper/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ set(MY_PROJ_LIBS
zookeeper
hashtable
gtest
rocksdb
lz4
zstd
rocksdb
snappy)

set(MY_BOOST_LIBS Boost::system Boost::filesystem)
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions thirdparty/fix_snappy-Wsign-compare-warning.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 27f34a580be4a3becf5f8c0cba13433f53c21337 Mon Sep 17 00:00:00 2001
From: Richard O'Grady <[email protected]>
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<const uint8_t*, ptrdiff_t> DecompressBranchless(
DeferMemCopy(&deferred_src, &deferred_length, from, len);
}
} while (ip < ip_limit_min_slop &&
- (op + deferred_length) < op_limit_min_slop);
+ static_cast<ptrdiff_t>(op + deferred_length) < op_limit_min_slop);
exit:
ip--;
assert(ip <= ip_limit);
--
2.42.1

0 comments on commit ba3f524

Please sign in to comment.