Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Upgrade folly to v2024.04.01.00 #5314

Merged
merged 8 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev/vcpkg/ports/folly/boost-1.70.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp
index 2126ec0..ef82ade 100644
index 777ac21ef..a4fc13a09 100644
--- a/folly/portability/PThread.cpp
+++ b/folly/portability/PThread.cpp
@@ -20,6 +20,8 @@
Expand All @@ -11,7 +11,7 @@ index 2126ec0..ef82ade 100644

#include <errno.h>

@@ -691,7 +693,7 @@ int pthread_setspecific(pthread_key_t key, const void* value) {
@@ -682,7 +684,7 @@ int pthread_setspecific(pthread_key_t key, const void* value) {
boost::detail::thread::cleanup_caller_t(),
boost::detail::thread::cleanup_func_t(),
#else
Expand Down
34 changes: 0 additions & 34 deletions dev/vcpkg/ports/folly/disable-non-underscore-posix-names.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/folly/memory/UninitializedMemoryHacks.h b/folly/memory/UninitializedMemoryHacks.h
index daf5eb735..1ac44d6b2 100644
--- a/folly/memory/UninitializedMemoryHacks.h
+++ b/folly/memory/UninitializedMemoryHacks.h
@@ -101,6 +101,9 @@ template <
typename std::enable_if<std::is_trivially_destructible<T>::value>::type>
inline void resizeWithoutInitialization(
std::basic_string<T>& s, std::size_t n) {
+#if defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L
+ s.resize(n);
+#else
if (n <= s.size()) {
s.resize(n);
} else {
@@ -111,6 +114,7 @@ inline void resizeWithoutInitialization(
}
detail::unsafeStringSetLargerSize(s, n);
}
+#endif // defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L
}

/**
@@ -278,8 +282,11 @@ struct MakeUnsafeStringSetLargerSize {
} // namespace folly

#if defined(FOLLY_DECLARE_STRING_RESIZE_WITHOUT_INIT)
+#if defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L
+#else
FOLLY_DECLARE_STRING_RESIZE_WITHOUT_INIT(char)
FOLLY_DECLARE_STRING_RESIZE_WITHOUT_INIT(wchar_t)
+#endif // defined(_MSVC_STL_UPDATE) && _MSVC_STL_UPDATE >= 202206L
#endif

namespace folly {
152 changes: 81 additions & 71 deletions dev/vcpkg/ports/folly/fix-deps.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
diff --git a/CMake/folly-config.cmake.in b/CMake/folly-config.cmake.in
index 0b96f0a10..c90110287 100644
index 0b96f0a10..1559f9f70 100644
--- a/CMake/folly-config.cmake.in
+++ b/CMake/folly-config.cmake.in
@@ -29,10 +29,35 @@ endif()
@@ -29,10 +29,30 @@ endif()
set(FOLLY_LIBRARIES Folly::folly)

# Find folly's dependencies
-find_dependency(fmt)
+find_dependency(fmt CONFIG)
+find_dependency(double-conversion CONFIG)
+find_dependency(glog CONFIG)
+find_dependency(gflags CONFIG)
Expand All @@ -27,12 +28,6 @@ index 0b96f0a10..c90110287 100644
+if (NOT @CMAKE_DISABLE_FIND_PACKAGE_LZ4@)
+ find_dependency(lz4 CONFIG)
+endif()
+
+if (@WITH_liburing@)
+ find_dependency(LibUring)
+endif()
+
+find_dependency(fmt CONFIG)

set(Boost_USE_STATIC_LIBS "@FOLLY_BOOST_LINK_STATIC@")
-find_dependency(Boost 1.51.0 MODULE
Expand All @@ -41,7 +36,7 @@ index 0b96f0a10..c90110287 100644
context
filesystem
diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake
index 4b78e9f02..eb77e29c9 100644
index 41a513a30..d75908f77 100644
--- a/CMake/folly-deps.cmake
+++ b/CMake/folly-deps.cmake
@@ -35,7 +35,7 @@ else()
Expand All @@ -53,27 +48,17 @@ index 4b78e9f02..eb77e29c9 100644
COMPONENTS
context
filesystem
@@ -45,37 +45,38 @@ find_package(Boost 1.51.0 MODULE
@@ -45,37 +45,37 @@ find_package(Boost 1.51.0 MODULE
thread
REQUIRED
)
+set (Boost_LIBRARIES Boost::context Boost::filesystem Boost::program_options Boost::regex Boost::system Boost::thread
+ )
+set(Boost_LIBRARIES Boost::boost Boost::context Boost::filesystem Boost::program_options Boost::regex Boost::system Boost::thread)
list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
-
-find_package(DoubleConversion MODULE REQUIRED)
-list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
+find_package(double-conversion CONFIG REQUIRED)
+list(APPEND FOLLY_LINK_LIBRARIES double-conversion::double-conversion)

-find_package(Glog CONFIG REQUIRED)
-set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND})
+find_package(glog CONFIG REQUIRED)
+set(FOLLY_HAVE_LIBGLOG 1)
list(APPEND FOLLY_LINK_LIBRARIES glog::glog)
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR})
-
-find_package(Gflags MODULE)
-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND})
Expand All @@ -82,41 +67,53 @@ index 4b78e9f02..eb77e29c9 100644
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR})
- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY})
- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR})
+
+find_package(gflags CONFIG)
+if(TARGET gflags::gflags)
+ set(FOLLY_HAVE_LIBGFLAGS 1)
+ list(APPEND FOLLY_LINK_LIBRARIES gflags::gflags)
+ set(FOLLY_LIBGFLAGS_LIBRARY gflags::gflags)
endif()
-endif()

-find_package(Glog MODULE)
-set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND})
-list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR})
+find_package(double-conversion CONFIG REQUIRED)
+list(APPEND FOLLY_LINK_LIBRARIES double-conversion::double-conversion)

-find_package(LibEvent MODULE REQUIRED)
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR})
+find_package(Libevent CONFIG REQUIRED)
+list(APPEND FOLLY_LINK_LIBRARIES libevent::core libevent::extra)
+if(NOT WIN32)
+ list(APPEND FOLLY_LINK_LIBRARIES libevent::pthreads)
+endif()
+find_package(glog CONFIG REQUIRED)
+set(FOLLY_HAVE_LIBGLOG 1)
+list(APPEND FOLLY_LINK_LIBRARIES glog::glog)

-find_package(ZLIB MODULE)
-set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND})
-if (ZLIB_FOUND)
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})
- list(APPEND FOLLY_LINK_LIBRARIES ${ZLIB_LIBRARIES})
- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
+find_package(gflags CONFIG)
+if(TARGET gflags::gflags)
+ set(FOLLY_HAVE_LIBGFLAGS 1)
+ list(APPEND FOLLY_LINK_LIBRARIES gflags::gflags)
+ set(FOLLY_LIBGFLAGS_LIBRARY gflags::gflags)
+endif()
+
+find_package(Libevent CONFIG REQUIRED)
+list(APPEND FOLLY_LINK_LIBRARIES libevent::core libevent::extra)
+if(NOT WIN32)
+ list(APPEND FOLLY_LINK_LIBRARIES libevent::pthreads)
+endif()
+
+if (CMAKE_REQUIRE_FIND_PACKAGE_ZLIB)
+ find_package(ZLIB MODULE REQUIRED)
+ set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND})
+ if (ZLIB_FOUND)
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})
+ list(APPEND FOLLY_LINK_LIBRARIES ${ZLIB_LIBRARIES})
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
+ endif()
+ find_package(ZLIB MODULE REQUIRED)
+ set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND})
+ if (ZLIB_FOUND)
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZLIB_INCLUDE_DIRS})
+ list(APPEND FOLLY_LINK_LIBRARIES ${ZLIB_LIBRARIES})
+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES})
+ endif()
endif()

find_package(OpenSSL 1.1.1 MODULE REQUIRED)
@@ -104,25 +105,30 @@ if (LIBLZMA_FOUND)
@@ -103,25 +103,30 @@ if (LIBLZMA_FOUND)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES})
endif()

Expand All @@ -125,7 +122,7 @@ index 4b78e9f02..eb77e29c9 100644
-if (LZ4_FOUND)
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR})
- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY})
+if (NOT CMAKE_DISABLE_FIND_PACKAGE_LZ4)
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_LZ4)
+ find_package(lz4 CONFIG)
+ if(TARGET lz4::lz4)
+ set(FOLLY_HAVE_LIBLZ4 1)
Expand All @@ -138,65 +135,78 @@ index 4b78e9f02..eb77e29c9 100644
-if(ZSTD_FOUND)
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR})
- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY})
+if (NOT CMAKE_DISABLE_FIND_PACKAGE_Zstd)
+ find_package(zstd CONFIG)
+ if(TARGET zstd::libzstd_shared )
+ set(FOLLY_HAVE_LIBZSTD 1)
+ list(APPEND FOLLY_LINK_LIBRARIES zstd::libzstd_shared)
+ elseif( TARGET zstd::libzstd_static )
+ set(FOLLY_HAVE_LIBZSTD 1)
+ list(APPEND FOLLY_LINK_LIBRARIES zstd::libzstd_static)
+ endif()
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_Zstd)
+ find_package(zstd CONFIG)
+ if(TARGET zstd::libzstd_shared )
+ set(FOLLY_HAVE_LIBZSTD 1)
+ list(APPEND FOLLY_LINK_LIBRARIES zstd::libzstd_shared)
+ elseif( TARGET zstd::libzstd_static )
+ set(FOLLY_HAVE_LIBZSTD 1)
+ list(APPEND FOLLY_LINK_LIBRARIES zstd::libzstd_static)
+ endif()
endif()

-find_package(Snappy MODULE)
-set(FOLLY_HAVE_LIBSNAPPY ${SNAPPY_FOUND})
-if (SNAPPY_FOUND)
- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR})
- list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY})
+if (NOT CMAKE_DISABLE_FIND_PACKAGE_Snappy)
+ find_package(Snappy CONFIG)
+ if(TARGET Snappy::snappy)
+ list(APPEND FOLLY_LINK_LIBRARIES Snappy::snappy)
+ endif()
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_Snappy)
+ find_package(Snappy CONFIG)
+ if(TARGET Snappy::snappy)
+ list(APPEND FOLLY_LINK_LIBRARIES Snappy::snappy)
+ endif()
endif()

find_package(LibDwarf)
@@ -137,13 +143,18 @@ find_package(LibAIO)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS})
@@ -132,17 +137,24 @@ find_package(Libiberty)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS})

-find_package(LibAIO)
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS})
+if(WITH_libaio)
+ find_package(LibAIO)
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES})
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS})
+endif()

-find_package(LibUring)
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
+if(WITH_liburing)
find_package(LibUring)
list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
+ find_package(LibUring)
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
+endif()

-find_package(Libsodium)
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS})
+if (NOT CMAKE_DISABLE_FIND_PACKAGE_unofficial-sodium)
+ find_package(unofficial-sodium CONFIG)
+ if(TARGET unofficial-sodium::sodium)
+ list(APPEND FOLLY_LINK_LIBRARIES unofficial-sodium::sodium)
+ endif()
+if(NOT CMAKE_DISABLE_FIND_PACKAGE_unofficial-sodium)
+ find_package(unofficial-sodium CONFIG)
+ if(TARGET unofficial-sodium::sodium)
+ list(APPEND FOLLY_LINK_LIBRARIES unofficial-sodium::sodium)
+ endif()
+endif()

list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS})
@@ -154,9 +165,9 @@ if (PYTHON_EXTENSIONS)
@@ -153,10 +165,10 @@ if (PYTHON_EXTENSIONS)
endif ()

find_package(LibUnwind)
-list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})
-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
if (LIBUNWIND_FOUND)
set(FOLLY_HAVE_LIBUNWIND ON)
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES})
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS})
set(FOLLY_HAVE_LIBUNWIND ON)
endif()
if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
@@ -299,11 +310,7 @@ endif()
list(APPEND FOLLY_LINK_LIBRARIES "execinfo")
@@ -298,11 +310,7 @@ endif()

add_library(folly_deps INTERFACE)

Expand Down
13 changes: 13 additions & 0 deletions dev/vcpkg/ports/folly/fix-unistd-include.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/folly/experimental/symbolizer/Elf.cpp b/folly/experimental/symbolizer/Elf.cpp
index 6a7f74f..6546fe0 100644
--- a/folly/experimental/symbolizer/Elf.cpp
+++ b/folly/experimental/symbolizer/Elf.cpp
@@ -49,6 +49,8 @@
#define FOLLY_ELF_NATIVE_CLASS __WORDSIZE
#endif // __ELF_NATIVE_CLASS

+#include <unistd.h>
+
namespace folly {
namespace symbolizer {

Loading
Loading