Compare commits

..

1 commit

Author SHA1 Message Date
Michel Alexandre Salim
ecf2a4235c Disable building tests when compiling with GCC
Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
2022-03-16 20:47:02 -07:00
10 changed files with 110 additions and 118 deletions

10
.gitignore vendored
View file

@ -1,12 +1,2 @@
/CacheLib-03dcb9bbddb977b5ec6e9ba6c5b1a53cac521f85.tar.gz
/CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291.tar.gz
/cachelib-2023.04.24.00.tar.gz
/cachelib-2023.07.03.00.tar.gz
/cachelib-2023.09.11.00.tar.gz
/cachelib-2023.10.09.00.tar.gz
/cachelib-2023.10.16.00.tar.gz
/cachelib-2024.01.22.00.tar.gz
/cachelib-2024.02.19.00.tar.gz
/cachelib-2024.07.22.00.tar.gz
/cachelib-2024.08.19.00.tar.gz
/cachelib-2025.02.03.00.tar.gz

View file

@ -1,43 +0,0 @@
--- a/cachelib/cachebench/CMakeLists.txt
+++ b/cachelib/cachebench/CMakeLists.txt
@@ -41,25 +41,6 @@ target_link_libraries(cachelib_cachebenc
gflags
)
-add_library (cachelib_binary_trace_gen
- ./runner/Runner.cpp
- ./runner/Stressor.cpp
- ./util/CacheConfig.cpp
- ./util/Config.cpp
- ./workload/BlockChunkCache.cpp
- ./workload/BlockChunkReplayGenerator.cpp
- ./workload/PieceWiseCache.cpp
- ./workload/OnlineGenerator.cpp
- ./workload/WorkloadGenerator.cpp
- ./workload/PieceWiseReplayGenerator.cpp
- )
-add_dependencies(cachelib_binary_trace_gen thrift_generated_files)
-target_link_libraries(cachelib_binary_trace_gen PUBLIC
- cachelib_datatype
- cachelib_allocator
- gflags
-)
-
if ((CMAKE_SYSTEM_NAME STREQUAL Linux) AND
(CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64))
else()
@@ -68,14 +49,11 @@ endif()
add_executable (cachebench main.cpp)
-add_executable (binary_trace_gen binary_trace_gen.cpp)
target_link_libraries(cachebench cachelib_cachebench)
-target_link_libraries(binary_trace_gen cachelib_binary_trace_gen)
install(
TARGETS
cachebench
- binary_trace_gen
DESTINATION ${BIN_INSTALL_DIR}
)

View file

@ -1,6 +1,6 @@
diff '--color=auto' -ruN CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8/cachelib/cmake/FindGTest.cmake CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8-find-gtest/cachelib/cmake/FindGTest.cmake
--- /dev/null
+++ b/cachelib/cmake/FindGTest.cmake
--- CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8/cachelib/cmake/FindGTest.cmake 1969-12-31 16:00:00.000000000 -0800
+++ CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8-find-gtest/cachelib/cmake/FindGTest.cmake 2022-02-24 20:08:51.087790319 -0800
@@ -0,0 +1,54 @@
+# Copyright (c) Facebook, Inc. and its affiliates.
+#
@ -56,9 +56,10 @@ diff '--color=auto' -ruN CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8/cache
+if(GTEST_FOUND AND NOT GTEST_FIND_QUIETLY)
+ message(STATUS "GTEST: ${GTEST_INCLUDE_DIRS}")
+endif()
--- a/cachelib/CMakeLists.txt
+++ b/cachelib/CMakeLists.txt
@@ -97,7 +97,7 @@ find_package(Boost REQUIRED COMPONENTS
diff '--color=auto' -ruN CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8/cachelib/CMakeLists.txt CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8-find-gtest/cachelib/CMakeLists.txt
--- CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8/cachelib/CMakeLists.txt 2021-12-20 07:22:18.000000000 -0800
+++ CacheLib-c4904ef2524f396eb432392f8308a69dda926bd8-find-gtest/cachelib/CMakeLists.txt 2022-02-24 20:12:39.078602510 -0800
@@ -93,7 +93,7 @@
system filesystem regex context program_options thread)
find_package(Gflags REQUIRED)
find_package(Glog REQUIRED)

View file

@ -1,11 +0,0 @@
--- a/cachelib/navy/CMakeLists.txt
+++ b/cachelib/navy/CMakeLists.txt
@@ -105,7 +105,7 @@ if (BUILD_TESTS)
add_test (scheduler/tests/ThreadPoolJobSchedulerTest.cpp)
add_test (driver/tests/DriverTest.cpp)
if (NOT MISSING_FALLOCATE)
- add_test (common/tests/DeviceTest.cpp)
+# add_test (common/tests/DeviceTest.cpp)
endif()
add_test (block_cache/tests/AllocatorTest.cpp)
add_test (block_cache/tests/RegionManagerTest.cpp)

