aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/cachelib
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/cachelib
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/cachelib')
-rw-r--r--vcpkg/ports/cachelib/fix-build.patch52
-rw-r--r--vcpkg/ports/cachelib/fix-glog.patch13
-rw-r--r--vcpkg/ports/cachelib/portfile.cmake40
-rw-r--r--vcpkg/ports/cachelib/vcpkg.json32
4 files changed, 137 insertions, 0 deletions
diff --git a/vcpkg/ports/cachelib/fix-build.patch b/vcpkg/ports/cachelib/fix-build.patch
new file mode 100644
index 0000000..cc43709
--- /dev/null
+++ b/vcpkg/ports/cachelib/fix-build.patch
@@ -0,0 +1,52 @@
+diff --git a/cachelib/cachebench/util/JSONConfig.h b/cachelib/cachebench/util/JSONConfig.h
+index 97cbe3fe..7e9bbdda 100644
+--- a/cachelib/cachebench/util/JSONConfig.h
++++ b/cachelib/cachebench/util/JSONConfig.h
+@@ -146,10 +146,6 @@ struct Options {};
+
+ template <typename Type, size_t size>
+ constexpr void checkCorrectSize() {
+-#ifndef SKIP_OPTION_SIZE_VERIFY
+- Options<sizeof(Type)> var = Options<size>{};
+- (void)var;
+-#endif
+ }
+ } // namespace cachebench
+ } // namespace cachelib
+diff --git a/cachelib/common/CMakeLists.txt b/cachelib/common/CMakeLists.txt
+index 927f2fa3..fcf6a5a9 100644
+--- a/cachelib/common/CMakeLists.txt
++++ b/cachelib/common/CMakeLists.txt
+@@ -37,9 +37,6 @@ target_link_libraries(cachelib_common PUBLIC
+ FBThrift::thriftprotocol
+ Folly::folly
+ Folly::follybenchmark
+- Folly::folly_exception_tracer
+- Folly::folly_exception_tracer_base
+- Folly::folly_exception_counter
+ )
+
+ install(TARGETS cachelib_common
+diff --git a/cachelib/common/Utils.cpp b/cachelib/common/Utils.cpp
+index 57a1beb9..204a432b 100644
+--- a/cachelib/common/Utils.cpp
++++ b/cachelib/common/Utils.cpp
+@@ -15,7 +15,6 @@
+ */
+
+ #include <dirent.h>
+-#include <folly/debugging/exception_tracer/ExceptionTracer.h>
+ #include <sys/mman.h>
+ #include <sys/resource.h>
+ #include <sys/stat.h>
+@@ -428,10 +427,6 @@ size_t getMemAvailable() {
+ }
+
+ void printExceptionStackTraces() {
+- auto exceptions = folly::exception_tracer::getCurrentExceptions();
+- for (auto& exc : exceptions) {
+- std::cerr << exc << std::endl;
+- }
+ }
+
+ } // namespace util
diff --git a/vcpkg/ports/cachelib/fix-glog.patch b/vcpkg/ports/cachelib/fix-glog.patch
new file mode 100644
index 0000000..6a7e79b
--- /dev/null
+++ b/vcpkg/ports/cachelib/fix-glog.patch
@@ -0,0 +1,13 @@
+diff --git a/cachelib/CMakeLists.txt b/cachelib/CMakeLists.txt
+index 6be8199..2ebff62 100644
+--- a/cachelib/CMakeLists.txt
++++ b/cachelib/CMakeLists.txt
+@@ -96,7 +96,7 @@ find_package(Threads REQUIRED)
+ find_package(Boost REQUIRED COMPONENTS
+ system filesystem regex context program_options thread)
+ find_package(Gflags REQUIRED)
+-find_package(Glog REQUIRED)
++find_package(glog CONFIG REQUIRED)
+ find_package(GTest CONFIG REQUIRED)
+ find_package(folly CONFIG REQUIRED)
+ find_package(fizz CONFIG REQUIRED)
diff --git a/vcpkg/ports/cachelib/portfile.cmake b/vcpkg/ports/cachelib/portfile.cmake
new file mode 100644
index 0000000..5138fc9
--- /dev/null
+++ b/vcpkg/ports/cachelib/portfile.cmake
@@ -0,0 +1,40 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO facebook/CacheLib
+ REF "v${VERSION}"
+ SHA512 0290b51ac3461ae7622f5e916a44f005cf55dded1c7f36ca84e98dbb806f876bde97f187a31f5b0015fe1cc6fc6baa57eb5ecba6ebfa71b86e6a828d299c9763
+ HEAD_REF main
+ PATCHES
+ fix-build.patch
+ fix-glog.patch
+)
+
+FIND_PATH(NUMA_INCLUDE_DIR NAME numa.h
+ PATHS ENV NUMA_ROOT
+ HINTS "$ENV{HOME}/local/include" /opt/local/include /usr/local/include /usr/include
+)
+
+IF (NOT NUMA_INCLUDE_DIR)
+ MESSAGE(FATAL_ERROR "Numa library not found.\nTry: 'sudo yum install numactl numactl-devel' (or sudo apt-get install libnuma1 libnuma-dev)")
+ENDIF ()
+
+file(REMOVE "${SOURCE_PATH}/cmake/FindGlog.cmake")
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/cachelib"
+ OPTIONS
+ -DBUILD_TESTS=OFF
+ -DCMAKE_INSTALL_DIR=share/cachelib
+ -DVCPKG_LOCK_FIND_PACKAGE_uring=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH share/cachelib PACKAGE_NAME cachelib)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+vcpkg_fixup_pkgconfig()
diff --git a/vcpkg/ports/cachelib/vcpkg.json b/vcpkg/ports/cachelib/vcpkg.json
new file mode 100644
index 0000000..864f6f9
--- /dev/null
+++ b/vcpkg/ports/cachelib/vcpkg.json
@@ -0,0 +1,32 @@
+{
+ "name": "cachelib",
+ "version-string": "2025.05.19.00",
+ "description": "Pluggable caching engine to build and scale high performance cache services.",
+ "homepage": "https://github.com/facebook/CacheLib",
+ "license": "Apache-2.0",
+ "supports": "linux & x64 & static",
+ "dependencies": [
+ "fbthrift",
+ "fizz",
+ "fmt",
+ {
+ "name": "folly",
+ "features": [
+ "libaio"
+ ]
+ },
+ "gflags",
+ "glog",
+ "gtest",
+ "tsl-sparse-map",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "wangle"
+ ]
+}