Skip to content

Commit

Permalink
Update folly library.
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd committed Dec 11, 2023
1 parent daf049a commit e170c54
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pipeline {

stage("Compile") {
steps {
sh "conan export 3rd_party/folly folly/nu2.2022.01.31.00@ ; \
sh "conan export 3rd_party/folly folly/nu2.2023.12.11.00@ ; \
conan create ${BUILD_MISSING} -pr debug -o ${PROJECT}:sanitize=True . ${PROJECT}/${TAG} ; \
conan create ${BUILD_MISSING} -pr debug . ${PROJECT}/${TAG} ; \
conan create ${BUILD_MISSING} -pr test -o ${PROJECT}:malloc_impl=tcmalloc . ${PROJECT}/${TAG} ; \
Expand Down
14 changes: 14 additions & 0 deletions 3rd_party/folly/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ sources:
"nu2.2022.01.31.00":
url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz"
sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c"
"nu2.2023.12.11.00":
url: "https://github.com/facebook/folly/archive/v2023.12.11.00.tar.gz"
sha256: "1ff0c0258f8322a818a6e0cd27c0fc965360dc04af308e59349e1c79966190a1"
patches:
"2019.10.21.00":
- patch_file: "patches/0001-find-packages.patch"
Expand Down Expand Up @@ -56,3 +59,14 @@ patches:
base_path: "source_subfolder"
- patch_file: "patches/0023-fix-safe-check-sanitize.patch"
base_path: "source_subfolder"
"nu2.2023.12.11.00":
- patch_file: "patches/0016-find-packages.patch"
base_path: "source_subfolder"
- patch_file: "patches/0018-find-glog.patch"
base_path: "source_subfolder"
- patch_file: "patches/0019-exclude-example.patch"
base_path: "source_subfolder"
- patch_file: "patches/0022-fix-windows-minmax.patch"
base_path: "source_subfolder"
- patch_file: "patches/0024-compiler-flags.patch"
base_path: "source_subfolder"
8 changes: 4 additions & 4 deletions 3rd_party/folly/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ def configure(self):
del self.options.fPIC

def requirements(self):
self.requires("boost/1.78.0")
self.requires("boost/1.82.0")
self.requires("bzip2/1.0.8")
self.requires("double-conversion/3.2.0")
self.requires("gflags/2.2.2")
self.requires("glog/0.4.0")
self.requires("libevent/2.1.12")
self.requires("openssl/1.1.1q")
self.requires("openssl/3.1.1")
self.requires("lz4/1.9.3")
self.requires("snappy/1.1.9")
self.requires("zlib/1.2.12")
self.requires("zlib/1.2.13")
self.requires("zstd/1.5.2")
if not is_msvc(self):
self.requires("libdwarf/20191104")
Expand All @@ -93,7 +93,7 @@ def requirements(self):
self.requires("libiberty/9.1.0")
self.requires("libunwind/1.5.0")
if Version(self.version) >= "2020.08.10.00":
self.requires("fmt/7.1.3")
self.requires("fmt/[>=10]")

@property
def _required_boost_components(self):
Expand Down
23 changes: 23 additions & 0 deletions 3rd_party/folly/patches/0024-compiler-flags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff -Naur a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake
--- a/CMake/FollyCompilerUnix.cmake 2023-12-08 20:38:13.000000000 -0700
+++ b/CMake/FollyCompilerUnix.cmake 2023-12-11 12:34:46.769353376 -0700
@@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

-set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra")
+set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}")

list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
function(apply_folly_compile_options_to_target THETARGET)
@@ -25,7 +25,6 @@
)
target_compile_options(${THETARGET}
PRIVATE
- -g
-finput-charset=UTF-8
-fsigned-char
-Wall
6 changes: 1 addition & 5 deletions 3rd_party/folly/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ target_link_libraries(${PROJECT_NAME}
Folly::follybenchmark)


if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00")
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
else()
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
endif()
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
13 changes: 5 additions & 8 deletions 3rd_party/folly/test_package/test_package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
#include <folly/experimental/symbolizer/Elf.h>
#endif

static void print_uri(const folly::fbstring& value) {
const folly::Uri uri(value);
std::cout << "The authority from " << value << " is " << uri.authority() << std::endl;
}

int main() {
folly::ThreadedExecutor executor;
folly::Promise<std::string> promise;
folly::Future<std::string> future = promise.getSemiFuture().via(&executor);
folly::Future<folly::Unit> unit = std::move(future).thenValue(print_uri);
auto [promise, future] = folly::makePromiseContract< folly::fbstring >(&executor);
auto unit = std::move(future).thenValue([](auto const value) {
const folly::Uri uri(value);
std::cout << "The authority from " << value << " is " << uri.authority() << std::endl;
});
promise.setValue("https://github.com/bincrafters");
std::move(unit).get();
#if FOLLY_HAVE_ELF
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def requirements(self):

# Linux Specific Support
if self.settings.os in ["Linux"]:
self.requires("folly/nu2.2022.01.31.00")
self.requires("folly/nu2.2023.12.11.00")
self.requires("userspace-rcu/0.11.4")

# Generic packages (conan-center)
Expand Down
2 changes: 1 addition & 1 deletion include/sisl/cache/range_hashmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ class MultiEntryHashNode : public boost::intrusive::slist_base_hook<> {

K m_base_key;
big_offset_t m_base_nth;
folly::small_vector< ValueEntryRange, 8, small_count_t > m_values;
folly::small_vector< ValueEntryRange, 8, folly::small_vector_policy::policy_size_type<small_count_t> > m_values;

public:
MultiEntryHashNode(const K& base_key, big_offset_t nth) : m_base_key{base_key}, m_base_nth{nth} {}
Expand Down
2 changes: 1 addition & 1 deletion prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo -n "Exporting custom recipes..."
echo -n "breakpad."
conan export 3rd_party/breakpad breakpad/cci.20230127@ >/dev/null
echo -n "folly."
conan export 3rd_party/folly folly/nu2.2022.01.31.00@ >/dev/null
conan export 3rd_party/folly folly/nu2.2023.12.11.00@ >/dev/null
echo -n "gperftools."
conan export 3rd_party/gperftools >/dev/null
echo -n "jemalloc."
Expand Down

0 comments on commit e170c54

Please sign in to comment.