View file

@ -0,0 +1,61 @@
diff '--color=auto' -ruN CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/allocator/CMakeLists.txt CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/allocator/CMakeLists.txt
--- CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/allocator/CMakeLists.txt 2022-03-14 10:49:38.000000000 -0700
+++ CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/allocator/CMakeLists.txt 2022-03-15 14:00:37.874691691 -0700
@@ -77,7 +77,8 @@
DESTINATION ${LIB_INSTALL_DIR} )
if (BUILD_TESTS)
- add_library (allocator_test_support
+ add_library (allocator_test_support OBJECT
+ ../common/TestUtils.cpp
${DATASTRUCT_TESTS_THRIFT_FILES}
./nvmcache/tests/NvmTestBase.cpp
./memory/tests/TestBase.cpp
diff '--color=auto' -ruN CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/benchmarks/CMakeLists.txt CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/benchmarks/CMakeLists.txt
--- CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/benchmarks/CMakeLists.txt 2022-03-14 10:49:38.000000000 -0700
+++ CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/benchmarks/CMakeLists.txt 2022-03-15 13:21:46.885003006 -0700
@@ -44,7 +44,7 @@
add_test (CachelibTickerClockBench.cpp)
add_test (CompactCacheBench.cpp)
add_test (HashMapBenchmark.cpp)
- add_test (ItemsReaperBench.cpp)
+ add_test (ItemsReaperBench.cpp allocator_test_support)
add_test (tl-bench/main.cpp)
add_test (MMTypeAccessBench.cpp)
add_test (MMTypeBench.cpp)
diff '--color=auto' -ruN CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/common/CMakeLists.txt CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/common/CMakeLists.txt
--- CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/common/CMakeLists.txt 2022-03-14 10:49:38.000000000 -0700
+++ CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/common/CMakeLists.txt 2022-03-15 12:15:28.818925017 -0700
@@ -76,12 +76,12 @@
add_test (tests/CohortTests.cpp)
add_test (tests/CounterTests.cpp)
add_test (tests/CountMinSketchTest.cpp)
- add_test (tests/EventInterfaceTest.cpp cachelib_allocator)
+ add_test (tests/EventInterfaceTest.cpp allocator_test_support)
add_test (tests/HashTests.cpp)
add_test (tests/IteratorsTests.cpp)
add_test (tests/MutexTests.cpp)
add_test (tests/PeriodicWorkerTest.cpp)
- add_test (tests/SerializationTest.cpp cachelib_allocator)
+ add_test (tests/SerializationTest.cpp allocator_test_support)
add_test (tests/UtilTests.cpp)
add_test (tests/CountDownLatchTest.cpp)
add_test (tests/UtilTestsRSS.cpp)
diff '--color=auto' -ruN CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/compact_cache/CMakeLists.txt CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/compact_cache/CMakeLists.txt
--- CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/compact_cache/CMakeLists.txt 2022-03-14 10:49:38.000000000 -0700
+++ CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291-fix_test_linking/cachelib/compact_cache/CMakeLists.txt 2022-03-15 11:33:00.611186014 -0700
@@ -12,11 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_library (compact_cache_test_support INTERFACE)
-add_dependencies(compact_cache_test_support INTERFACE thrift_generated_files)
-
if (BUILD_TESTS)
- target_link_libraries (compact_cache_test_support INTERFACE
+ add_library (compact_cache_test_support OBJECT ../common/TestUtils.cpp)
+
+ target_link_libraries (compact_cache_test_support PUBLIC
cachelib_allocator
glog::glog
gflags

View file

@ -1,11 +0,0 @@
--- a/cachelib/compact_cache/CCacheFixedLruBucket.h
+++ b/cachelib/compact_cache/CCacheFixedLruBucket.h
@@ -274,7 +274,7 @@ struct FixedLruBucket {
static void copyValue(T* destPtr, const T* srcPtr) {
XDCHECK(destPtr != nullptr);
XDCHECK(srcPtr != nullptr);
- memcpy(destPtr, srcPtr, sizeof(T));
+ memcpy(reinterpret_cast<void *>(destPtr), reinterpret_cast<const void *>(srcPtr), sizeof(T));
}
};
} // namespace cachelib

View file

@ -1,43 +1,64 @@
%if 0%{?fedora} >= 36
# Folly is compiled with Clang
%bcond_without toolchain_clang
%else
%bcond_with toolchain_clang
%endif
%if %{with toolchain_clang}
%global toolchain clang
%bcond_without build_tests
%else
# failure when compiled with GCC 11:
# /builddir/build/BUILD/CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/compact_cache/tests/CCacheTests.cpp:114:1: required from here
# /builddir/build/BUILD/CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291/cachelib/../cachelib/compact_cache/CCacheFixedLruBucket.h:277:11: internal compiler error: Floating point exception
# 277 | memcpy(destPtr, srcPtr, sizeof(T));
# | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
%bcond_with build_tests
%endif
%bcond_without build_tests
# tests not discoverable by ctest yet
%bcond_with check
%global forgeurl https://github.com/facebook/CacheLib
%global tag 2025.02.03.00
%global date %(echo %{tag} | sed -e 's|.00$||' | sed -e 's|\\.||g')
%global commit bd22b0eb79f7e2326f77a22c278c48e454882291
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global date 20220314
# disable forge macro snapinfo generation
# https://pagure.io/fedora-infra/rpmautospec/issue/240
%global distprefix %{nil}
%forgemeta
# see cachelib/allocator/CacheVersion.h's kCachelibVersion
%global major_ver 17
%global major_ver 16
Name: cachelib
Version: %{major_ver}^%{date}
Version: %{major_ver}^%{date}git%{shortcommit}
Release: %autorelease
Summary: Pluggable caching engine for scale high performance cache services
License: Apache-2.0
License: ASL 2.0
URL: %forgeurl
Source: %{url}/archive/v%{tag}/%{name}-%{tag}.tar.gz
# DeviceTest needs common/FdpNvme.cpp. Disable for now
Patch: %{name}-fix-DeviceTest-FDP.diff
# incomplete dependencies, will sort out later
Patch: %{name}-disable-binary_trace_gen.diff
Source0: %forgesource
Patch0: %{name}-fix_test_linking.patch
# needed on EL8; its gtest does not come with cmake files
Patch100: %{name}-find-gtest.patch
# Workaround for gcc issue (still needed on epel9 x86_64)
# https://bugzilla.redhat.com/show_bug.cgi?id=2108665
Patch200: %{name}-workaround-gcc-epel9-x86_64-bz2108665.patch
ExclusiveArch: x86_64 aarch64 ppc64le
# Folly is known not to work on big-endian CPUs
# https://bugzilla.redhat.com/show_bug.cgi?id=1892151
ExcludeArch: s390x
%if 0%{?fedora} >= 36
# fmt code breaks: https://bugzilla.redhat.com/show_bug.cgi?id=2061022
ExcludeArch: ppc64le
%endif
# does not compile cleanly on 32-bit arches
# https://bugzilla.redhat.com/show_bug.cgi?id=2036124
%if 0%{?el8}
ExcludeArch: %{arm}
%else
ExcludeArch: %{arm32}
%endif
ExcludeArch: %{ix86}
BuildRequires: cmake
%if %{with toolchain_clang}
@ -45,10 +66,9 @@ BuildRequires: clang
%else
BuildRequires: gcc-c++
%endif
BuildRequires: fbthrift-devel = %{tag}
BuildRequires: fizz-devel = %{tag}
BuildRequires: folly-devel = %{tag}
BuildRequires: mvfst-devel = %{tag}
BuildRequires: fbthrift-devel
BuildRequires: fizz-devel
BuildRequires: folly-devel
%if %{with build_tests}
BuildRequires: gmock-devel
%endif
@ -57,7 +77,6 @@ BuildRequires: gmock-devel
BuildRequires: gtest-devel
BuildRequires: libdwarf-devel
BuildRequires: libzstd-devel
BuildRequires: numactl-devel
BuildRequires: wangle-devel
BuildRequires: zlib-devel
BuildRequires: tsl-sparse-map-devel
@ -84,15 +103,10 @@ applications that use %{name}.
%prep
%autosetup -n CacheLib-%{tag} -N
%autopatch -p1 -M 99
%forgesetup
%patch0 -p1
%if 0%{?el8}
%autopatch -p1 -m 100 -M 199
%endif
%ifarch x86_64
%if 0%{?el9}
%autopatch -p1 -m 200 -M 209
%endif
%patch100 -p1
%endif

View file

@ -1,7 +0,0 @@
#!/bin/sh
PREFIX='constexpr uint64_t kCachelibVersion = '
SUFFIX=';'
echo $(grep "${PREFIX}" CacheLib-*/cachelib/allocator/CacheVersion.h |
sed -e "s|${PREFIX}||" | sed -e "s|${SUFFIX}||")

2
series
View file

@ -1,2 +0,0 @@
cachelib-fix-DeviceTest-FDP.diff
cachelib-disable-binary_trace_gen.diff

View file

@ -1 +1 @@
SHA512 (cachelib-2025.02.03.00.tar.gz) = 439e4941ed0ab42916342d8e702c31def0ae36ef52153ebac9d6b8bb26e9a9cef677ba1352ec5ffb4b962db8cca54151cde534c54e4427df2820a63ffb862ecd
SHA512 (CacheLib-bd22b0eb79f7e2326f77a22c278c48e454882291.tar.gz) = 38643e57c51047abf9888b4442c305cf9de9c42bd1560cdb68edabd10158ce9d904eb1bdef546228e3818679135d6d6147c3b2d4c021ea0ad177f53f9f215305