From b2930e0b2c6b0dcfd730a88754ea46db7ebb3fa2 Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Mon, 24 Oct 2022 08:54:47 +0800 Subject: [PATCH 001/109] folly: bumpup version & conan v2 support * bumpup to v20221031.00 * conan v2 support * only include needed boost components, not all the boost components, to avoid static link order issue in some cases. * remove cmake version limitation --- recipes/folly/all/CMakeLists.txt | 3 - recipes/folly/all/conandata.yml | 24 ++ recipes/folly/all/conanfile.py | 93 ++++---- .../all/patches/0001-find-packages.patch | 224 +++++++++++------- .../all/patches/0008-find-packages.patch | 153 +++++++++--- .../all/patches/0016-find-packages.patch | 154 +++++++++--- .../0023-fix-cmake-generator-expr.patch | 42 ++++ .../0024-fix-cmake-generator-expr.patch | 42 ++++ .../all/patches/0025-find-packages.patch | 176 ++++++++++++++ recipes/folly/config.yml | 14 +- 10 files changed, 723 insertions(+), 202 deletions(-) create mode 100644 recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch create mode 100644 recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch create mode 100644 recipes/folly/all/patches/0025-find-packages.patch diff --git a/recipes/folly/all/CMakeLists.txt b/recipes/folly/all/CMakeLists.txt index 61f3d3b039e2b..3f6a2fca74929 100644 --- a/recipes/folly/all/CMakeLists.txt +++ b/recipes/folly/all/CMakeLists.txt @@ -1,7 +1,4 @@ cmake_minimum_required(VERSION 3.1) project(cmake_wrapper) -include(conanbuildinfo.cmake) -conan_basic_setup(KEEP_RPATHS) - add_subdirectory("source_subfolder") diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 8fcc8945ab40d..ce075ac7795c3 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -8,6 +8,9 @@ sources: "2022.01.31.00": url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz" sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c" + "2022.10.31.00": + url: "https://github.com/facebook/folly/archive/v2022.10.31.00.tar.gz" + sha256: "46389ab812d010bd03de531e9a18f985ced23737fc26480393720e730821f7be" patches: "2019.10.21.00": - patch_file: "patches/0001-find-packages.patch" @@ -28,6 +31,10 @@ patches: base_path: "source_subfolder" - patch_file: "patches/0020-include-ssizet.patch" base_path: "source_subfolder" + - patch_file: "patches/0023-fix-cmake-generator-expr.patch" + base_path: "source_subfolder" + patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" + patch_type: "backport" "2020.08.10.00": - patch_file: "patches/0008-find-packages.patch" base_path: "source_subfolder" @@ -43,6 +50,10 @@ patches: base_path: "source_subfolder" - patch_file: "patches/0015-benchmark-format-macros.patch" base_path: "source_subfolder" + - patch_file: "patches/0024-fix-cmake-generator-expr.patch" + base_path: "source_subfolder" + patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" + patch_type: "backport" "2022.01.31.00": - patch_file: "patches/0016-find-packages.patch" base_path: "source_subfolder" @@ -54,3 +65,16 @@ patches: base_path: "source_subfolder" - patch_file: "patches/0022-fix-windows-minmax.patch" base_path: "source_subfolder" + "2022.10.31.00": + - patch_file: "patches/0017-compiler-flags.patch" + base_path: "source_subfolder" + patch_description: "fix the hard-coded flag" + patch_type: "conan" + - patch_file: "patches/0019-exclude-example.patch" + base_path: "source_subfolder" + patch_description: "exclude example" + patch_type: "conan" + - patch_file: "patches/0025-find-packages.patch" + base_path: "source_subfolder" + patch_description: "fix cmake find_package" + patch_type: "conan" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 06dc6965155a7..7687a0d2a5bb6 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,11 +1,11 @@ from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.build import can_run +from conan.tools.build import can_run,check_min_cppstd from conan.tools.scm import Version from conan.tools import files from conan import ConanFile -from conans import CMake, tools +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.errors import ConanInvalidConfiguration -import functools +from conans import tools import os required_conan_version = ">=1.45.0" @@ -31,8 +31,6 @@ class FollyConan(ConanFile): "use_sse4_2" : False } - generators = "cmake", "cmake_find_package" - @property def _source_subfolder(self): return "source_subfolder" @@ -60,7 +58,6 @@ def export_sources(self): for patch in self.conan_data.get("patches", {}).get(self.version, []): self.copy(patch["patch_file"]) - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -92,8 +89,10 @@ def requirements(self): if self.settings.os == "Linux": self.requires("libiberty/9.1.0") self.requires("libunwind/1.5.0") - if Version(self.version) >= "2020.08.10.00": + if Version(self.version) >= "2020.08.10.00" and Version(self.version) < "2022.01.31.00": self.requires("fmt/7.1.3") + if Version(self.version) >= "2022.01.31.00": + self.requires("fmt/8.0.1") # Folly bumpup fmt to 8.0.1 in v2022.01.31.00 @property def _required_boost_components(self): @@ -101,7 +100,7 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - tools.check_min_cppstd(self, self._minimum_cpp_standard) + check_min_cppstd(self, self._minimum_cpp_standard) min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) if not min_version: self.output.warn("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) @@ -143,57 +142,59 @@ def validate(self): if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") - # FIXME: Freeze max. CMake version at 3.16.2 to fix the Linux build - def build_requirements(self): - self.build_requires("cmake/3.16.9") - def source(self): files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - @functools.lru_cache(1) - def _configure_cmake(self): - cmake = CMake(self) + def layout(self): + cmake_layout(self) + + + def generate(self): + tc = CMakeToolchain(self) if can_run(self): - cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" - cmake.definitions["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" - cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" - cmake.definitions["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" - cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" - cmake.definitions["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" - cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" - cmake.definitions["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.variables["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" + tc.variables["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.variables["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" + tc.variables["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.variables["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" + tc.variables["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" + tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: - # in folly, if simd >=sse4.2, we also needs -mfma flag to avoid compiling error. + tc.preprocessor_definitions["FOLLY_SSE"] = "4" + tc.preprocessor_definitions["FOLLY_SSE_MINOR"] = "2" if not is_msvc(self): - cmake.definitions["CMAKE_C_FLAGS"] = "-mfma" - cmake.definitions["CMAKE_CXX_FLAGS"] = "-mfma" + tc.variables["CMAKE_C_FLAGS"] = "-mfma" + tc.variables["CMAKE_CXX_FLAGS"] = "-mfma" else: - cmake.definitions["CMAKE_C_FLAGS"] = "/arch:FMA" - cmake.definitions["CMAKE_CXX_FLAGS"] = "/arch:FMA" + tc.variables["CMAKE_C_FLAGS"] = "/arch:FMA" + tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" - cmake.definitions["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) cxx_std_flag = tools.cppstd_flag(self.settings) cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) - cmake.definitions["CXX_STD"] = cxx_std_value + tc.variables["CXX_STD"] = cxx_std_value if is_msvc: - cmake.definitions["MSVC_LANGUAGE_VERSION"] = cxx_std_value - cmake.definitions["MSVC_ENABLE_ALL_WARNINGS"] = False - cmake.definitions["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) - cmake.configure() - return cmake + tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value + tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False + tc.variables["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) + + tc.generate() + deps = CMakeDeps(self) + deps.generate() def build(self): - for patch in self.conan_data.get("patches", {}).get(self.version, []): - tools.patch(**patch) - cmake = self._configure_cmake() + files.apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() cmake.build() def package(self): self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() + cmake = CMake(self) cmake.install() files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) @@ -203,7 +204,6 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "Folly::folly") self.cpp_info.set_property("pkg_config_name", "libfolly") - # TODO: back to global scope in conan v2 once cmake_find_package_* generators removed if Version(self.version) == "2019.10.21.00": self.cpp_info.components["libfolly"].libs = [ "follybenchmark", @@ -228,7 +228,7 @@ def package_info(self): ] self.cpp_info.components["libfolly"].requires = [ - "boost::boost", + "boost::context", "boost::filesystem", "boost::program_options", "boost::regex", "boost::system", "boost::thread", "bzip2::bzip2", "double-conversion::double-conversion", "gflags::gflags", @@ -265,17 +265,6 @@ def package_info(self): if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: - self.cpp_info.components["libfolly"].defines = ["FOLLY_SSE=4", "FOLLY_SSE_MINOR=2"] - - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.filenames["cmake_find_package"] = "folly" - self.cpp_info.filenames["cmake_find_package_multi"] = "folly" - self.cpp_info.names["cmake_find_package"] = "Folly" - self.cpp_info.names["cmake_find_package_multi"] = "Folly" - self.cpp_info.names["pkg_config"] = "libfolly" - self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" - self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") diff --git a/recipes/folly/all/patches/0001-find-packages.patch b/recipes/folly/all/patches/0001-find-packages.patch index 4cee77cd34c1c..395feace9a683 100644 --- a/recipes/folly/all/patches/0001-find-packages.patch +++ b/recipes/folly/all/patches/0001-find-packages.patch @@ -1,23 +1,26 @@ -diff --git a/CMake/FindLibsodium.cmake b/CMake/FindLibsodium.cmake -index 18d4d0c..2b3cd2a 100644 ---- a/CMake/FindLibsodium.cmake -+++ b/CMake/FindLibsodium.cmake -@@ -15,7 +15,7 @@ - find_path(LIBSODIUM_INCLUDE_DIR NAMES sodium.h) - mark_as_advanced(LIBSODIUM_INCLUDE_DIR) - --find_library(LIBSODIUM_LIBRARY NAMES sodium) -+find_library(LIBSODIUM_LIBRARY NAMES sodium libsodium PATHS ${CONAN_LIBSODIUM_ROOT}) - mark_as_advanced(LIBSODIUM_LIBRARY) - - include(FindPackageHandleStandardArgs) diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 048e1cd..da3ab8e 100644 +index 048e1cdf6..f6fac30d3 100644 --- a/CMake/folly-deps.cmake +++ b/CMake/folly-deps.cmake -@@ -36,19 +36,19 @@ find_package(DoubleConversion MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) +@@ -19,7 +19,7 @@ include(CheckFunctionExists) + if(MSVC) + set(Boost_USE_STATIC_LIBS ON) #Force static lib in msvc + endif(MSVC) +-find_package(Boost 1.51.0 MODULE ++find_package(Boost + COMPONENTS + context + filesystem +@@ -32,31 +32,31 @@ find_package(Boost 1.51.0 MODULE + 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 REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) -find_package(Gflags MODULE) -set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) @@ -25,69 +28,130 @@ index 048e1cd..da3ab8e 100644 -list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) -list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) -list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) -- --find_package(Glog MODULE) -+find_package(gflags MODULE REQUIRED) -+set(FOLLY_HAVE_LIBGFLAGS ${GFLAGS_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${CONAN_LIBS_GFLAGS}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_GFLAGS}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARY}) ++find_package(gflags REQUIRED) ++set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARIES}) +list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) -+ -+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(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(glog REQUIRED) ++set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) -find_package(LibEvent MODULE REQUIRED) -+find_package(Libevent MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) - -diff --git a/build/fbcode_builder/CMake/FindGflags.cmake b/build/fbcode_builder/CMake/FindGflags.cmake -index 246ceac..385605e 100644 ---- a/build/fbcode_builder/CMake/FindGflags.cmake -+++ b/build/fbcode_builder/CMake/FindGflags.cmake -@@ -48,8 +48,13 @@ if (gflags_FOUND) - else() - FIND_PATH(LIBGFLAGS_INCLUDE_DIR gflags/gflags.h) - -- FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_staticd) -- FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_static) -+ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflagsd gflags_nothreads_staticd gflags_nothreads_static_debug PATHS ${CONAN_GFLAGS_ROOT}) -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags gflags_nothreads_static PATHS ${CONAN_GFLAGS_ROOT}) -+ else() -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_DEBUG NAMES gflags gflags_nothreads_debug PATHS ${CONAN_GFLAGS_ROOT}) -+ FIND_LIBRARY(LIBGFLAGS_LIBRARY_RELEASE NAMES gflags_nothreads gflags PATHS ${CONAN_GFLAGS_ROOT}) -+ endif() - - INCLUDE(SelectLibraryConfigurations) - SELECT_LIBRARY_CONFIGURATIONS(LIBGFLAGS) -diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake -index a589b2e..15aef75 100644 ---- a/build/fbcode_builder/CMake/FindGlog.cmake -+++ b/build/fbcode_builder/CMake/FindGlog.cmake -@@ -8,8 +8,7 @@ - - include(FindPackageHandleStandardArgs) - --find_library(GLOG_LIBRARY glog -- PATHS ${GLOG_LIBRARYDIR}) -+find_library(GLOG_LIBRARY glog glogd PATHS ${CONAN_GLOG_ROOT}) - - find_path(GLOG_INCLUDE_DIR glog/logging.h - PATHS ${GLOG_INCLUDEDIR}) -diff --git a/build/fbcode_builder/CMake/FindLibEvent.cmake b/build/fbcode_builder/CMake/FindLibEvent.cmake -index dd11ebd..9ef0807 100644 ---- a/build/fbcode_builder/CMake/FindLibEvent.cmake -+++ b/build/fbcode_builder/CMake/FindLibEvent.cmake -@@ -50,7 +50,7 @@ if (TARGET event) - endif() - else() - find_path(LIBEVENT_INCLUDE_DIR event.h PATHS ${LibEvent_INCLUDE_PATHS}) -- find_library(LIBEVENT_LIB NAMES event PATHS ${LibEvent_LIB_PATHS}) -+ find_library(LIBEVENT_LIB NAMES event libevent PATHS ${CONAN_LIBEVENT_ROOT}) - - if (LIBEVENT_LIB AND LIBEVENT_INCLUDE_DIR) - set(LibEvent_FOUND TRUE) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) ++find_package(Libevent REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) + + find_package(OpenSSL MODULE REQUIRED) +-list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) +-list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) + check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) + + find_package(ZLIB MODULE) +@@ -67,10 +67,10 @@ if (ZLIB_FOUND) + endif() + + find_package(BZip2 MODULE) +-set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) +-if (BZIP2_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) +- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) ++set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) ++if (BZip2_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) + endif() + + find_package(LibLZMA MODULE) +@@ -80,18 +80,18 @@ if (LIBLZMA_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + +-find_package(LZ4 MODULE) +-set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) +-if (LZ4_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) ++find_package(lz4 MODULE) ++set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) ++if (lz4_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) + endif() + +-find_package(Zstd MODULE) +-set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) +-if(ZSTD_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) ++find_package(zstd MODULE) ++set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) ++if(zstd_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) + endif() + + find_package(Snappy MODULE) +@@ -101,11 +101,11 @@ if (SNAPPY_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) + endif() + +-find_package(LibDwarf) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) ++find_package(libdwarf) ++list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) + +-find_package(Libiberty) ++find_package(libiberty) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) + +@@ -113,9 +113,9 @@ find_package(LibAIO) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS}) + +-find_package(Libsodium) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) ++find_package(libsodium) ++list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) + + list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) +@@ -127,13 +127,13 @@ endif () + + set(FOLLY_USE_SYMBOLIZER OFF) + CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF_H) +-find_library(UNWIND_LIBRARIES NAMES unwind) +-if (UNWIND_LIBRARIES) +- list(APPEND FOLLY_LINK_LIBRARIES ${UNWIND_LIBRARIES}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${UNWIND_LIBRARIES}) ++find_library(libunwind_LIBRARIES NAMES libunwind) ++if (libunwind_LIBRARIES) ++ list(APPEND FOLLY_LINK_LIBRARIES ${libunwind_LIBRARIES}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${libunwind_LIBRARIES}) + endif() + check_function_exists(backtrace FOLLY_HAVE_BACKTRACE) +-if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND LIBDWARF_FOUND) ++if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND libdwarf_FOUND) + set(FOLLY_USE_SYMBOLIZER ON) + endif() + message(STATUS "Setting FOLLY_USE_SYMBOLIZER: ${FOLLY_USE_SYMBOLIZER}") diff --git a/recipes/folly/all/patches/0008-find-packages.patch b/recipes/folly/all/patches/0008-find-packages.patch index 3329a68425e3b..f8a3eacdcd1dd 100644 --- a/recipes/folly/all/patches/0008-find-packages.patch +++ b/recipes/folly/all/patches/0008-find-packages.patch @@ -1,73 +1,162 @@ diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 3169b972d52..23dc6d509b1 100644 +index 3169b972d..b503b9ba7 100644 --- a/CMake/folly-deps.cmake +++ b/CMake/folly-deps.cmake -@@ -46,11 +46,11 @@ find_package(Boost 1.51.0 MODULE +@@ -33,7 +33,7 @@ else() + endif() + set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}") + +-find_package(Boost 1.51.0 MODULE ++find_package(Boost + COMPONENTS + context + filesystem +@@ -46,33 +46,33 @@ find_package(Boost 1.51.0 MODULE list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) -find_package(DoubleConversion MODULE REQUIRED) -+find_package(double-conversion MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) - +-list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) +- -find_package(Gflags MODULE) -+find_package(gflags MODULE) - set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) - if(LIBGFLAGS_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -@@ -59,12 +59,12 @@ if(LIBGFLAGS_FOUND) - list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-if(LIBGFLAGS_FOUND) +- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) +- list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) ++find_package(double-conversion REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) ++ ++find_package(gflags REQUIRED) ++set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) ++if(gflags_FOUND) ++ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARIES}) ++ list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) endif() -find_package(Glog MODULE) -+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}) +-set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) +-list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) ++find_package(glog REQUIRED) ++set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) -find_package(LibEvent MODULE REQUIRED) -+find_package(Libevent MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) ++find_package(Libevent REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) + + find_package(OpenSSL MODULE REQUIRED) +-list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) +-list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) + check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) -@@ -96,14 +96,14 @@ if (LIBLZMA_FOUND) + find_package(ZLIB MODULE) +@@ -83,10 +83,10 @@ if (ZLIB_FOUND) + endif() + + find_package(BZip2 MODULE) +-set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) +-if (BZIP2_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) +- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) ++set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) ++if (BZip2_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) + endif() + + find_package(LibLZMA MODULE) +@@ -96,18 +96,18 @@ if (LIBLZMA_FOUND) list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() -find_package(LZ4 MODULE) +-set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) +-if (LZ4_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) +find_package(lz4 MODULE) - set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) - if (LZ4_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) - list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) ++set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) ++if (lz4_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) endif() -find_package(Zstd MODULE) +-set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) +-if(ZSTD_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) +find_package(zstd MODULE) - set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) - if(ZSTD_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) ++set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) ++if(zstd_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) + endif() + + find_package(Snappy MODULE) @@ -117,11 +117,11 @@ if (SNAPPY_FOUND) list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) endif() -find_package(LibDwarf) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) +find_package(libdwarf) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) ++list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) -find_package(Libiberty) +find_package(libiberty) list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) -@@ -133,7 +133,7 @@ find_package(LibUring) +@@ -133,9 +133,9 @@ find_package(LibUring) list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) -find_package(Libsodium) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) +find_package(libsodium) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) ++list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) + list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) +@@ -147,14 +147,14 @@ endif () + + set(FOLLY_USE_SYMBOLIZER OFF) + CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF_H) +-find_library(UNWIND_LIBRARIES NAMES unwind) +-if (UNWIND_LIBRARIES) +- list(APPEND FOLLY_LINK_LIBRARIES ${UNWIND_LIBRARIES}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${UNWIND_LIBRARIES}) ++find_library(libunwind_LIBRARIES NAMES libunwind) ++if (libunwind_LIBRARIES) ++ list(APPEND FOLLY_LINK_LIBRARIES ${libunwind_LIBRARIES}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${libunwind_LIBRARIES}) + endif() + find_package(Backtrace) + set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND}) +-if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND LIBDWARF_FOUND) ++if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND libdwarf_FOUND) + set(FOLLY_USE_SYMBOLIZER ON) + endif() + message(STATUS "Setting FOLLY_USE_SYMBOLIZER: ${FOLLY_USE_SYMBOLIZER}") diff --git a/recipes/folly/all/patches/0016-find-packages.patch b/recipes/folly/all/patches/0016-find-packages.patch index c6cd14fad52c9..9244b6e849247 100644 --- a/recipes/folly/all/patches/0016-find-packages.patch +++ b/recipes/folly/all/patches/0016-find-packages.patch @@ -1,16 +1,24 @@ diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 9c9d9ea60..e78611542 100644 +index 9c9d9ea60..a2692cb79 100644 --- a/CMake/folly-deps.cmake +++ b/CMake/folly-deps.cmake -@@ -48,25 +48,25 @@ find_package(Boost 1.51.0 MODULE +@@ -35,7 +35,7 @@ else() + endif() + set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}") + +-find_package(Boost 1.51.0 MODULE ++find_package(Boost + COMPONENTS + context + filesystem +@@ -48,27 +48,27 @@ find_package(Boost 1.51.0 MODULE list(APPEND FOLLY_LINK_LIBRARIES ${Boost_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS}) -find_package(DoubleConversion MODULE REQUIRED) -+find_package(double-conversion MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) - +-list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR}) +- -find_package(Gflags MODULE) -set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) -if(LIBGFLAGS_FOUND) @@ -18,63 +26,151 @@ index 9c9d9ea60..e78611542 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 MODULE) ++find_package(double-conversion REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) ++ ++find_package(gflags REQUIRED) +set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) +if(gflags_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIRS}) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) + set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) -+ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIRS}) ++ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIR}) endif() -find_package(Glog MODULE) -+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}) +-set(FOLLY_HAVE_LIBGLOG ${GLOG_FOUND}) +-list(APPEND FOLLY_LINK_LIBRARIES ${GLOG_LIBRARY}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${GLOG_INCLUDE_DIR}) ++find_package(glog REQUIRED) ++set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) -find_package(LibEvent MODULE REQUIRED) -+find_package(Libevent MODULE REQUIRED) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) ++find_package(Libevent REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) + + find_package(ZLIB MODULE) + set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND}) +@@ -79,22 +79,22 @@ if (ZLIB_FOUND) + endif() + + find_package(OpenSSL MODULE REQUIRED) +-list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) +-list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) + check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) +-list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) + if (ZLIB_FOUND) + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) + endif() -@@ -104,14 +104,14 @@ if (LIBLZMA_FOUND) + find_package(BZip2 MODULE) +-set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) +-if (BZIP2_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) +- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) ++set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) ++if (BZip2_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) + endif() + + find_package(LibLZMA MODULE) +@@ -104,18 +104,18 @@ if (LIBLZMA_FOUND) list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) endif() -find_package(LZ4 MODULE) +-set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) +-if (LZ4_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) +find_package(lz4 MODULE) - set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) - if (LZ4_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) - list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) ++set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) ++if (lz4_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) endif() -find_package(Zstd MODULE) +-set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) +-if(ZSTD_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) +find_package(zstd MODULE) - set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) - if(ZSTD_FOUND) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) ++set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) ++if(zstd_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) + endif() + + find_package(Snappy MODULE) @@ -125,11 +125,11 @@ if (SNAPPY_FOUND) list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) endif() -find_package(LibDwarf) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) +find_package(libdwarf) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) ++list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) -find_package(Libiberty) +find_package(libiberty) list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) -@@ -141,7 +141,7 @@ find_package(LibUring) +@@ -141,9 +141,9 @@ find_package(LibUring) list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) -find_package(Libsodium) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) +find_package(libsodium) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) ++list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) + + list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) +@@ -153,11 +153,11 @@ if (PYTHON_EXTENSIONS) + find_package(Cython 0.26 REQUIRED) + 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) ++find_package(Liblibunwind) ++list(APPEND FOLLY_LINK_LIBRARIES ${LIBlibunwind_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBlibunwind_INCLUDE_DIRS}) ++if (LIBlibunwind_FOUND) ++ set(FOLLY_HAVE_LIBlibunwind ON) + endif() + if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + list(APPEND FOLLY_LINK_LIBRARIES "execinfo") +@@ -173,7 +173,7 @@ CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF) + find_package(Backtrace) + + set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND}) +-set(FOLLY_HAVE_DWARF ${LIBDWARF_FOUND}) ++set(FOLLY_HAVE_DWARF ${libdwarf_FOUND}) + if (NOT WIN32 AND NOT APPLE) + set(FOLLY_USE_SYMBOLIZER ON) + endif() diff --git a/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch b/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch new file mode 100644 index 0000000000000..1e0942c2ea209 --- /dev/null +++ b/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch @@ -0,0 +1,42 @@ +diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake +index f8701b469..bc4b39b48 100644 +--- a/CMake/GenPkgConfig.cmake ++++ b/CMake/GenPkgConfig.cmake +@@ -92,7 +92,15 @@ function(gen_pkgconfig_vars) + + # Set the output variables + string(REPLACE ";" " " cflags "${cflags}") +- set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) + string(REPLACE ";" " " private_libs "${private_libs}") ++ ++ # Since CMake 3.18 FindThreads may include a generator expression requiring a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. ++ # Before CMake 3.19 there's no way to solve this in a general way, so we work around the specific case. See #1414 and CMake bug #21074. ++ if(CMAKE_VERSION VERSION_LESS 3.19) ++ string(REPLACE "" "" cflags "${cflags}") ++ endif() ++ ++ set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) ++ + set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE) + endfunction() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2de92981d..0c84fc218 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -414,10 +414,16 @@ configure_file( + ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen + @ONLY + ) ++# Specify target to allow resolving generator expressions requiring a target for CMake >=3.19. See #1414. ++if(CMAKE_VERSION VERSION_GREATER 3.18) ++ set(target_arg TARGET folly_deps) ++endif() ++ + file( + GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc + INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen ++ ${target_arg} + ) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc diff --git a/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch b/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch new file mode 100644 index 0000000000000..37ba661ef1f88 --- /dev/null +++ b/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch @@ -0,0 +1,42 @@ +diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake +index f8701b469..b2a1fb216 100644 +--- a/CMake/GenPkgConfig.cmake ++++ b/CMake/GenPkgConfig.cmake +@@ -92,7 +92,15 @@ function(gen_pkgconfig_vars) + + # Set the output variables + string(REPLACE ";" " " cflags "${cflags}") +- set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) + string(REPLACE ";" " " private_libs "${private_libs}") ++ ++ # Since CMake 3.18 FindThreads may include a generator expression requiring a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. ++ # Before CMake 3.19 there's no way to solve this in a general way, so we work around the specific case. See #1414 and CMake bug #21074. ++ if(CMAKE_VERSION VERSION_LESS 3.19) ++ string(REPLACE "" "" cflags "${cflags}") ++ endif() ++ ++ set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) ++ + set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE) + endfunction() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c57ba69fa..84265de91 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -442,10 +442,16 @@ configure_file( + ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen + @ONLY + ) ++# Specify target to allow resolving generator expressions requiring a target for CMake >=3.19. See #1414. ++if(CMAKE_VERSION VERSION_GREATER 3.18) ++ set(target_arg TARGET folly_deps) ++endif() ++ + file( + GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc + INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen ++ ${target_arg} + ) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc diff --git a/recipes/folly/all/patches/0025-find-packages.patch b/recipes/folly/all/patches/0025-find-packages.patch new file mode 100644 index 0000000000000..5cef9dd984ab0 --- /dev/null +++ b/recipes/folly/all/patches/0025-find-packages.patch @@ -0,0 +1,176 @@ +diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake +index 989259a87..3296754aa 100644 +--- a/CMake/folly-deps.cmake ++++ b/CMake/folly-deps.cmake +@@ -35,7 +35,7 @@ else() + endif() + set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}") + +-find_package(Boost 1.51.0 MODULE ++find_package(Boost + COMPONENTS + context + filesystem +@@ -48,27 +48,27 @@ find_package(Boost 1.51.0 MODULE + 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(Gflags MODULE) +-set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) +-if(LIBGFLAGS_FOUND) +- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) +- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) +- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) ++find_package(double-conversion REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) ++ ++find_package(gflags REQUIRED) ++set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) ++if(gflags_FOUND) ++ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) ++ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) ++ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIR}) + 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(glog REQUIRED) ++set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) ++list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) + +-find_package(LibEvent MODULE REQUIRED) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) ++find_package(Libevent REQUIRED) ++list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) + + find_package(ZLIB MODULE) + set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND}) +@@ -79,22 +79,22 @@ if (ZLIB_FOUND) + endif() + + find_package(OpenSSL 1.1.1 MODULE REQUIRED) +-list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) +-list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) ++list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) + check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) +-list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) +-list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) ++list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) ++list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) + if (ZLIB_FOUND) + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) + endif() + + find_package(BZip2 MODULE) +-set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) +-if (BZIP2_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) +- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) ++set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) ++if (BZip2_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) + endif() + + find_package(LibLZMA MODULE) +@@ -104,18 +104,18 @@ if (LIBLZMA_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) + endif() + +-find_package(LZ4 MODULE) +-set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) +-if (LZ4_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) ++find_package(lz4 MODULE) ++set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) ++if (lz4_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) + endif() + +-find_package(Zstd MODULE) +-set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) +-if(ZSTD_FOUND) +- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) +- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) ++find_package(zstd MODULE) ++set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) ++if(zstd_FOUND) ++ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) ++ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) + endif() + + find_package(Snappy MODULE) +@@ -125,11 +125,11 @@ if (SNAPPY_FOUND) + list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) + endif() + +-find_package(LibDwarf) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) ++find_package(libdwarf) ++list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) + +-find_package(Libiberty) ++find_package(libiberty) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) + +@@ -141,9 +141,9 @@ find_package(LibUring) + list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) + list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) + +-find_package(Libsodium) +-list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) +-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) ++find_package(libsodium) ++list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) + + list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) +@@ -153,11 +153,11 @@ if (PYTHON_EXTENSIONS) + find_package(Cython 0.26 REQUIRED) + 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) ++find_package(Liblibunwind) ++list(APPEND FOLLY_LINK_LIBRARIES ${LIBlibunwind_LIBRARIES}) ++list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBlibunwind_INCLUDE_DIRS}) ++if (LIBlibunwind_FOUND) ++ set(FOLLY_HAVE_LIBlibunwind ON) + endif() + if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + list(APPEND FOLLY_LINK_LIBRARIES "execinfo") +@@ -173,7 +173,7 @@ CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF) + find_package(Backtrace) + + set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND}) +-set(FOLLY_HAVE_DWARF ${LIBDWARF_FOUND}) ++set(FOLLY_HAVE_DWARF ${libdwarf_FOUND}) + if (NOT WIN32 AND NOT APPLE) + set(FOLLY_USE_SYMBOLIZER ON) + endif() diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 6a14a274c3fe9..8434098e36254 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,7 +1,9 @@ versions: - "2019.10.21.00": - folder: all - "2020.08.10.00": - folder: all - "2022.01.31.00": - folder: all + "2019.10.21.00": + folder: all + "2020.08.10.00": + folder: all + "2022.01.31.00": + folder: all + "2022.10.17.00": + folder: all From c08e8a530b70d79d5c52b7566a29fca8d3c70e7c Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Sun, 6 Nov 2022 17:00:12 +0800 Subject: [PATCH 002/109] attach shell script for convenience --- recipes/folly/all/conanfile.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 7687a0d2a5bb6..495e04126f5e5 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -294,3 +294,33 @@ def package_info(self): self.cpp_info.components["folly_exception_counter"].set_property("pkg_config_name", "libfolly_exception_counter") self.cpp_info.components["folly_exception_counter"].libs = ["folly_exception_counter"] self.cpp_info.components["folly_exception_counter"].requires = ["folly_exception_tracer"] + + + # Folly release every two weeks and it is hard to maintain cmake scripts. + # This script is used to fix CMake/folly-deps.cmake. + # I attach it here for convenience. All the 00xx-find-packages.patches are generated by this script + # ```shell + # sed -i 's/^find_package(Boost.*$/find_package(Boost /' CMake/folly-deps.cmake + # sed -i 's/DoubleConversion MODULE/double-conversion /ig' CMake/folly-deps.cmake + # sed -i 's/DOUBLE_CONVERSION/double-conversion/ig' CMake/folly-deps.cmake + # sed -i 's/^find_package(Gflags.*$/find_package(gflags REQUIRED)/g' CMake/folly-deps.cmake + # sed -i 's/LIBGFLAGS_FOUND/gflags_FOUND/g' CMake/folly-deps.cmake + # sed -i 's/[^_]LIBGFLAGS_LIBRARY/{gflags_LIBRARIES/' CMake/folly-deps.cmake + # sed -i 's/[^_]LIBGFLAGS_INCLUDE/{gflags_INCLUDE/' CMake/folly-deps.cmake + # sed -i 's/find_package(Glog MODULE)/find_package(glog REQUIRED)/g' CMake/folly-deps.cmake + # sed -i 's/GLOG_/glog_/g' CMake/folly-deps.cmake + # sed -i 's/find_package(LibEvent MODULE/find_package(Libevent /' CMake/folly-deps.cmake + # sed -i 's/LIBEVENT_/Libevent_/ig' CMake/folly-deps.cmake + # sed -i 's/OPENSSL_LIB/OpenSSL_LIB/g' CMake/folly-deps.cmake + # sed -i 's/OPENSSL_INCLUDE/OpenSSL_INCLUDE/g' CMake/folly-deps.cmake + # sed -i 's/BZIP2_/BZip2_/g' CMake/folly-deps.cmake + # sed -i 's/(LZ4/(lz4/g' CMake/folly-deps.cmake + # sed -i 's/LZ4_/lz4_/g' CMake/folly-deps.cmake + # sed -i 's/Zstd /zstd /g' CMake/folly-deps.cmake + # sed -i 's/ZSTD_/zstd_/g' CMake/folly-deps.cmake + # sed -i 's/(LibDwarf/(libdwarf/g' CMake/folly-deps.cmake + # sed -i 's/LIBDWARF_/libdwarf_/g' CMake/folly-deps.cmake + # sed -i 's/Libiberty/libiberty/g' CMake/folly-deps.cmake + # sed -i 's/Libsodium/libsodium/ig' CMake/folly-deps.cmake + # sed -i 's/UNWIND/libunwind/ig' CMake/folly-deps.cmake + # ``` From 452074843c04285dfbee00914b9cdee72048ac05 Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Sun, 6 Nov 2022 17:19:14 +0800 Subject: [PATCH 003/109] minor fix & fix lint warning --- recipes/folly/all/conandata.yml | 40 +++++++++++++++++++++++++++++++++ recipes/folly/all/conanfile.py | 2 +- recipes/folly/config.yml | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index ce075ac7795c3..4811ca5a3dd29 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -15,22 +15,40 @@ patches: "2019.10.21.00": - patch_file: "patches/0001-find-packages.patch" base_path: "source_subfolder" + patch_description: "fix folly-deps.cmake" + patch_type: "conan" - patch_file: "patches/0002-compiler-flags.patch" base_path: "source_subfolder" + patch_description: "fix compiler flags" + patch_type: "conan" - patch_file: "patches/0003-boost-shared-ptr.patch" base_path: "source_subfolder" + patch_description: "fix boost shared ptr" + patch_type: "conan" - patch_file: "patches/0004-disable-posix-names.patch" base_path: "source_subfolder" + patch_description: "disable posix names" + patch_type: "conan" - patch_file: "patches/0005-include-atomic.patch" base_path: "source_subfolder" + patch_description: "include atomic" + patch_type: "conan" - patch_file: "patches/0006-duplicate-hash.patch" base_path: "source_subfolder" + patch_description: "duplicate hash" + patch_type: "conan" - patch_file: "patches/0007-allow-builtins.patch" base_path: "source_subfolder" + patch_description: "allow builtins" + patch_type: "conan" - patch_file: "patches/0013-include-bit.patch" base_path: "source_subfolder" + patch_description: "include bit" + patch_type: "conan" - patch_file: "patches/0020-include-ssizet.patch" base_path: "source_subfolder" + patch_description: "include ssizet" + patch_type: "conan" - patch_file: "patches/0023-fix-cmake-generator-expr.patch" base_path: "source_subfolder" patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" @@ -38,18 +56,30 @@ patches: "2020.08.10.00": - patch_file: "patches/0008-find-packages.patch" base_path: "source_subfolder" + patch_description: "fix folly-deps.cmake" + patch_type: "conan" - patch_file: "patches/0009-ill-formed-atomic-copy.patch" base_path: "source_subfolder" - patch_file: "patches/0010-duplicate-hash.patch" base_path: "source_subfolder" + patch_description: "fix code" + patch_type: "conan" - patch_file: "patches/0011-disable-logger-example.patch" base_path: "source_subfolder" + patch_description: "exclude examples" + patch_type: "conan" - patch_file: "patches/0012-compiler-flags.patch" base_path: "source_subfolder" + patch_description: "fix flags" + patch_type: "conan" - patch_file: "patches/0014-find-librt.patch" base_path: "source_subfolder" + patch_description: "fix cmake" + patch_type: "conan" - patch_file: "patches/0015-benchmark-format-macros.patch" base_path: "source_subfolder" + patch_description: "fix code" + patch_type: "conan" - patch_file: "patches/0024-fix-cmake-generator-expr.patch" base_path: "source_subfolder" patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" @@ -57,14 +87,24 @@ patches: "2022.01.31.00": - patch_file: "patches/0016-find-packages.patch" base_path: "source_subfolder" + patch_description: "fix folly-deps.cmake" + patch_type: "conan" - patch_file: "patches/0017-compiler-flags.patch" base_path: "source_subfolder" + patch_description: "fix flags" + patch_type: "conan" - patch_file: "patches/0018-find-glog.patch" base_path: "source_subfolder" + patch_description: "fix cmake script" + patch_type: "conan" - patch_file: "patches/0019-exclude-example.patch" base_path: "source_subfolder" + patch_description: "exclude examples" + patch_type: "conan" - patch_file: "patches/0022-fix-windows-minmax.patch" base_path: "source_subfolder" + patch_description: "fix code" + patch_type: "conan" "2022.10.31.00": - patch_file: "patches/0017-compiler-flags.patch" base_path: "source_subfolder" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 495e04126f5e5..cf00bd2126cfb 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -176,7 +176,7 @@ def generate(self): cxx_std_flag = tools.cppstd_flag(self.settings) cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) tc.variables["CXX_STD"] = cxx_std_value - if is_msvc: + if is_msvc(self): tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False tc.variables["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 8434098e36254..808d079b0d928 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -5,5 +5,5 @@ versions: folder: all "2022.01.31.00": folder: all - "2022.10.17.00": + "2022.10.31.00": folder: all From b9a4880cc0cf5408ad31ba6965347b2bb789f1e0 Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Sun, 6 Nov 2022 23:01:05 +0800 Subject: [PATCH 004/109] backport latest fix for generator expr --- .../0023-fix-cmake-generator-expr.patch | 29 ++++++++------ .../0024-fix-cmake-generator-expr.patch | 38 +++++++++++++------ 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch b/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch index 1e0942c2ea209..158c67976aa8a 100644 --- a/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch +++ b/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch @@ -1,34 +1,41 @@ diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake -index f8701b469..bc4b39b48 100644 +index f8701b469..6b3628e62 100644 --- a/CMake/GenPkgConfig.cmake +++ b/CMake/GenPkgConfig.cmake -@@ -92,7 +92,15 @@ function(gen_pkgconfig_vars) +@@ -92,7 +92,19 @@ function(gen_pkgconfig_vars) # Set the output variables string(REPLACE ";" " " cflags "${cflags}") - set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) string(REPLACE ";" " " private_libs "${private_libs}") + -+ # Since CMake 3.18 FindThreads may include a generator expression requiring a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. -+ # Before CMake 3.19 there's no way to solve this in a general way, so we work around the specific case. See #1414 and CMake bug #21074. ++ # Since CMake 3.18 FindThreads may include a generator expression requiring ++ # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. ++ # Before CMake 3.19 there's no way to solve this in a general way, so we ++ # work around the specific case. See #1414 and CMake bug #21074. + if(CMAKE_VERSION VERSION_LESS 3.19) -+ string(REPLACE "" "" cflags "${cflags}") ++ string(REPLACE ++ "" "" ++ cflags "${cflags}" ++ ) + endif() -+ ++ + set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) -+ set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE) endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2de92981d..0c84fc218 100755 +index 2de92981d..329433edc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -414,10 +414,16 @@ configure_file( +@@ -414,10 +414,19 @@ configure_file( ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen @ONLY ) -+# Specify target to allow resolving generator expressions requiring a target for CMake >=3.19. See #1414. -+if(CMAKE_VERSION VERSION_GREATER 3.18) ++ ++# Specify target to allow resolving generator expressions requiring ++# a target for CMake >=3.19. See #1414. ++# VERSION_GREATER_EQUAL isn't available before CMake 3.7. ++if(NOT CMAKE_VERSION VERSION_LESS 3.19) + set(target_arg TARGET folly_deps) +endif() + diff --git a/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch b/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch index 37ba661ef1f88..193d42bffdec6 100644 --- a/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch +++ b/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch @@ -1,34 +1,41 @@ diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake -index f8701b469..b2a1fb216 100644 +index f8701b469..59a0c9f57 100644 --- a/CMake/GenPkgConfig.cmake +++ b/CMake/GenPkgConfig.cmake -@@ -92,7 +92,15 @@ function(gen_pkgconfig_vars) +@@ -92,7 +92,19 @@ function(gen_pkgconfig_vars) # Set the output variables string(REPLACE ";" " " cflags "${cflags}") - set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) string(REPLACE ";" " " private_libs "${private_libs}") + -+ # Since CMake 3.18 FindThreads may include a generator expression requiring a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. -+ # Before CMake 3.19 there's no way to solve this in a general way, so we work around the specific case. See #1414 and CMake bug #21074. ++ # Since CMake 3.18 FindThreads may include a generator expression requiring ++ # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. ++ # Before CMake 3.19 there's no way to solve this in a general way, so we ++ # work around the specific case. See #1414 and CMake bug #21074. + if(CMAKE_VERSION VERSION_LESS 3.19) -+ string(REPLACE "" "" cflags "${cflags}") ++ string(REPLACE ++ "" "" ++ cflags "${cflags}" ++ ) + endif() + + set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) -+ set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE) endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt -index c57ba69fa..84265de91 100755 +index c57ba69fa..5dd071bcf 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -442,10 +442,16 @@ configure_file( +@@ -442,17 +442,20 @@ configure_file( ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen @ONLY ) -+# Specify target to allow resolving generator expressions requiring a target for CMake >=3.19. See #1414. -+if(CMAKE_VERSION VERSION_GREATER 3.18) ++ ++# Specify target to allow resolving generator expressions requiring ++# a target for CMake >=3.19. See #1414. ++# VERSION_GREATER_EQUAL isn't available before CMake 3.7. ++if(NOT CMAKE_VERSION VERSION_LESS 3.19) + set(target_arg TARGET folly_deps) +endif() + @@ -38,5 +45,12 @@ index c57ba69fa..84265de91 100755 INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen + ${target_arg} ) - install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc +-install( +- FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc +- DESTINATION ${LIB_INSTALL_DIR}/pkgconfig +- COMPONENT dev +-) +- + option(BUILD_TESTS "If enabled, compile the tests." OFF) + option(BUILD_BROKEN_TESTS "If enabled, compile tests that are known to be broken." OFF) + option(BUILD_HANGING_TESTS "If enabled, compile tests that are known to hang." OFF) From 8de0b18a8f3c7872b603eb70f6a8491be518feb4 Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Mon, 7 Nov 2022 09:38:32 +0800 Subject: [PATCH 005/109] support conan-v1 cmake_find_package/cmake_find_package_multi generator --- recipes/folly/all/conandata.yml | 2 ++ recipes/folly/all/conanfile.py | 24 +++++++++++++++++++ recipes/folly/all/test_package/CMakeLists.txt | 3 +-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 4811ca5a3dd29..09b813f1a6c47 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -60,6 +60,8 @@ patches: patch_type: "conan" - patch_file: "patches/0009-ill-formed-atomic-copy.patch" base_path: "source_subfolder" + patch_description: "fix ill-formed-atomic" + patch_type: "conan" - patch_file: "patches/0010-duplicate-hash.patch" base_path: "source_subfolder" patch_description: "fix code" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index cf00bd2126cfb..4e979d2195a2b 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -265,10 +265,25 @@ def package_info(self): if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "folly" + self.cpp_info.filenames["cmake_find_package_multi"] = "folly" + self.cpp_info.names["cmake_find_package"] = "Folly" + self.cpp_info.names["cmake_find_package_multi"] = "Folly" + self.cpp_info.names["pkg_config"] = "libfolly" + self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" + self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" + self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") if Version(self.version) >= "2019.10.21.00": + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.components["follybenchmark"].names["cmake_find_package"] = "follybenchmark" + self.cpp_info.components["follybenchmark"].names["cmake_find_package_multi"] = "follybenchmark" + self.cpp_info.components["folly_test_util"].names["cmake_find_package"] = "folly_test_util" + self.cpp_info.components["folly_test_util"].names["cmake_find_package_multi"] = "folly_test_util" + self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] @@ -279,7 +294,16 @@ def package_info(self): self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] self.cpp_info.components["folly_test_util"].requires = ["libfolly"] + if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux": + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base" + self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package_multi"] = "folly_exception_tracer_base" + self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package"] = "folly_exception_tracer" + self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package_multi"] = "folly_exception_tracer" + self.cpp_info.components["folly_exception_counter"].names["cmake_find_package"] = "folly_exception_counter" + self.cpp_info.components["folly_exception_counter"].names["cmake_find_package_multi"] = "folly_exception_counter" + self.cpp_info.components["folly_exception_tracer_base"].set_property("cmake_target_name", "Folly::folly_exception_tracer_base") self.cpp_info.components["folly_exception_tracer_base"].set_property("pkg_config_name", "libfolly_exception_tracer_base") self.cpp_info.components["folly_exception_tracer_base"].libs = ["folly_exception_tracer_base"] diff --git a/recipes/folly/all/test_package/CMakeLists.txt b/recipes/folly/all/test_package/CMakeLists.txt index 6a9df4ea0b752..b7bb553f9aff6 100644 --- a/recipes/folly/all/test_package/CMakeLists.txt +++ b/recipes/folly/all/test_package/CMakeLists.txt @@ -5,8 +5,7 @@ find_package(folly REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} - Folly::folly - Folly::follybenchmark) + Folly::folly) if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") From 6032b67d3a7bab76acc605088f52de756b097d2d Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Mon, 7 Nov 2022 11:38:53 +0800 Subject: [PATCH 006/109] fix libunwind --- recipes/folly/all/conanfile.py | 3 ++- .../folly/all/patches/0016-find-packages.patch | 16 +++++++--------- .../folly/all/patches/0025-find-packages.patch | 16 +++++++--------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 4e979d2195a2b..37093f544e0ee 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -346,5 +346,6 @@ def package_info(self): # sed -i 's/LIBDWARF_/libdwarf_/g' CMake/folly-deps.cmake # sed -i 's/Libiberty/libiberty/g' CMake/folly-deps.cmake # sed -i 's/Libsodium/libsodium/ig' CMake/folly-deps.cmake - # sed -i 's/UNWIND/libunwind/ig' CMake/folly-deps.cmake + # sed -i 's/LibUnwind/libunwind/g' CMake/folly-deps.cmake + # sed -i 's/LibUnwind_/libunwind_/ig' CMake/folly-deps.cmake # ``` diff --git a/recipes/folly/all/patches/0016-find-packages.patch b/recipes/folly/all/patches/0016-find-packages.patch index 9244b6e849247..83485efa04107 100644 --- a/recipes/folly/all/patches/0016-find-packages.patch +++ b/recipes/folly/all/patches/0016-find-packages.patch @@ -1,5 +1,5 @@ diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 9c9d9ea60..a2692cb79 100644 +index 9c9d9ea60..05e439b48 100644 --- a/CMake/folly-deps.cmake +++ b/CMake/folly-deps.cmake @@ -35,7 +35,7 @@ else() @@ -148,7 +148,7 @@ index 9c9d9ea60..a2692cb79 100644 list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -@@ -153,11 +153,11 @@ if (PYTHON_EXTENSIONS) +@@ -153,10 +153,10 @@ if (PYTHON_EXTENSIONS) find_package(Cython 0.26 REQUIRED) endif () @@ -156,15 +156,13 @@ index 9c9d9ea60..a2692cb79 100644 -list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES}) -list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS}) -if (LIBUNWIND_FOUND) -- set(FOLLY_HAVE_LIBUNWIND ON) -+find_package(Liblibunwind) -+list(APPEND FOLLY_LINK_LIBRARIES ${LIBlibunwind_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBlibunwind_INCLUDE_DIRS}) -+if (LIBlibunwind_FOUND) -+ set(FOLLY_HAVE_LIBlibunwind ON) ++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) endif() if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - list(APPEND FOLLY_LINK_LIBRARIES "execinfo") @@ -173,7 +173,7 @@ CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF) find_package(Backtrace) diff --git a/recipes/folly/all/patches/0025-find-packages.patch b/recipes/folly/all/patches/0025-find-packages.patch index 5cef9dd984ab0..1f471ece7d995 100644 --- a/recipes/folly/all/patches/0025-find-packages.patch +++ b/recipes/folly/all/patches/0025-find-packages.patch @@ -1,5 +1,5 @@ diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 989259a87..3296754aa 100644 +index 989259a87..156d2d861 100644 --- a/CMake/folly-deps.cmake +++ b/CMake/folly-deps.cmake @@ -35,7 +35,7 @@ else() @@ -148,7 +148,7 @@ index 989259a87..3296754aa 100644 list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -@@ -153,11 +153,11 @@ if (PYTHON_EXTENSIONS) +@@ -153,10 +153,10 @@ if (PYTHON_EXTENSIONS) find_package(Cython 0.26 REQUIRED) endif () @@ -156,15 +156,13 @@ index 989259a87..3296754aa 100644 -list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES}) -list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS}) -if (LIBUNWIND_FOUND) -- set(FOLLY_HAVE_LIBUNWIND ON) -+find_package(Liblibunwind) -+list(APPEND FOLLY_LINK_LIBRARIES ${LIBlibunwind_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBlibunwind_INCLUDE_DIRS}) -+if (LIBlibunwind_FOUND) -+ set(FOLLY_HAVE_LIBlibunwind ON) ++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) endif() if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - list(APPEND FOLLY_LINK_LIBRARIES "execinfo") @@ -173,7 +173,7 @@ CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF) find_package(Backtrace) From 09aceb7fd0ee657800e73d0248e39313ed9a495e Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Mon, 7 Nov 2022 13:52:51 +0800 Subject: [PATCH 007/109] bugfix: enable CMP0077 --- recipes/folly/all/conanfile.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 37093f544e0ee..d4c6145542aad 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -60,14 +60,19 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": - del self.options.fPIC - + try: + del self.options.fPIC + except Exception: + pass if str(self.settings.arch) not in ['x86', 'x86_64']: del self.options.use_sse4_2 def configure(self): if self.options.shared: - del self.options.fPIC + try: + del self.options.fPIC + except Exception: + pass def requirements(self): self.requires("boost/1.78.0") @@ -121,7 +126,7 @@ def validate(self): if self.settings.os in ["Macos", "Windows"] and self.options.shared: raise ConanInvalidConfiguration("Folly could not be built on {} as shared library".format(self.settings.os)) - if Version(self.version) == "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: + if Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration("Folly could not be built by clang as a shared library") if self.options["boost"].header_only: @@ -172,6 +177,10 @@ def generate(self): tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + # Relocatable shared lib on Macos + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" cxx_std_flag = tools.cppstd_flag(self.settings) cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) From 8728fe05628828d3333f5b394a16f346df410def Mon Sep 17 00:00:00 2001 From: Xianda Ke Date: Thu, 10 Nov 2022 14:28:21 +0800 Subject: [PATCH 008/109] fix issues on windows --- recipes/folly/all/conandata.yml | 6 +++++- .../folly/all/patches/0026-fix-windows-minmax.patch | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 recipes/folly/all/patches/0026-fix-windows-minmax.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 09b813f1a6c47..30f6ae7c87bb8 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -105,7 +105,7 @@ patches: patch_type: "conan" - patch_file: "patches/0022-fix-windows-minmax.patch" base_path: "source_subfolder" - patch_description: "fix code" + patch_description: "fix cmake script on window" patch_type: "conan" "2022.10.31.00": - patch_file: "patches/0017-compiler-flags.patch" @@ -120,3 +120,7 @@ patches: base_path: "source_subfolder" patch_description: "fix cmake find_package" patch_type: "conan" + - patch_file: "patches/0026-fix-windows-minmax.patch" + base_path: "source_subfolder" + patch_description: "fix cmake script on window" + patch_type: "conan" diff --git a/recipes/folly/all/patches/0026-fix-windows-minmax.patch b/recipes/folly/all/patches/0026-fix-windows-minmax.patch new file mode 100644 index 0000000000000..24e4b9eac11bd --- /dev/null +++ b/recipes/folly/all/patches/0026-fix-windows-minmax.patch @@ -0,0 +1,12 @@ +diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake +index ad03039aa..1c76e0f00 100644 +--- a/CMake/FollyCompilerMSVC.cmake ++++ b/CMake/FollyCompilerMSVC.cmake +@@ -289,6 +289,7 @@ function(apply_folly_compile_options_to_target THETARGET) + # And the extra defines: + target_compile_definitions(${THETARGET} + PUBLIC ++ NOMINMAX + _CRT_NONSTDC_NO_WARNINGS # Don't deprecate posix names of functions. + _CRT_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. + _SCL_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. From 67934050b1f8886a18c734b80b44e485aa5558e6 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 4 Feb 2023 22:04:06 +0100 Subject: [PATCH 009/109] More modernize --- recipes/folly/all/CMakeLists.txt | 4 -- recipes/folly/all/conandata.yml | 27 -------- recipes/folly/all/conanfile.py | 107 +++++++++++++++---------------- 3 files changed, 50 insertions(+), 88 deletions(-) delete mode 100644 recipes/folly/all/CMakeLists.txt diff --git a/recipes/folly/all/CMakeLists.txt b/recipes/folly/all/CMakeLists.txt deleted file mode 100644 index 3f6a2fca74929..0000000000000 --- a/recipes/folly/all/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.1) -project(cmake_wrapper) - -add_subdirectory("source_subfolder") diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 30f6ae7c87bb8..bbc3d14e1f247 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -14,113 +14,86 @@ sources: patches: "2019.10.21.00": - patch_file: "patches/0001-find-packages.patch" - base_path: "source_subfolder" patch_description: "fix folly-deps.cmake" patch_type: "conan" - patch_file: "patches/0002-compiler-flags.patch" - base_path: "source_subfolder" patch_description: "fix compiler flags" patch_type: "conan" - patch_file: "patches/0003-boost-shared-ptr.patch" - base_path: "source_subfolder" patch_description: "fix boost shared ptr" patch_type: "conan" - patch_file: "patches/0004-disable-posix-names.patch" - base_path: "source_subfolder" patch_description: "disable posix names" patch_type: "conan" - patch_file: "patches/0005-include-atomic.patch" - base_path: "source_subfolder" patch_description: "include atomic" patch_type: "conan" - patch_file: "patches/0006-duplicate-hash.patch" - base_path: "source_subfolder" patch_description: "duplicate hash" patch_type: "conan" - patch_file: "patches/0007-allow-builtins.patch" - base_path: "source_subfolder" patch_description: "allow builtins" patch_type: "conan" - patch_file: "patches/0013-include-bit.patch" - base_path: "source_subfolder" patch_description: "include bit" patch_type: "conan" - patch_file: "patches/0020-include-ssizet.patch" - base_path: "source_subfolder" patch_description: "include ssizet" patch_type: "conan" - patch_file: "patches/0023-fix-cmake-generator-expr.patch" - base_path: "source_subfolder" patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" patch_type: "backport" "2020.08.10.00": - patch_file: "patches/0008-find-packages.patch" - base_path: "source_subfolder" patch_description: "fix folly-deps.cmake" patch_type: "conan" - patch_file: "patches/0009-ill-formed-atomic-copy.patch" - base_path: "source_subfolder" patch_description: "fix ill-formed-atomic" patch_type: "conan" - patch_file: "patches/0010-duplicate-hash.patch" - base_path: "source_subfolder" patch_description: "fix code" patch_type: "conan" - patch_file: "patches/0011-disable-logger-example.patch" - base_path: "source_subfolder" patch_description: "exclude examples" patch_type: "conan" - patch_file: "patches/0012-compiler-flags.patch" - base_path: "source_subfolder" patch_description: "fix flags" patch_type: "conan" - patch_file: "patches/0014-find-librt.patch" - base_path: "source_subfolder" patch_description: "fix cmake" patch_type: "conan" - patch_file: "patches/0015-benchmark-format-macros.patch" - base_path: "source_subfolder" patch_description: "fix code" patch_type: "conan" - patch_file: "patches/0024-fix-cmake-generator-expr.patch" - base_path: "source_subfolder" patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" patch_type: "backport" "2022.01.31.00": - patch_file: "patches/0016-find-packages.patch" - base_path: "source_subfolder" patch_description: "fix folly-deps.cmake" patch_type: "conan" - patch_file: "patches/0017-compiler-flags.patch" - base_path: "source_subfolder" patch_description: "fix flags" patch_type: "conan" - patch_file: "patches/0018-find-glog.patch" - base_path: "source_subfolder" patch_description: "fix cmake script" patch_type: "conan" - patch_file: "patches/0019-exclude-example.patch" - base_path: "source_subfolder" patch_description: "exclude examples" patch_type: "conan" - patch_file: "patches/0022-fix-windows-minmax.patch" - base_path: "source_subfolder" patch_description: "fix cmake script on window" patch_type: "conan" "2022.10.31.00": - patch_file: "patches/0017-compiler-flags.patch" - base_path: "source_subfolder" patch_description: "fix the hard-coded flag" patch_type: "conan" - patch_file: "patches/0019-exclude-example.patch" - base_path: "source_subfolder" patch_description: "exclude example" patch_type: "conan" - patch_file: "patches/0025-find-packages.patch" - base_path: "source_subfolder" patch_description: "fix cmake find_package" patch_type: "conan" - patch_file: "patches/0026-fix-windows-minmax.patch" - base_path: "source_subfolder" patch_description: "fix cmake script on window" patch_type: "conan" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index d4c6145542aad..9a987e6abceeb 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,14 +1,13 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.build import can_run,check_min_cppstd +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +from conan.tools.build import can_run, check_min_cppstd, default_cppstd from conan.tools.scm import Version -from conan.tools import files -from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.errors import ConanInvalidConfiguration -from conans import tools import os -required_conan_version = ">=1.45.0" +required_conan_version = ">=1.53.0" class FollyConan(ConanFile): @@ -23,30 +22,26 @@ class FollyConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "use_sse4_2" : [True, False], + "use_sse4_2": [True, False], } default_options = { "shared": False, "fPIC": True, - "use_sse4_2" : False + "use_sse4_2": False } @property - def _source_subfolder(self): - return "source_subfolder" - - @property - def _minimum_cpp_standard(self): + def _min_cppstd(self): return 17 if Version(self.version) >= "2022.01.31.00" else 14 @property - def _minimum_compilers_version(self): + def _compilers_minimum_version(self): return { "Visual Studio": "15", "gcc": "5", "clang": "6", "apple-clang": "8", - } if self._minimum_cpp_standard == 14 else { + } if self._min_cppstd == 14 else { "gcc": "7", "Visual Studio": "16", "clang": "6", @@ -54,25 +49,20 @@ def _minimum_compilers_version(self): } def export_sources(self): - self.copy("CMakeLists.txt") - for patch in self.conan_data.get("patches", {}).get(self.version, []): - self.copy(patch["patch_file"]) + export_conandata_patches(self) def config_options(self): if self.settings.os == "Windows": - try: - del self.options.fPIC - except Exception: - pass + del self.options.fPIC if str(self.settings.arch) not in ['x86', 'x86_64']: del self.options.use_sse4_2 def configure(self): if self.options.shared: - try: - del self.options.fPIC - except Exception: - pass + self.options.rm_safe("fPIC") + + def layout(self): + cmake_layout(self, src_folder="src") def requirements(self): self.requires("boost/1.78.0") @@ -94,10 +84,10 @@ def requirements(self): if self.settings.os == "Linux": self.requires("libiberty/9.1.0") self.requires("libunwind/1.5.0") - if Version(self.version) >= "2020.08.10.00" and Version(self.version) < "2022.01.31.00": + if "2020.08.10.00" <= Version(self.version) < "2022.01.31.00": self.requires("fmt/7.1.3") if Version(self.version) >= "2022.01.31.00": - self.requires("fmt/8.0.1") # Folly bumpup fmt to 8.0.1 in v2022.01.31.00 + self.requires("fmt/8.0.1") # Folly bump fmt to 8.0.1 in v2022.01.31.00 @property def _required_boost_components(self): @@ -105,14 +95,12 @@ def _required_boost_components(self): def validate(self): if self.settings.compiler.get_safe("cppstd"): - check_min_cppstd(self, self._minimum_cpp_standard) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) - else: - if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) + check_min_cppstd(self, self._min_cppstd) + minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) + if minimum_version and Version(self.settings.compiler.version) < minimum_version: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + ) if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") @@ -136,23 +124,22 @@ def validate(self): if miss_boost_required_comp: raise ConanInvalidConfiguration("Folly requires these boost components: {}".format(", ".join(self._required_boost_components))) - min_version = self._minimum_compilers_version.get(str(self.settings.compiler)) - if not min_version: - self.output.warn("{} recipe lacks information about the {} compiler support.".format(self.name, self.settings.compiler)) - else: - if Version(self.settings.compiler.version) < min_version: - raise ConanInvalidConfiguration("{} requires C++{} support. The current compiler {} {} does not support it.".format( - self.name, self._minimum_cpp_standard, self.settings.compiler, self.settings.compiler.version)) - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") def source(self): - files.get(self, **self.conan_data["sources"][self.version], destination=self._source_subfolder, strip_root=True) - - def layout(self): - cmake_layout(self) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + def _cxx_std_flag(self, cppstd): + cppstd_prefix_gnu, cppstd_value = (cppstd[:3], cppstd[3:]) if "gnu" in cppstd else ("", cppstd) + if not cppstd_prefix_gnu: + cppstd_prefix_gnu = "c" + if is_msvc(self): + cppstd_prefix_gnu = "" + if cppstd_value > "17": + cppstd_value = "latest" + cxx_std_value = f"{cppstd_prefix_gnu}++{cppstd_value}" + return cxx_std_value def generate(self): tc = CMakeToolchain(self) @@ -176,37 +163,44 @@ def generate(self): tc.variables["CMAKE_C_FLAGS"] = "/arch:FMA" tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" - tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - cxx_std_flag = tools.cppstd_flag(self.settings) - cxx_std_value = cxx_std_flag.split('=')[1] if cxx_std_flag else "c++{}".format(self._minimum_cpp_standard) - tc.variables["CXX_STD"] = cxx_std_value + current_cpp_std = self.settings.get_safe("compiler.cppstd", default_cppstd(self)) + cxx_std_value = self._cxx_std_flag(current_cpp_std) + + # 2019.10.21.00 -> either MSVC_ flags or CXX_STD if is_msvc(self): tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False tc.variables["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) + else: + tc.variables["CXX_STD"] = cxx_std_value tc.generate() deps = CMakeDeps(self) deps.generate() + def _patch_sources(self): + apply_conandata_patches(self) + folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") + replace_in_file(self, folly_deps, "MODULE", "") + def build(self): - files.apply_conandata_patches(self) + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() def package(self): - self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - files.rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) - files.rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) + rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): self.cpp_info.set_property("cmake_file_name", "folly") @@ -303,7 +297,6 @@ def package_info(self): self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] self.cpp_info.components["folly_test_util"].requires = ["libfolly"] - if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux": # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base" From 93842da064f5af4f163fcbc671029efa465d0d08 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 4 Feb 2023 22:27:33 +0100 Subject: [PATCH 010/109] Handle stdc++fs --- recipes/folly/all/conanfile.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 9a987e6abceeb..1298175129d66 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -268,6 +268,12 @@ def package_info(self): if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") + if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": + self.cpp_info.components["libfolly"].system_libs.append("stdc++fs") + + if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "9": + self.cpp_info.components["libfolly"].system_libs.append("stdc++fs" if self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] else "c++fs") + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.filenames["cmake_find_package"] = "folly" self.cpp_info.filenames["cmake_find_package_multi"] = "folly" From b4de0a1dd302e36a4aeee233e3c7d7db09e6404d Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 4 Feb 2023 22:27:50 +0100 Subject: [PATCH 011/109] Bump zlib to 1.2.13 --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 1298175129d66..5d4a39094fde1 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -74,7 +74,7 @@ def requirements(self): self.requires("openssl/1.1.1q") 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") From 8388be3e6203b2da8fb417efe5fce4b3b81ab0c5 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 5 Feb 2023 00:40:59 +0100 Subject: [PATCH 012/109] Handle case where compiler.cppstd is not provided, compiler minimal checks pass, but default_cppstd is lower than minimal_cppstd --- recipes/folly/all/conanfile.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 5d4a39094fde1..b2aad9dad5337 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -94,13 +94,31 @@ def _required_boost_components(self): return ["context", "filesystem", "program_options", "regex", "system", "thread"] def validate(self): - if self.settings.compiler.get_safe("cppstd"): + compiler_cppstd = self.settings.compiler.get_safe("cppstd") + if compiler_cppstd: check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) + if not compiler_cppstd: + def less_than(lhs, rhs): + def extract_cpp_version(_cppstd): + return str(_cppstd).replace("gnu", "") + + def add_millennium(_cppstd): + return "19%s" % _cppstd if _cppstd == "98" else "20%s" % _cppstd + + lhs = add_millennium(extract_cpp_version(lhs)) + rhs = add_millennium(extract_cpp_version(rhs)) + return lhs < rhs + cppstd = default_cppstd(self) + if less_than(cppstd, self._min_cppstd): + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, but your compiler defaults to C++{cppstd}." + f" Please provide -s compiler.cppstd={self._min_cppstd}." + ) if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") From 15f5ac223a8f56e276296431f612fed7692a6871 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 5 Feb 2023 01:36:01 +0100 Subject: [PATCH 013/109] Revert CMAKE_POSITION_INDEPENDENT_CODE removal --- recipes/folly/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index b2aad9dad5337..e3372f7647cf6 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -181,6 +181,7 @@ def generate(self): tc.variables["CMAKE_C_FLAGS"] = "/arch:FMA" tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" + tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) From a2dc51af1a6e85d939a922559ba9110a77bd9864 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 5 Feb 2023 20:59:12 +0100 Subject: [PATCH 014/109] Remove duplication in test_package --- .../folly/all/test_v1_package/CMakeLists.txt | 13 ++------- .../folly/all/test_v1_package/conanfile.py | 2 +- .../all/test_v1_package/test_package.cpp | 29 ------------------- 3 files changed, 3 insertions(+), 41 deletions(-) delete mode 100644 recipes/folly/all/test_v1_package/test_package.cpp diff --git a/recipes/folly/all/test_v1_package/CMakeLists.txt b/recipes/folly/all/test_v1_package/CMakeLists.txt index f8cc697ab67d2..c2866c350e271 100644 --- a/recipes/folly/all/test_v1_package/CMakeLists.txt +++ b/recipes/folly/all/test_v1_package/CMakeLists.txt @@ -4,14 +4,5 @@ project(test_package CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup(TARGETS) -find_package(folly CONFIG REQUIRED) - -add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} Folly::folly) - - -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() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package + ${CMAKE_CURRENT_BINARY_DIR}/test_package) diff --git a/recipes/folly/all/test_v1_package/conanfile.py b/recipes/folly/all/test_v1_package/conanfile.py index 8b8cfae4c1882..7ab5b10bfbe4b 100644 --- a/recipes/folly/all/test_v1_package/conanfile.py +++ b/recipes/folly/all/test_v1_package/conanfile.py @@ -15,4 +15,4 @@ def build(self): def test(self): if not tools.cross_building(self): bin_path = os.path.join("bin", "test_package") - self.run(command=bin_path, run_environment=True) + self.run(bin_path, run_environment=True) diff --git a/recipes/folly/all/test_v1_package/test_package.cpp b/recipes/folly/all/test_v1_package/test_package.cpp deleted file mode 100644 index cc522b8b0280d..0000000000000 --- a/recipes/folly/all/test_v1_package/test_package.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#if FOLLY_HAVE_ELF -#include -#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 promise; - folly::Future future = promise.getSemiFuture().via(&executor); - folly::Future unit = std::move(future).thenValue(print_uri); - promise.setValue("https://github.com/bincrafters"); - std::move(unit).get(); -#if FOLLY_HAVE_ELF - folly::symbolizer::ElfFile elffile; -#endif - return EXIT_SUCCESS; -} From 852e3aa37bdbcb17cf0b118aa6e113f830eea9aa Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 5 Feb 2023 21:33:26 +0100 Subject: [PATCH 015/109] Prefer official release artifacts --- recipes/folly/all/conandata.yml | 8 ++++---- recipes/folly/all/conanfile.py | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index bbc3d14e1f247..65747f56c2dd9 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -6,11 +6,11 @@ sources: url: "https://github.com/facebook/folly/archive/v2020.08.10.00.tar.gz" sha256: "e81140d04a4e89e3f848e528466a9b3d3ae37d7eeb9e65467fca50d70918eef6" "2022.01.31.00": - url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz" - sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c" + url: "https://github.com/facebook/folly/releases/download/v2022.01.31.00/folly-v2022.01.31.00.tar.gz" + sha256: "7b8d5dd2eb51757858247af0ad27af2e3e93823f84033a628722b01e06cd68a9" "2022.10.31.00": - url: "https://github.com/facebook/folly/archive/v2022.10.31.00.tar.gz" - sha256: "46389ab812d010bd03de531e9a18f985ced23737fc26480393720e730821f7be" + url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" + sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: "2019.10.21.00": - patch_file: "patches/0001-find-packages.patch" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index e3372f7647cf6..099e64e66850d 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, download, copy, rmdir, replace_in_file from conan.tools.build import can_run, check_min_cppstd, default_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout @@ -145,8 +145,11 @@ def add_millennium(_cppstd): if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") + def _preserve_tarball_root(self): + return Version(self.version) >= "2022.01.31.00" + def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=True) + get(self, **self.conan_data["sources"][self.version], strip_root=not self._preserve_tarball_root()) def _cxx_std_flag(self, cppstd): cppstd_prefix_gnu, cppstd_value = (cppstd[:3], cppstd[3:]) if "gnu" in cppstd else ("", cppstd) From ae19ea13717da506e4364b8ea33f65b62d0f9427 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 6 Feb 2023 00:21:11 +0100 Subject: [PATCH 016/109] Change patch_type of PR folly/pull/1433 from backport to portability --- recipes/folly/all/conandata.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 65747f56c2dd9..ca6842be25205 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -42,7 +42,8 @@ patches: patch_type: "conan" - patch_file: "patches/0023-fix-cmake-generator-expr.patch" patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" - patch_type: "backport" + patch_type: "portability" + patch_source: "https://github.com/facebook/folly/pull/1433" "2020.08.10.00": - patch_file: "patches/0008-find-packages.patch" patch_description: "fix folly-deps.cmake" @@ -67,7 +68,8 @@ patches: patch_type: "conan" - patch_file: "patches/0024-fix-cmake-generator-expr.patch" patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" - patch_type: "backport" + patch_type: "portability" + patch_source: "https://github.com/facebook/folly/pull/1433" "2022.01.31.00": - patch_file: "patches/0016-find-packages.patch" patch_description: "fix folly-deps.cmake" From 5fe2a6047e00698c30d7450d1799e09614f65674 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 6 Feb 2023 00:24:23 +0100 Subject: [PATCH 017/109] Bump libunwind requirement to 1.6.2 --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 099e64e66850d..04e70853b9a66 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -83,7 +83,7 @@ def requirements(self): # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") if self.settings.os == "Linux": self.requires("libiberty/9.1.0") - self.requires("libunwind/1.5.0") + self.requires("libunwind/1.6.2") if "2020.08.10.00" <= Version(self.version) < "2022.01.31.00": self.requires("fmt/7.1.3") if Version(self.version) >= "2022.01.31.00": From c1caee5cbb00122334823649f411359bdddb6d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Mon, 6 Feb 2023 09:27:13 +0100 Subject: [PATCH 018/109] Prune imports Co-authored-by: Chris Mc --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 04e70853b9a66..4384ef88202d3 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, download, copy, rmdir, replace_in_file +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file from conan.tools.build import can_run, check_min_cppstd, default_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout From 77b368027149577794a06e107edce890fd286dea Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 6 Feb 2023 19:26:15 +0100 Subject: [PATCH 019/109] Instead of invalidating configuration if default_cppstd is lower than min_cppstd, set min_cppstd if the compiler supports it --- recipes/folly/all/conanfile.py | 51 ++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 4384ef88202d3..4ee79bfec1e93 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file -from conan.tools.build import can_run, check_min_cppstd, default_cppstd +from conan.tools.build import can_run, check_min_cppstd, default_cppstd, supported_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -48,6 +48,19 @@ def _compilers_minimum_version(self): "apple-clang": "10", } + def _cppstd_less_than(self, cppstd, min_cppstd): + def less_than(lhs, rhs): + def extract_cpp_version(_cppstd): + return str(_cppstd).replace("gnu", "") + + def add_millennium(_cppstd): + return "19%s" % _cppstd if _cppstd == "98" else "20%s" % _cppstd + + lhs = add_millennium(extract_cpp_version(lhs)) + rhs = add_millennium(extract_cpp_version(rhs)) + return lhs < rhs + return less_than(cppstd, min_cppstd) + def export_sources(self): export_conandata_patches(self) @@ -102,23 +115,18 @@ def validate(self): raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if not compiler_cppstd: - def less_than(lhs, rhs): - def extract_cpp_version(_cppstd): - return str(_cppstd).replace("gnu", "") - - def add_millennium(_cppstd): - return "19%s" % _cppstd if _cppstd == "98" else "20%s" % _cppstd - - lhs = add_millennium(extract_cpp_version(lhs)) - rhs = add_millennium(extract_cpp_version(rhs)) - return lhs < rhs - cppstd = default_cppstd(self) - if less_than(cppstd, self._min_cppstd): - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, but your compiler defaults to C++{cppstd}." - f" Please provide -s compiler.cppstd={self._min_cppstd}." - ) + supported_cppstds = supported_cppstd(self) + if not supported_cppstds or str(self._min_cppstd) not in supported_cppstds: + raise ConanInvalidConfiguration( + f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." + f" Supported cppstds: {supported_cppstds}" + ) + + def_cppstd = default_cppstd(self) + if not compiler_cppstd and self._cppstd_less_than(def_cppstd, self._min_cppstd): + self.output.info(f"{self.requires} requires C++{self._min_cppstd}, '-s compiler.cppstd' is not provided" + f" and your compiler default C++ standard ({def_cppstd}) is too low." + f" Forcing {self._min_cppstd}.") if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") @@ -151,7 +159,7 @@ def _preserve_tarball_root(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=not self._preserve_tarball_root()) - def _cxx_std_flag(self, cppstd): + def _cppstd_flag_value(self, cppstd): cppstd_prefix_gnu, cppstd_value = (cppstd[:3], cppstd[3:]) if "gnu" in cppstd else ("", cppstd) if not cppstd_prefix_gnu: cppstd_prefix_gnu = "c" @@ -190,8 +198,9 @@ def generate(self): # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - current_cpp_std = self.settings.get_safe("compiler.cppstd", default_cppstd(self)) - cxx_std_value = self._cxx_std_flag(current_cpp_std) + def_cppstd = default_cppstd(self) + backup_cppstd = str(self._min_cppstd) if self._cppstd_less_than(def_cppstd, self._min_cppstd) else def_cppstd + cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", backup_cppstd)) # 2019.10.21.00 -> either MSVC_ flags or CXX_STD if is_msvc(self): From ee9a560a49d240dc19686c40e90137cd6525e682 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Thu, 16 Feb 2023 18:17:04 +0100 Subject: [PATCH 020/109] Bump required openssl to openssl/1.1.1s --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 4ee79bfec1e93..30042b24ac4d3 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -84,7 +84,7 @@ def requirements(self): 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/1.1.1s") self.requires("lz4/1.9.3") self.requires("snappy/1.1.9") self.requires("zlib/1.2.13") From 198cee958349cd1931dd0a5f66e16507758fdef5 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Thu, 16 Feb 2023 18:38:24 +0100 Subject: [PATCH 021/109] Remove default_cppstd checks and default to min_cppstd if user doesn't provide compiler.cppstd --- recipes/folly/all/conanfile.py | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 30042b24ac4d3..5d0e2ad2acdd1 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file -from conan.tools.build import can_run, check_min_cppstd, default_cppstd, supported_cppstd +from conan.tools.build import can_run, check_min_cppstd, supported_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -18,6 +18,7 @@ class FollyConan(ConanFile): homepage = "https://github.com/facebook/folly" license = "Apache-2.0" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -32,7 +33,7 @@ class FollyConan(ConanFile): @property def _min_cppstd(self): - return 17 if Version(self.version) >= "2022.01.31.00" else 14 + return "17" if Version(self.version) >= "2022.01.31.00" else "14" @property def _compilers_minimum_version(self): @@ -41,26 +42,13 @@ def _compilers_minimum_version(self): "gcc": "5", "clang": "6", "apple-clang": "8", - } if self._min_cppstd == 14 else { + } if self._min_cppstd == "14" else { "gcc": "7", "Visual Studio": "16", "clang": "6", "apple-clang": "10", } - def _cppstd_less_than(self, cppstd, min_cppstd): - def less_than(lhs, rhs): - def extract_cpp_version(_cppstd): - return str(_cppstd).replace("gnu", "") - - def add_millennium(_cppstd): - return "19%s" % _cppstd if _cppstd == "98" else "20%s" % _cppstd - - lhs = add_millennium(extract_cpp_version(lhs)) - rhs = add_millennium(extract_cpp_version(rhs)) - return lhs < rhs - return less_than(cppstd, min_cppstd) - def export_sources(self): export_conandata_patches(self) @@ -116,18 +104,12 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) supported_cppstds = supported_cppstd(self) - if not supported_cppstds or str(self._min_cppstd) not in supported_cppstds: + if supported_cppstds and self._min_cppstd not in supported_cppstds: raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." f" Supported cppstds: {supported_cppstds}" ) - def_cppstd = default_cppstd(self) - if not compiler_cppstd and self._cppstd_less_than(def_cppstd, self._min_cppstd): - self.output.info(f"{self.requires} requires C++{self._min_cppstd}, '-s compiler.cppstd' is not provided" - f" and your compiler default C++ standard ({def_cppstd}) is too low." - f" Forcing {self._min_cppstd}.") - if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") @@ -198,10 +180,7 @@ def generate(self): # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" - def_cppstd = default_cppstd(self) - backup_cppstd = str(self._min_cppstd) if self._cppstd_less_than(def_cppstd, self._min_cppstd) else def_cppstd - cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", backup_cppstd)) - + cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", self._min_cppstd)) # 2019.10.21.00 -> either MSVC_ flags or CXX_STD if is_msvc(self): tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value From 2b5004d9611035e54ce466772f87beb838e2312a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Wed, 22 Feb 2023 16:53:50 +0100 Subject: [PATCH 022/109] Apply suggestions from code review Co-authored-by: Chris Mc --- recipes/folly/all/conanfile.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 5d0e2ad2acdd1..82f66b465ec62 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import is_msvc, msvc_runtime_flag from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file -from conan.tools.build import can_run, check_min_cppstd, supported_cppstd +from conan.tools.build import can_run, check_min_cppstd from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os @@ -95,20 +95,13 @@ def _required_boost_components(self): return ["context", "filesystem", "program_options", "regex", "system", "thread"] def validate(self): - compiler_cppstd = self.settings.compiler.get_safe("cppstd") - if compiler_cppstd: + if self.settings.get_safe("compiler.cppstd"): check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration( f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - supported_cppstds = supported_cppstd(self) - if supported_cppstds and self._min_cppstd not in supported_cppstds: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." - f" Supported cppstds: {supported_cppstds}" - ) if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") @@ -174,6 +167,7 @@ def generate(self): tc.variables["CMAKE_C_FLAGS"] = "/arch:FMA" tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" + # Folly is not respecting this from the helper https://github.com/conan-io/conan-center-index/pull/15726/files#r1097068754 tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" From 2e059905166d801e5af5438c9ed4c89a7185b608 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 11 Mar 2023 22:28:33 +0100 Subject: [PATCH 023/109] Improve test_package --- recipes/folly/all/test_package/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/folly/all/test_package/CMakeLists.txt b/recipes/folly/all/test_package/CMakeLists.txt index b7bb553f9aff6..35424dcfd2230 100644 --- a/recipes/folly/all/test_package/CMakeLists.txt +++ b/recipes/folly/all/test_package/CMakeLists.txt @@ -4,8 +4,7 @@ project(test_package CXX) find_package(folly REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} - Folly::folly) +target_link_libraries(${PROJECT_NAME} PRIVATE Folly::folly) if (${FOLLY_VERSION} VERSION_LESS "2021.07.20.00") From 6e1f4238573063c4f86950304815befedad66ce7 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 12 Mar 2023 11:22:59 +0100 Subject: [PATCH 024/109] Add patch for missing limits include --- recipes/folly/all/conandata.yml | 6 ++++++ .../patches/0027-fix-numeric-limits-include.patch | 12 ++++++++++++ .../patches/0028-fix-numeric-limits-include.patch | 12 ++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 recipes/folly/all/patches/0027-fix-numeric-limits-include.patch create mode 100644 recipes/folly/all/patches/0028-fix-numeric-limits-include.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index ca6842be25205..da29c6ab5fa2f 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -44,6 +44,9 @@ patches: patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" patch_type: "portability" patch_source: "https://github.com/facebook/folly/pull/1433" + - patch_file: "patches/0027-fix-numeric-limits-include.patch" + patch_description: "include limits" + patch_type: "conan" "2020.08.10.00": - patch_file: "patches/0008-find-packages.patch" patch_description: "fix folly-deps.cmake" @@ -70,6 +73,9 @@ patches: patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" patch_type: "portability" patch_source: "https://github.com/facebook/folly/pull/1433" + - patch_file: "patches/0028-fix-numeric-limits-include.patch" + patch_description: "include limits" + patch_type: "conan" "2022.01.31.00": - patch_file: "patches/0016-find-packages.patch" patch_description: "fix folly-deps.cmake" diff --git a/recipes/folly/all/patches/0027-fix-numeric-limits-include.patch b/recipes/folly/all/patches/0027-fix-numeric-limits-include.patch new file mode 100644 index 0000000000000..ff932cde55885 --- /dev/null +++ b/recipes/folly/all/patches/0027-fix-numeric-limits-include.patch @@ -0,0 +1,12 @@ +diff --git a/folly/TimeoutQueue.cpp b/folly/TimeoutQueue.cpp +index 706715f71..5ea970679 100644 +--- a/folly/TimeoutQueue.cpp ++++ b/folly/TimeoutQueue.cpp +@@ -16,6 +16,7 @@ + + #include + #include ++#include + #include + + namespace folly { diff --git a/recipes/folly/all/patches/0028-fix-numeric-limits-include.patch b/recipes/folly/all/patches/0028-fix-numeric-limits-include.patch new file mode 100644 index 0000000000000..ff932cde55885 --- /dev/null +++ b/recipes/folly/all/patches/0028-fix-numeric-limits-include.patch @@ -0,0 +1,12 @@ +diff --git a/folly/TimeoutQueue.cpp b/folly/TimeoutQueue.cpp +index 706715f71..5ea970679 100644 +--- a/folly/TimeoutQueue.cpp ++++ b/folly/TimeoutQueue.cpp +@@ -16,6 +16,7 @@ + + #include + #include ++#include + #include + + namespace folly { From e7567121f7cc43c39c91cd3b78d8dfe6c9e1ac8d Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 12 Mar 2023 19:27:15 +0100 Subject: [PATCH 025/109] Set BOOST_LINK_STATIC Which in turn sets FOLLY_BOOST_LINK_STATIC, which ends up setting Boost_USE_STATIC_LIBS --- recipes/folly/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 82f66b465ec62..8ddc07c45a882 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -183,6 +183,9 @@ def generate(self): else: tc.variables["CXX_STD"] = cxx_std_value + if not self.dependencies["boost"].options.header_only: + tc.cache_variables["BOOST_LINK_STATIC"] = not self.dependencies["boost"].options.shared + tc.generate() deps = CMakeDeps(self) From bd04694c76873e239418510160355b0b379114a2 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 12 Mar 2023 19:29:14 +0100 Subject: [PATCH 026/109] Set policy CMP0074 --- recipes/folly/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 8ddc07c45a882..a45baff1164db 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -186,6 +186,7 @@ def generate(self): if not self.dependencies["boost"].options.header_only: tc.cache_variables["BOOST_LINK_STATIC"] = not self.dependencies["boost"].options.shared + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" # Honor Boost_ROOT set by boost recipe tc.generate() deps = CMakeDeps(self) From 28f98e165408886ceb305b678f8dd9ebd76d25ef Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 18 Mar 2023 18:36:17 +0100 Subject: [PATCH 027/109] Switch to f-strings --- recipes/folly/all/conanfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index a45baff1164db..8105cc6a76999 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -113,17 +113,18 @@ def validate(self): raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") if self.settings.os in ["Macos", "Windows"] and self.options.shared: - raise ConanInvalidConfiguration("Folly could not be built on {} as shared library".format(self.settings.os)) + raise ConanInvalidConfiguration(f"Folly could not be built on {self.settings.os} as shared library") if Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: - raise ConanInvalidConfiguration("Folly could not be built by clang as a shared library") + raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") if self.options["boost"].header_only: raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") - miss_boost_required_comp = any(getattr(self.options["boost"], "without_{}".format(boost_comp), True) for boost_comp in self._required_boost_components) + miss_boost_required_comp = any(getattr(self.options["boost"], f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) if miss_boost_required_comp: - raise ConanInvalidConfiguration("Folly requires these boost components: {}".format(", ".join(self._required_boost_components))) + required_components = ", ".join(self._required_boost_components) + raise ConanInvalidConfiguration(f"Folly requires these boost components: {required_components}") if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") From 4fcb38e740ae6b0c98132ac5a239bd9ca73fa1d9 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 18 Mar 2023 18:43:48 +0100 Subject: [PATCH 028/109] Make sure it uses cmake >= 3.13 --- recipes/folly/all/conanfile.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 8105cc6a76999..30d484615e990 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -129,6 +129,21 @@ def validate(self): if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") + def _cmake_new_enough(self, required_version): + try: + import re + from io import StringIO + output = StringIO() + self.run("cmake --version", output=output) + m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) + return Version(m.group(1)) >= required_version + except: + return False + + def build_requirements(self): + if not self._cmake_new_enough("3.13"): # Make sure CMP0077 is honored + self.tool_requires("cmake/3.25.3") + def _preserve_tarball_root(self): return Version(self.version) >= "2022.01.31.00" @@ -172,6 +187,8 @@ def generate(self): tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + # Honor CMAKE_REQUIRED_LIBRARIES in check_include_file_xxx + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0075"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" From d114b2f4c39111137ed586af670744b8233f1ed4 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 3 Apr 2023 18:35:25 +0200 Subject: [PATCH 029/109] Folly 2022.01.31 & 2022.10.31 build on Macos armv8 --- recipes/folly/all/conanfile.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 30d484615e990..ab3b6c6880669 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -106,9 +106,6 @@ def validate(self): if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") - if self.settings.os == "Macos" and self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") - if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") From 03e81baaa08e5098be64dd66c85660951c06493f Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 3 Apr 2023 18:39:05 +0200 Subject: [PATCH 030/109] Disable windows --- recipes/folly/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index ab3b6c6880669..724bc2fa27f17 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -112,6 +112,9 @@ def validate(self): if self.settings.os in ["Macos", "Windows"] and self.options.shared: raise ConanInvalidConfiguration(f"Folly could not be built on {self.settings.os} as shared library") + if self.settings.os == "Windows": + raise ConanInvalidConfiguration(f"{self.ref} could not be built on {self.settings.os}. PR's are welcome.") + if Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") From be25a385c66a22eb950f6cef3d3aa87aa0dd5bc0 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 3 Apr 2023 22:04:52 +0200 Subject: [PATCH 031/109] Revert "Folly 2022.01.31 & 2022.10.31 build on Macos armv8" This reverts commit 0f3fffe5f1b280b09c9652b00217645a0222533e. --- recipes/folly/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 724bc2fa27f17..82c80e9ff4844 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -106,6 +106,9 @@ def validate(self): if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") + if self.settings.os == "Macos" and self.settings.arch != "x86_64": + raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") + if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") From 4a0ef079b73ca497c4cf14905718fbc0d80bf98e Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Tue, 4 Apr 2023 12:08:27 +0200 Subject: [PATCH 032/109] Fix conan2 version conflicts and provide trasitive_headers trait --- recipes/folly/all/conanfile.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 82c80e9ff4844..f286467bc56f9 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -66,29 +66,29 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0") + self.requires("boost/1.78.0", transitive_headers=True) 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.1s") + self.requires("double-conversion/3.2.0", transitive_headers=True) + self.requires("gflags/2.2.2", transitive_headers=True) + self.requires("glog/0.4.0", transitive_headers=True) + self.requires("libevent/2.1.12", transitive_headers=True) + self.requires("openssl/1.1.1t", transitive_headers=True) self.requires("lz4/1.9.3") self.requires("snappy/1.1.9") - self.requires("zlib/1.2.13") - self.requires("zstd/1.5.2") + self.requires("zlib/1.2.13", transitive_headers=True) + self.requires("zstd/1.5.2", transitive_headers=True) if not is_msvc(self): self.requires("libdwarf/20191104") self.requires("libsodium/1.0.18") - self.requires("xz_utils/5.2.5") + self.requires("xz_utils/5.4.0") # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") if self.settings.os == "Linux": self.requires("libiberty/9.1.0") - self.requires("libunwind/1.6.2") + self.requires("libunwind/1.6.2", transitive_headers=True) if "2020.08.10.00" <= Version(self.version) < "2022.01.31.00": - self.requires("fmt/7.1.3") + self.requires("fmt/7.1.3", transitive_headers=True) if Version(self.version) >= "2022.01.31.00": - self.requires("fmt/8.0.1") # Folly bump fmt to 8.0.1 in v2022.01.31.00 + self.requires("fmt/8.0.1", transitive_headers=True) # Folly bump fmt to 8.0.1 in v2022.01.31.00 @property def _required_boost_components(self): @@ -121,10 +121,11 @@ def validate(self): if Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") - if self.options["boost"].header_only: + boost = self.dependencies["boost"] + if boost.options.header_only: raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") - miss_boost_required_comp = any(getattr(self.options["boost"], f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) + miss_boost_required_comp = any(getattr(boost.options, f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) if miss_boost_required_comp: required_components = ", ".join(self._required_boost_components) raise ConanInvalidConfiguration(f"Folly requires these boost components: {required_components}") From 3cd57bbbafc8d0dcaa7d9c70b47e7859a82d6210 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Tue, 4 Apr 2023 16:50:38 +0200 Subject: [PATCH 033/109] Bump double-conversion to 3.2.1 --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index f286467bc56f9..4de8a9a51278e 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -68,7 +68,7 @@ def layout(self): def requirements(self): self.requires("boost/1.78.0", transitive_headers=True) self.requires("bzip2/1.0.8") - self.requires("double-conversion/3.2.0", transitive_headers=True) + self.requires("double-conversion/3.2.1", transitive_headers=True) self.requires("gflags/2.2.2", transitive_headers=True) self.requires("glog/0.4.0", transitive_headers=True) self.requires("libevent/2.1.12", transitive_headers=True) From 441fcbb1a9a42b77d5e275db8701eeecc584cca2 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 4 Jun 2023 13:38:56 +0200 Subject: [PATCH 034/109] Remove cmake_new_enough --- recipes/folly/all/conanfile.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 4de8a9a51278e..b3fc77d254b4a 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -133,20 +133,8 @@ def validate(self): if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output=output) - m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False - def build_requirements(self): - if not self._cmake_new_enough("3.13"): # Make sure CMP0077 is honored - self.tool_requires("cmake/3.25.3") + pass def _preserve_tarball_root(self): return Version(self.version) >= "2022.01.31.00" From a31fbd859e6a8524b296293a6d3ad0aef3672ed2 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 4 Jun 2023 17:49:10 +0200 Subject: [PATCH 035/109] Remove folly/2019.10.21.00 --- recipes/folly/all/conandata.yml | 38 ----- recipes/folly/all/conanfile.py | 62 +++---- .../all/patches/0001-find-packages.patch | 157 ------------------ .../all/patches/0002-compiler-flags.patch | 24 --- .../all/patches/0003-boost-shared-ptr.patch | 24 --- .../patches/0004-disable-posix-names.patch | 27 --- .../all/patches/0005-include-atomic.patch | 12 -- .../all/patches/0006-duplicate-hash.patch | 13 -- .../all/patches/0007-allow-builtins.patch | 128 -------------- .../folly/all/patches/0013-include-bit.patch | 13 -- .../all/patches/0020-include-ssizet.patch | 12 -- .../0023-fix-cmake-generator-expr.patch | 49 ------ .../0027-fix-numeric-limits-include.patch | 12 -- 13 files changed, 27 insertions(+), 544 deletions(-) delete mode 100644 recipes/folly/all/patches/0001-find-packages.patch delete mode 100644 recipes/folly/all/patches/0002-compiler-flags.patch delete mode 100644 recipes/folly/all/patches/0003-boost-shared-ptr.patch delete mode 100644 recipes/folly/all/patches/0004-disable-posix-names.patch delete mode 100644 recipes/folly/all/patches/0005-include-atomic.patch delete mode 100644 recipes/folly/all/patches/0006-duplicate-hash.patch delete mode 100644 recipes/folly/all/patches/0007-allow-builtins.patch delete mode 100644 recipes/folly/all/patches/0013-include-bit.patch delete mode 100644 recipes/folly/all/patches/0020-include-ssizet.patch delete mode 100644 recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch delete mode 100644 recipes/folly/all/patches/0027-fix-numeric-limits-include.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index da29c6ab5fa2f..107316b0c2c76 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,7 +1,4 @@ sources: - "2019.10.21.00": - url: "https://github.com/facebook/folly/archive/v2019.10.21.00.tar.gz" - sha256: "6efcc2b2090691a9fe3d339c433d102d6399bbdc6dc4893080d59f15f648f393" "2020.08.10.00": url: "https://github.com/facebook/folly/archive/v2020.08.10.00.tar.gz" sha256: "e81140d04a4e89e3f848e528466a9b3d3ae37d7eeb9e65467fca50d70918eef6" @@ -12,41 +9,6 @@ sources: url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: - "2019.10.21.00": - - patch_file: "patches/0001-find-packages.patch" - patch_description: "fix folly-deps.cmake" - patch_type: "conan" - - patch_file: "patches/0002-compiler-flags.patch" - patch_description: "fix compiler flags" - patch_type: "conan" - - patch_file: "patches/0003-boost-shared-ptr.patch" - patch_description: "fix boost shared ptr" - patch_type: "conan" - - patch_file: "patches/0004-disable-posix-names.patch" - patch_description: "disable posix names" - patch_type: "conan" - - patch_file: "patches/0005-include-atomic.patch" - patch_description: "include atomic" - patch_type: "conan" - - patch_file: "patches/0006-duplicate-hash.patch" - patch_description: "duplicate hash" - patch_type: "conan" - - patch_file: "patches/0007-allow-builtins.patch" - patch_description: "allow builtins" - patch_type: "conan" - - patch_file: "patches/0013-include-bit.patch" - patch_description: "include bit" - patch_type: "conan" - - patch_file: "patches/0020-include-ssizet.patch" - patch_description: "include ssizet" - patch_type: "conan" - - patch_file: "patches/0023-fix-cmake-generator-expr.patch" - patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" - patch_type: "portability" - patch_source: "https://github.com/facebook/folly/pull/1433" - - patch_file: "patches/0027-fix-numeric-limits-include.patch" - patch_description: "include limits" - patch_type: "conan" "2020.08.10.00": - patch_file: "patches/0008-find-packages.patch" patch_description: "fix folly-deps.cmake" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index b3fc77d254b4a..118286c658426 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -225,28 +225,21 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "Folly::folly") self.cpp_info.set_property("pkg_config_name", "libfolly") - if Version(self.version) == "2019.10.21.00": + if self.settings.os == "Linux": self.cpp_info.components["libfolly"].libs = [ + "folly_exception_counter", + "folly_exception_tracer", + "folly_exception_tracer_base", + "folly_test_util", "follybenchmark", + "folly" + ] + else: + self.cpp_info.components["libfolly"].libs = [ "folly_test_util", + "follybenchmark", "folly" ] - elif Version(self.version) >= "2020.08.10.00": - if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].libs = [ - "folly_exception_counter", - "folly_exception_tracer", - "folly_exception_tracer_base", - "folly_test_util", - "follybenchmark", - "folly" - ] - else: - self.cpp_info.components["libfolly"].libs = [ - "folly_test_util", - "follybenchmark", - "folly" - ] self.cpp_info.components["libfolly"].requires = [ "boost::context", "boost::filesystem", "boost::program_options", "boost::regex", "boost::system", "boost::thread", @@ -304,24 +297,23 @@ def package_info(self): self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") - if Version(self.version) >= "2019.10.21.00": - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.components["follybenchmark"].names["cmake_find_package"] = "follybenchmark" - self.cpp_info.components["follybenchmark"].names["cmake_find_package_multi"] = "follybenchmark" - self.cpp_info.components["folly_test_util"].names["cmake_find_package"] = "folly_test_util" - self.cpp_info.components["folly_test_util"].names["cmake_find_package_multi"] = "folly_test_util" - - self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") - self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") - self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] - self.cpp_info.components["follybenchmark"].requires = ["libfolly"] - - self.cpp_info.components["folly_test_util"].set_property("cmake_target_name", "Folly::folly_test_util") - self.cpp_info.components["folly_test_util"].set_property("pkg_config_name", "libfolly_test_util") - self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] - self.cpp_info.components["folly_test_util"].requires = ["libfolly"] - - if Version(self.version) >= "2020.08.10.00" and self.settings.os == "Linux": + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.components["follybenchmark"].names["cmake_find_package"] = "follybenchmark" + self.cpp_info.components["follybenchmark"].names["cmake_find_package_multi"] = "follybenchmark" + self.cpp_info.components["folly_test_util"].names["cmake_find_package"] = "folly_test_util" + self.cpp_info.components["folly_test_util"].names["cmake_find_package_multi"] = "folly_test_util" + + self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") + self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") + self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] + self.cpp_info.components["follybenchmark"].requires = ["libfolly"] + + self.cpp_info.components["folly_test_util"].set_property("cmake_target_name", "Folly::folly_test_util") + self.cpp_info.components["folly_test_util"].set_property("pkg_config_name", "libfolly_test_util") + self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] + self.cpp_info.components["folly_test_util"].requires = ["libfolly"] + + if self.settings.os == "Linux": # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base" self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package_multi"] = "folly_exception_tracer_base" diff --git a/recipes/folly/all/patches/0001-find-packages.patch b/recipes/folly/all/patches/0001-find-packages.patch deleted file mode 100644 index 395feace9a683..0000000000000 --- a/recipes/folly/all/patches/0001-find-packages.patch +++ /dev/null @@ -1,157 +0,0 @@ -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 048e1cdf6..f6fac30d3 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -19,7 +19,7 @@ include(CheckFunctionExists) - if(MSVC) - set(Boost_USE_STATIC_LIBS ON) #Force static lib in msvc - endif(MSVC) --find_package(Boost 1.51.0 MODULE -+find_package(Boost - COMPONENTS - context - filesystem -@@ -32,31 +32,31 @@ find_package(Boost 1.51.0 MODULE - 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 REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) - --find_package(Gflags MODULE) --set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) --list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) --list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) -+find_package(gflags REQUIRED) -+set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARIES}) -+list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) - --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(glog REQUIRED) -+set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) -+find_package(Libevent REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) - - find_package(OpenSSL MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) --list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) - check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) - - find_package(ZLIB MODULE) -@@ -67,10 +67,10 @@ if (ZLIB_FOUND) - endif() - - find_package(BZip2 MODULE) --set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) --if (BZIP2_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) -- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) -+set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) -+if (BZip2_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) - endif() - - find_package(LibLZMA MODULE) -@@ -80,18 +80,18 @@ if (LIBLZMA_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) - endif() - --find_package(LZ4 MODULE) --set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) --if (LZ4_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) -+find_package(lz4 MODULE) -+set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) -+if (lz4_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) - endif() - --find_package(Zstd MODULE) --set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) --if(ZSTD_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) -+find_package(zstd MODULE) -+set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) -+if(zstd_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) - endif() - - find_package(Snappy MODULE) -@@ -101,11 +101,11 @@ if (SNAPPY_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) - endif() - --find_package(LibDwarf) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) -+find_package(libdwarf) -+list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) - --find_package(Libiberty) -+find_package(libiberty) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) - -@@ -113,9 +113,9 @@ find_package(LibAIO) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS}) - --find_package(Libsodium) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) -+find_package(libsodium) -+list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) - - list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -@@ -127,13 +127,13 @@ endif () - - set(FOLLY_USE_SYMBOLIZER OFF) - CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF_H) --find_library(UNWIND_LIBRARIES NAMES unwind) --if (UNWIND_LIBRARIES) -- list(APPEND FOLLY_LINK_LIBRARIES ${UNWIND_LIBRARIES}) -- list(APPEND CMAKE_REQUIRED_LIBRARIES ${UNWIND_LIBRARIES}) -+find_library(libunwind_LIBRARIES NAMES libunwind) -+if (libunwind_LIBRARIES) -+ list(APPEND FOLLY_LINK_LIBRARIES ${libunwind_LIBRARIES}) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${libunwind_LIBRARIES}) - endif() - check_function_exists(backtrace FOLLY_HAVE_BACKTRACE) --if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND LIBDWARF_FOUND) -+if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND libdwarf_FOUND) - set(FOLLY_USE_SYMBOLIZER ON) - endif() - message(STATUS "Setting FOLLY_USE_SYMBOLIZER: ${FOLLY_USE_SYMBOLIZER}") diff --git a/recipes/folly/all/patches/0002-compiler-flags.patch b/recipes/folly/all/patches/0002-compiler-flags.patch deleted file mode 100644 index b9213ff6d4895..0000000000000 --- a/recipes/folly/all/patches/0002-compiler-flags.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake -index 7fba75f..019d30f 100644 ---- a/CMake/FollyCompilerUnix.cmake -+++ b/CMake/FollyCompilerUnix.cmake -@@ -28,9 +28,9 @@ set( - ) - mark_as_advanced(CXX_STD) - --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}") - - # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") -@@ -44,7 +44,6 @@ function(apply_folly_compile_options_to_target THETARGET) - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -std=${CXX_STD} - -finput-charset=UTF-8 - -fsigned-char diff --git a/recipes/folly/all/patches/0003-boost-shared-ptr.patch b/recipes/folly/all/patches/0003-boost-shared-ptr.patch deleted file mode 100644 index 7608d6b2e9e2b..0000000000000 --- a/recipes/folly/all/patches/0003-boost-shared-ptr.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp -index f8cd6d4..0908668 100644 ---- a/folly/portability/PThread.cpp -+++ b/folly/portability/PThread.cpp -@@ -18,7 +18,9 @@ - - #if !FOLLY_HAVE_PTHREAD && defined(_WIN32) - #include // @manual -- -+#include -+#include -+#include - #include - - #include -@@ -683,7 +685,7 @@ int pthread_setspecific(pthread_key_t key, const void* value) { - // function, which we don't want to do. - boost::detail::set_tss_data( - realKey, -- boost::shared_ptr(), -+ 0,0, - const_cast(value), - false); - return 0; diff --git a/recipes/folly/all/patches/0004-disable-posix-names.patch b/recipes/folly/all/patches/0004-disable-posix-names.patch deleted file mode 100644 index 9efd4e24140e1..0000000000000 --- a/recipes/folly/all/patches/0004-disable-posix-names.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/folly/portability/Windows.h b/folly/portability/Windows.h -index f7990ca..b22fac5 100644 ---- a/folly/portability/Windows.h -+++ b/folly/portability/Windows.h -@@ -26,16 +26,12 @@ - // These have to be this way because we define our own versions - // of close(), because the normal Windows versions don't handle - // sockets at all. --#ifndef __STDC__ --/* nolint */ --#define __STDC__ 1 --#include // @manual nolint --#include // @manual nolint --#undef __STDC__ --#else --#include // @manual nolint --#include // @manual nolint --#endif -+#include -+#pragma push_macro("_CRT_INTERNAL_NONSTDC_NAMES") -+#define _CRT_INTERNAL_NONSTDC_NAMES 0 -+#include -+#include -+#pragma pop_macro("_CRT_INTERNAL_NONSTDC_NAMES") - - #if defined(min) || defined(max) - #error Windows.h needs to be included by this header, or else NOMINMAX needs \ diff --git a/recipes/folly/all/patches/0005-include-atomic.patch b/recipes/folly/all/patches/0005-include-atomic.patch deleted file mode 100644 index 0eb9382e49a9d..0000000000000 --- a/recipes/folly/all/patches/0005-include-atomic.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/portability/PThread.cpp b/folly/portability/PThread.cpp -index 2891c4c..7c98975 100644 ---- a/folly/portability/PThread.cpp -+++ b/folly/portability/PThread.cpp -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include - #include diff --git a/recipes/folly/all/patches/0006-duplicate-hash.patch b/recipes/folly/all/patches/0006-duplicate-hash.patch deleted file mode 100644 index f8905d003157e..0000000000000 --- a/recipes/folly/all/patches/0006-duplicate-hash.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h -index 33fa553..4266cf1 100644 ---- a/folly/hash/Hash.h -+++ b/folly/hash/Hash.h -@@ -730,7 +730,7 @@ struct TupleHasher<0, Ts...> { - - // Custom hash functions. - namespace std { --#if FOLLY_SUPPLY_MISSING_INT128_TRAITS -+#if 0 - template <> - struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; - diff --git a/recipes/folly/all/patches/0007-allow-builtins.patch b/recipes/folly/all/patches/0007-allow-builtins.patch deleted file mode 100644 index de09722f02acc..0000000000000 --- a/recipes/folly/all/patches/0007-allow-builtins.patch +++ /dev/null @@ -1,128 +0,0 @@ -diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index 971cb8819..e68de4456 100644 ---- a/folly/portability/Builtins.h -+++ b/folly/portability/Builtins.h -@@ -41,7 +41,6 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { - } - } - --#if !defined(_MSC_VER) || (_MSC_VER < 1923) - FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { - unsigned long index; - return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); -@@ -93,7 +92,6 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { - return int(_BitScanForward64(&index, x) ? index : 64); - } - #endif --#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) - - FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { - unsigned long index; -@@ -119,15 +117,12 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { - return int(__popcnt(x)); - } - --#if !defined(_MSC_VER) || (_MSC_VER < 1923) - FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { - static_assert(sizeof(x) == 4, ""); - return int(__popcnt(x)); - } --#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) - #endif - --#if !defined(_MSC_VER) || (_MSC_VER < 1923) - #if defined(_M_IX86) - FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt((unsigned int)(x >> 32))) + -@@ -138,7 +133,6 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt64(x)); - } - #endif --#endif // !defined(_MSC_VER) || (_MSC_VER < 1923) - - FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { - // I really hope frame is zero... --- - -diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index e68de4456..30caf4003 100644 ---- a/folly/portability/Builtins.h -+++ b/folly/portability/Builtins.h -@@ -16,7 +16,7 @@ - - #pragma once - --#if defined(_WIN32) && !defined(__clang__) -+#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__clang__) - #include - #include - #include --- -see https://github.com/facebook/folly/issues/1412 -diff --git a/folly/portability/Builtins.h b/folly/portability/Builtins.h -index 30caf4003..e8ef97266 100644 ---- a/folly/portability/Builtins.h -+++ b/folly/portability/Builtins.h -@@ -22,6 +22,14 @@ - #include - #include - -+// MSVC had added support for __builtin_clz etc. in 16.3 (1923) but it will be -+// removed in 16.8 (1928). -+#if (_MSC_VER >= 1923) && (_MSC_VER < 1928) -+#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 1 -+#else -+#define FOLLY_DETAILFOLLY_DETAIL_MSC_BUILTIN_SUPPORT 0 -+#endif -+ - namespace folly { - namespace portability { - namespace detail { -@@ -41,6 +49,7 @@ FOLLY_ALWAYS_INLINE void __builtin___clear_cache(char* begin, char* end) { - } - } - -+#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - FOLLY_ALWAYS_INLINE int __builtin_clz(unsigned int x) { - unsigned long index; - return int(_BitScanReverse(&index, (unsigned long)x) ? 31 - index : 32); -@@ -92,6 +101,7 @@ FOLLY_ALWAYS_INLINE int __builtin_ctzll(unsigned long long x) { - return int(_BitScanForward64(&index, x) ? index : 64); - } - #endif -+#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - - FOLLY_ALWAYS_INLINE int __builtin_ffs(int x) { - unsigned long index; -@@ -117,12 +127,15 @@ FOLLY_ALWAYS_INLINE int __builtin_popcount(unsigned int x) { - return int(__popcnt(x)); - } - -+#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - FOLLY_ALWAYS_INLINE int __builtin_popcountl(unsigned long x) { - static_assert(sizeof(x) == 4, ""); - return int(__popcnt(x)); - } -+#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - #endif - -+#if !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - #if defined(_M_IX86) - FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt((unsigned int)(x >> 32))) + -@@ -133,6 +146,7 @@ FOLLY_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x) { - return int(__popcnt64(x)); - } - #endif -+#endif // !defined(_MSC_VER) || !defined(FOLLY_DETAIL_MSC_BUILTIN_SUPPORT) - - FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { - // I really hope frame is zero... -@@ -141,3 +155,5 @@ FOLLY_ALWAYS_INLINE void* __builtin_return_address(unsigned int frame) { - return _ReturnAddress(); - } - #endif -+ -+#undef FOLLY_DETAIL_MSC_BUILTIN_SUPPORT --- - diff --git a/recipes/folly/all/patches/0013-include-bit.patch b/recipes/folly/all/patches/0013-include-bit.patch deleted file mode 100644 index 1a8ac249a146b..0000000000000 --- a/recipes/folly/all/patches/0013-include-bit.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/folly/lang/Bits.h -+++ b/folly/lang/Bits.h -@@ -64,6 +64,10 @@ - #include - #include - -+#if __has_include() && __cpp_lib_bit_cast -+#include -+#endif -+ - namespace folly { - - #if __cpp_lib_bit_cast diff --git a/recipes/folly/all/patches/0020-include-ssizet.patch b/recipes/folly/all/patches/0020-include-ssizet.patch deleted file mode 100644 index 0575fecd13e84..0000000000000 --- a/recipes/folly/all/patches/0020-include-ssizet.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/executors/ExecutorWithPriority.h b/folly/executors/ExecutorWithPriority.h -index b95a6c4..18b8110 100644 ---- a/folly/executors/ExecutorWithPriority.h -+++ b/folly/executors/ExecutorWithPriority.h -@@ -18,6 +18,7 @@ - - #include - #include -+#include - - namespace folly { - diff --git a/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch b/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch deleted file mode 100644 index 158c67976aa8a..0000000000000 --- a/recipes/folly/all/patches/0023-fix-cmake-generator-expr.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake -index f8701b469..6b3628e62 100644 ---- a/CMake/GenPkgConfig.cmake -+++ b/CMake/GenPkgConfig.cmake -@@ -92,7 +92,19 @@ function(gen_pkgconfig_vars) - - # Set the output variables - string(REPLACE ";" " " cflags "${cflags}") -- set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) - string(REPLACE ";" " " private_libs "${private_libs}") -+ -+ # Since CMake 3.18 FindThreads may include a generator expression requiring -+ # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. -+ # Before CMake 3.19 there's no way to solve this in a general way, so we -+ # work around the specific case. See #1414 and CMake bug #21074. -+ if(CMAKE_VERSION VERSION_LESS 3.19) -+ string(REPLACE -+ "" "" -+ cflags "${cflags}" -+ ) -+ endif() -+ -+ set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) - set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE) - endfunction() -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2de92981d..329433edc 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -414,10 +414,19 @@ configure_file( - ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen - @ONLY - ) -+ -+# Specify target to allow resolving generator expressions requiring -+# a target for CMake >=3.19. See #1414. -+# VERSION_GREATER_EQUAL isn't available before CMake 3.7. -+if(NOT CMAKE_VERSION VERSION_LESS 3.19) -+ set(target_arg TARGET folly_deps) -+endif() -+ - file( - GENERATE - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc - INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen -+ ${target_arg} - ) - install( - FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc diff --git a/recipes/folly/all/patches/0027-fix-numeric-limits-include.patch b/recipes/folly/all/patches/0027-fix-numeric-limits-include.patch deleted file mode 100644 index ff932cde55885..0000000000000 --- a/recipes/folly/all/patches/0027-fix-numeric-limits-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/TimeoutQueue.cpp b/folly/TimeoutQueue.cpp -index 706715f71..5ea970679 100644 ---- a/folly/TimeoutQueue.cpp -+++ b/folly/TimeoutQueue.cpp -@@ -16,6 +16,7 @@ - - #include - #include -+#include - #include - - namespace folly { From 93d6c24d71e1445eaf9caf99c976a11b1132885d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Wed, 7 Jun 2023 13:35:32 +0000 Subject: [PATCH 036/109] Declare openssl requirement with >=1.1 <4 version range --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 118286c658426..ea0acd52e391c 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -72,7 +72,7 @@ def requirements(self): self.requires("gflags/2.2.2", transitive_headers=True) self.requires("glog/0.4.0", transitive_headers=True) self.requires("libevent/2.1.12", transitive_headers=True) - self.requires("openssl/1.1.1t", transitive_headers=True) + self.requires("openssl/[>=1.1 <4]", transitive_headers=True) self.requires("lz4/1.9.3") self.requires("snappy/1.1.9") self.requires("zlib/1.2.13", transitive_headers=True) From 72e926ddc33c66333750331fa28b68646f0871a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Wed, 7 Jun 2023 14:56:49 +0000 Subject: [PATCH 037/109] Remove 2019.10.21.00 from config.yml --- recipes/folly/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 808d079b0d928..a86ec24158d82 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,6 +1,4 @@ versions: - "2019.10.21.00": - folder: all "2020.08.10.00": folder: all "2022.01.31.00": From d3482edd61f4aee3c45d1de624e4f48542314953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Thu, 8 Jun 2023 08:46:05 +0000 Subject: [PATCH 038/109] Do not specify requires traits for now --- recipes/folly/all/conanfile.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index ea0acd52e391c..67d6c9a5a8f0f 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -66,17 +66,17 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0", transitive_headers=True) + self.requires("boost/1.78.0") self.requires("bzip2/1.0.8") - self.requires("double-conversion/3.2.1", transitive_headers=True) - self.requires("gflags/2.2.2", transitive_headers=True) - self.requires("glog/0.4.0", transitive_headers=True) - self.requires("libevent/2.1.12", transitive_headers=True) - self.requires("openssl/[>=1.1 <4]", transitive_headers=True) + self.requires("double-conversion/3.2.1") + self.requires("gflags/2.2.2") + self.requires("glog/0.4.0") + self.requires("libevent/2.1.12") + self.requires("openssl/[>=1.1 <4]") self.requires("lz4/1.9.3") self.requires("snappy/1.1.9") - self.requires("zlib/1.2.13", transitive_headers=True) - self.requires("zstd/1.5.2", transitive_headers=True) + self.requires("zlib/1.2.13") + self.requires("zstd/1.5.2") if not is_msvc(self): self.requires("libdwarf/20191104") self.requires("libsodium/1.0.18") @@ -84,11 +84,11 @@ def requirements(self): # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") if self.settings.os == "Linux": self.requires("libiberty/9.1.0") - self.requires("libunwind/1.6.2", transitive_headers=True) + self.requires("libunwind/1.6.2") if "2020.08.10.00" <= Version(self.version) < "2022.01.31.00": - self.requires("fmt/7.1.3", transitive_headers=True) + self.requires("fmt/7.1.3") if Version(self.version) >= "2022.01.31.00": - self.requires("fmt/8.0.1", transitive_headers=True) # Folly bump fmt to 8.0.1 in v2022.01.31.00 + self.requires("fmt/8.0.1") # Folly bump fmt to 8.0.1 in v2022.01.31.00 @property def _required_boost_components(self): From 95d26cd1e379ee0ad99928263da03cb8681a1506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Thu, 8 Jun 2023 13:37:03 +0000 Subject: [PATCH 039/109] Define test_type explicit --- recipes/folly/all/test_package/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/test_package/conanfile.py b/recipes/folly/all/test_package/conanfile.py index 63889d5258fa5..60e121e0c9146 100644 --- a/recipes/folly/all/test_package/conanfile.py +++ b/recipes/folly/all/test_package/conanfile.py @@ -1,14 +1,14 @@ import os from conan import ConanFile -from conan.tools.cmake import CMake, CMakeToolchain +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.build import can_run -from conan.tools.cmake import cmake_layout required_conan_version = ">=1.43.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" generators = "CMakeDeps", "VirtualRunEnv" + test_type = "explicit" def requirements(self): self.requires(self.tested_reference_str) From 601d56613cbd6d90818132bd416feeaed88a82c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Tue, 20 Jun 2023 16:03:09 +0200 Subject: [PATCH 040/109] Add transitive_headers/transitive_libs to double-conversion --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 67d6c9a5a8f0f..9848ea4c084ae 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -68,7 +68,7 @@ def layout(self): def requirements(self): self.requires("boost/1.78.0") self.requires("bzip2/1.0.8") - self.requires("double-conversion/3.2.1") + self.requires("double-conversion/3.2.1", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") self.requires("glog/0.4.0") self.requires("libevent/2.1.12") From 7e0f4fd3d6cfe4836c0a4c45e68ff92e6ccd6222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Tue, 20 Jun 2023 20:30:38 +0200 Subject: [PATCH 041/109] Add transitive traits to boost --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 9848ea4c084ae..ef4908e3340de 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -66,7 +66,7 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0") + self.requires("boost/1.78.0", transitive_headers=True, transitive_libs=True) self.requires("bzip2/1.0.8") self.requires("double-conversion/3.2.1", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") From 7d2b0ec0710b078abb7f5666c34e94982c0fec7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Wed, 21 Jun 2023 10:58:39 +0000 Subject: [PATCH 042/109] Add more transitive_headers, transitive_libs - make boost, double-conversion, glog, libevent, fmt available to consumers --- recipes/folly/all/conanfile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index ef4908e3340de..05fe2661b17db 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -70,8 +70,8 @@ def requirements(self): self.requires("bzip2/1.0.8") self.requires("double-conversion/3.2.1", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") - self.requires("glog/0.4.0") - self.requires("libevent/2.1.12") + self.requires("glog/0.4.0", transitive_headers=True, transitive_libs=True) + self.requires("libevent/2.1.12", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]") self.requires("lz4/1.9.3") self.requires("snappy/1.1.9") @@ -86,9 +86,9 @@ def requirements(self): self.requires("libiberty/9.1.0") self.requires("libunwind/1.6.2") if "2020.08.10.00" <= Version(self.version) < "2022.01.31.00": - self.requires("fmt/7.1.3") + self.requires("fmt/7.1.3", transitive_headers=True, transitive_libs=True) if Version(self.version) >= "2022.01.31.00": - self.requires("fmt/8.0.1") # Folly bump fmt to 8.0.1 in v2022.01.31.00 + self.requires("fmt/8.0.1", transitive_headers=True, transitive_libs=True) # Folly bump fmt to 8.0.1 in v2022.01.31.00 @property def _required_boost_components(self): From 9e0083c880b6635251afd2aa90ba818cbf1b9060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Thu, 22 Jun 2023 11:09:01 +0000 Subject: [PATCH 043/109] Add transitive_libs traits to lz4, zstd --- recipes/folly/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 05fe2661b17db..d17fc9da3a66f 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -73,10 +73,10 @@ def requirements(self): self.requires("glog/0.4.0", transitive_headers=True, transitive_libs=True) self.requires("libevent/2.1.12", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]") - self.requires("lz4/1.9.3") + self.requires("lz4/1.9.3", transitive_libs=True) self.requires("snappy/1.1.9") self.requires("zlib/1.2.13") - self.requires("zstd/1.5.2") + self.requires("zstd/1.5.2", transitive_libs=True) if not is_msvc(self): self.requires("libdwarf/20191104") self.requires("libsodium/1.0.18") From 7d96d7e6a8aca96561a17d1a717c4e12efd0809d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Farr=C3=A9?= Date: Fri, 23 Jun 2023 09:03:08 +0000 Subject: [PATCH 044/109] Order imports --- recipes/folly/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index d17fc9da3a66f..e8c6d12581e41 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,10 +1,10 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration -from conan.tools.microsoft import is_msvc, msvc_runtime_flag -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file from conan.tools.build import can_run, check_min_cppstd -from conan.tools.scm import Version from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.scm import Version import os required_conan_version = ">=1.53.0" From 3430b89a96bf527cb9765e5df8f1ebffe9f21c42 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 14 Nov 2023 09:40:11 +0200 Subject: [PATCH 045/109] folly: drop v2020.08.10.00 --- recipes/folly/all/conandata.yml | 32 ---- recipes/folly/all/conanfile.py | 39 ++--- .../all/patches/0008-find-packages.patch | 162 ------------------ .../patches/0009-ill-formed-atomic-copy.patch | 13 -- .../all/patches/0010-duplicate-hash.patch | 13 -- .../patches/0011-disable-logger-example.patch | 12 -- .../all/patches/0012-compiler-flags.patch | 24 --- .../folly/all/patches/0014-find-librt.patch | 18 -- .../0015-benchmark-format-macros.patch | 15 -- .../all/patches/0021-typedef-clockid.patch | 12 -- .../0024-fix-cmake-generator-expr.patch | 56 ------ .../0028-fix-numeric-limits-include.patch | 12 -- recipes/folly/all/test_package/CMakeLists.txt | 8 +- recipes/folly/all/test_package/conanfile.py | 2 +- recipes/folly/config.yml | 2 - 15 files changed, 14 insertions(+), 406 deletions(-) delete mode 100644 recipes/folly/all/patches/0008-find-packages.patch delete mode 100644 recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch delete mode 100644 recipes/folly/all/patches/0010-duplicate-hash.patch delete mode 100644 recipes/folly/all/patches/0011-disable-logger-example.patch delete mode 100644 recipes/folly/all/patches/0012-compiler-flags.patch delete mode 100644 recipes/folly/all/patches/0014-find-librt.patch delete mode 100644 recipes/folly/all/patches/0015-benchmark-format-macros.patch delete mode 100644 recipes/folly/all/patches/0021-typedef-clockid.patch delete mode 100644 recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch delete mode 100644 recipes/folly/all/patches/0028-fix-numeric-limits-include.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 107316b0c2c76..44cc9ca503684 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,7 +1,4 @@ sources: - "2020.08.10.00": - url: "https://github.com/facebook/folly/archive/v2020.08.10.00.tar.gz" - sha256: "e81140d04a4e89e3f848e528466a9b3d3ae37d7eeb9e65467fca50d70918eef6" "2022.01.31.00": url: "https://github.com/facebook/folly/releases/download/v2022.01.31.00/folly-v2022.01.31.00.tar.gz" sha256: "7b8d5dd2eb51757858247af0ad27af2e3e93823f84033a628722b01e06cd68a9" @@ -9,35 +6,6 @@ sources: url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: - "2020.08.10.00": - - patch_file: "patches/0008-find-packages.patch" - patch_description: "fix folly-deps.cmake" - patch_type: "conan" - - patch_file: "patches/0009-ill-formed-atomic-copy.patch" - patch_description: "fix ill-formed-atomic" - patch_type: "conan" - - patch_file: "patches/0010-duplicate-hash.patch" - patch_description: "fix code" - patch_type: "conan" - - patch_file: "patches/0011-disable-logger-example.patch" - patch_description: "exclude examples" - patch_type: "conan" - - patch_file: "patches/0012-compiler-flags.patch" - patch_description: "fix flags" - patch_type: "conan" - - patch_file: "patches/0014-find-librt.patch" - patch_description: "fix cmake" - patch_type: "conan" - - patch_file: "patches/0015-benchmark-format-macros.patch" - patch_description: "fix code" - patch_type: "conan" - - patch_file: "patches/0024-fix-cmake-generator-expr.patch" - patch_description: "CMake: Handle generator expressions requiring a target for pkg-config #1433" - patch_type: "portability" - patch_source: "https://github.com/facebook/folly/pull/1433" - - patch_file: "patches/0028-fix-numeric-limits-include.patch" - patch_description: "include limits" - patch_type: "conan" "2022.01.31.00": - patch_file: "patches/0016-find-packages.patch" patch_description: "fix folly-deps.cmake" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index e8c6d12581e41..743c7b619e118 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -33,16 +33,11 @@ class FollyConan(ConanFile): @property def _min_cppstd(self): - return "17" if Version(self.version) >= "2022.01.31.00" else "14" + return 17 @property def _compilers_minimum_version(self): return { - "Visual Studio": "15", - "gcc": "5", - "clang": "6", - "apple-clang": "8", - } if self._min_cppstd == "14" else { "gcc": "7", "Visual Studio": "16", "clang": "6", @@ -55,7 +50,7 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if str(self.settings.arch) not in ['x86', 'x86_64']: + if str(self.settings.arch) not in ["x86", "x86_64"]: del self.options.use_sse4_2 def configure(self): @@ -82,12 +77,9 @@ def requirements(self): self.requires("libsodium/1.0.18") self.requires("xz_utils/5.4.0") # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") self.requires("libunwind/1.6.2") - if "2020.08.10.00" <= Version(self.version) < "2022.01.31.00": - self.requires("fmt/7.1.3", transitive_headers=True, transitive_libs=True) - if Version(self.version) >= "2022.01.31.00": self.requires("fmt/8.0.1", transitive_headers=True, transitive_libs=True) # Folly bump fmt to 8.0.1 in v2022.01.31.00 @property @@ -103,9 +95,6 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if Version(self.version) < "2022.01.31.00" and self.settings.os != "Linux": - raise ConanInvalidConfiguration("Conan support for non-Linux platforms starts with Folly version 2022.01.31.00") - if self.settings.os == "Macos" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") @@ -117,7 +106,7 @@ def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} could not be built on {self.settings.os}. PR's are welcome.") - + if Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") @@ -136,11 +125,8 @@ def validate(self): def build_requirements(self): pass - def _preserve_tarball_root(self): - return Version(self.version) >= "2022.01.31.00" - def source(self): - get(self, **self.conan_data["sources"][self.version], strip_root=not self._preserve_tarball_root()) + get(self, **self.conan_data["sources"][self.version], strip_root=False) def _cppstd_flag_value(self, cppstd): cppstd_prefix_gnu, cppstd_value = (cppstd[:3], cppstd[3:]) if "gnu" in cppstd else ("", cppstd) @@ -225,7 +211,7 @@ def package_info(self): self.cpp_info.set_property("cmake_target_name", "Folly::folly") self.cpp_info.set_property("pkg_config_name", "libfolly") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].libs = [ "folly_exception_counter", "folly_exception_tracer", @@ -258,19 +244,18 @@ def package_info(self): ] if not is_msvc(self): self.cpp_info.components["libfolly"].requires.append("libdwarf::libdwarf") - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) - if Version(self.version) >= "2020.08.10.00": - self.cpp_info.components["libfolly"].requires.append("fmt::fmt") - if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) + self.cpp_info.components["libfolly"].requires.append("fmt::fmt") + if self.settings.os in ["Linux", "FreeBSD"]: + self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) elif self.settings.os == "Windows": self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) - if (self.settings.os == "Linux" and self.settings.compiler == "clang" and + if (self.settings.os in ["Linux", "FreeBSD"] and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++") or \ (self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"): @@ -313,7 +298,7 @@ def package_info(self): self.cpp_info.components["folly_test_util"].libs = ["folly_test_util"] self.cpp_info.components["folly_test_util"].requires = ["libfolly"] - if self.settings.os == "Linux": + if self.settings.os in ["Linux", "FreeBSD"]: # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base" self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package_multi"] = "folly_exception_tracer_base" diff --git a/recipes/folly/all/patches/0008-find-packages.patch b/recipes/folly/all/patches/0008-find-packages.patch deleted file mode 100644 index f8a3eacdcd1dd..0000000000000 --- a/recipes/folly/all/patches/0008-find-packages.patch +++ /dev/null @@ -1,162 +0,0 @@ -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 3169b972d..b503b9ba7 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -33,7 +33,7 @@ else() - endif() - set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}") - --find_package(Boost 1.51.0 MODULE -+find_package(Boost - COMPONENTS - context - filesystem -@@ -46,33 +46,33 @@ find_package(Boost 1.51.0 MODULE - 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(Gflags MODULE) --set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) --if(LIBGFLAGS_FOUND) -- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) -- list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIBGFLAGS_LIBRARY}) -- list(APPEND CMAKE_REQUIRED_INCLUDES ${LIBGFLAGS_INCLUDE_DIR}) -+find_package(double-conversion REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) -+ -+find_package(gflags REQUIRED) -+set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) -+if(gflags_FOUND) -+ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${gflags_LIBRARIES}) -+ list(APPEND CMAKE_REQUIRED_INCLUDES ${gflags_INCLUDE_DIR}) - 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(glog REQUIRED) -+set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) -+find_package(Libevent REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) - - find_package(OpenSSL MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) --list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) - check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) - - find_package(ZLIB MODULE) -@@ -83,10 +83,10 @@ if (ZLIB_FOUND) - endif() - - find_package(BZip2 MODULE) --set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) --if (BZIP2_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) -- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) -+set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) -+if (BZip2_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) - endif() - - find_package(LibLZMA MODULE) -@@ -96,18 +96,18 @@ if (LIBLZMA_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) - endif() - --find_package(LZ4 MODULE) --set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) --if (LZ4_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) -+find_package(lz4 MODULE) -+set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) -+if (lz4_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) - endif() - --find_package(Zstd MODULE) --set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) --if(ZSTD_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) -+find_package(zstd MODULE) -+set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) -+if(zstd_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) - endif() - - find_package(Snappy MODULE) -@@ -117,11 +117,11 @@ if (SNAPPY_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) - endif() - --find_package(LibDwarf) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) -+find_package(libdwarf) -+list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) - --find_package(Libiberty) -+find_package(libiberty) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) - -@@ -133,9 +133,9 @@ find_package(LibUring) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) - --find_package(Libsodium) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) -+find_package(libsodium) -+list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) - - list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -@@ -147,14 +147,14 @@ endif () - - set(FOLLY_USE_SYMBOLIZER OFF) - CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF_H) --find_library(UNWIND_LIBRARIES NAMES unwind) --if (UNWIND_LIBRARIES) -- list(APPEND FOLLY_LINK_LIBRARIES ${UNWIND_LIBRARIES}) -- list(APPEND CMAKE_REQUIRED_LIBRARIES ${UNWIND_LIBRARIES}) -+find_library(libunwind_LIBRARIES NAMES libunwind) -+if (libunwind_LIBRARIES) -+ list(APPEND FOLLY_LINK_LIBRARIES ${libunwind_LIBRARIES}) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES ${libunwind_LIBRARIES}) - endif() - find_package(Backtrace) - set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND}) --if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND LIBDWARF_FOUND) -+if (FOLLY_HAVE_ELF_H AND FOLLY_HAVE_BACKTRACE AND libdwarf_FOUND) - set(FOLLY_USE_SYMBOLIZER ON) - endif() - message(STATUS "Setting FOLLY_USE_SYMBOLIZER: ${FOLLY_USE_SYMBOLIZER}") diff --git a/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch b/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch deleted file mode 100644 index 58f95224f3873..0000000000000 --- a/recipes/folly/all/patches/0009-ill-formed-atomic-copy.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/folly/fibers/SemaphoreBase.cpp b/folly/fibers/SemaphoreBase.cpp -index 06e9ecc7111..77e2da75c18 100644 ---- a/folly/fibers/SemaphoreBase.cpp -+++ b/folly/fibers/SemaphoreBase.cpp -@@ -170,7 +170,7 @@ namespace { - class FutureWaiter final : public fibers::Baton::Waiter { - public: - explicit FutureWaiter(int64_t tokens) -- : semaphoreWaiter(SemaphoreBase::Waiter(tokens)) { -+ : semaphoreWaiter(tokens) { - semaphoreWaiter.baton.setWaiter(*this); - } - diff --git a/recipes/folly/all/patches/0010-duplicate-hash.patch b/recipes/folly/all/patches/0010-duplicate-hash.patch deleted file mode 100644 index 69268c6acf6f6..0000000000000 --- a/recipes/folly/all/patches/0010-duplicate-hash.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/folly/hash/Hash.h b/folly/hash/Hash.h -index a8a50e8e8dc..d7a3da8e61f 100644 ---- a/folly/hash/Hash.h -+++ b/folly/hash/Hash.h -@@ -733,7 +733,7 @@ struct TupleHasher<0, Ts...> { - - // Custom hash functions. - namespace std { --#if FOLLY_SUPPLY_MISSING_INT128_TRAITS -+#if 0 - template <> - struct hash<__int128> : folly::detail::integral_hasher<__int128> {}; - diff --git a/recipes/folly/all/patches/0011-disable-logger-example.patch b/recipes/folly/all/patches/0011-disable-logger-example.patch deleted file mode 100644 index fa20905367fb1..0000000000000 --- a/recipes/folly/all/patches/0011-disable-logger-example.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt -index 08de7daf20f..cdc1f03bf46 100644 ---- a/folly/CMakeLists.txt -+++ b/folly/CMakeLists.txt -@@ -27,7 +27,6 @@ install( - ) - - add_subdirectory(experimental/exception_tracer) --add_subdirectory(logging/example) - - if (PYTHON_EXTENSIONS) - # Create tree of symbolic links in structure required for successful diff --git a/recipes/folly/all/patches/0012-compiler-flags.patch b/recipes/folly/all/patches/0012-compiler-flags.patch deleted file mode 100644 index 358500a1800cd..0000000000000 --- a/recipes/folly/all/patches/0012-compiler-flags.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake -index 8dcaf141a3a..200fe8d3798 100644 ---- a/CMake/FollyCompilerUnix.cmake -+++ b/CMake/FollyCompilerUnix.cmake -@@ -28,9 +28,9 @@ set( - ) - mark_as_advanced(CXX_STD) - --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}") - - # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") -@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -std=${CXX_STD} - -finput-charset=UTF-8 - -fsigned-char diff --git a/recipes/folly/all/patches/0014-find-librt.patch b/recipes/folly/all/patches/0014-find-librt.patch deleted file mode 100644 index 90a1f0f7b9ada..0000000000000 --- a/recipes/folly/all/patches/0014-find-librt.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMake/FollyConfigChecks.cmake b/CMake/FollyConfigChecks.cmake -index 6b8b308c7..908d72d51 100644 ---- a/CMake/FollyConfigChecks.cmake -+++ b/CMake/FollyConfigChecks.cmake -@@ -83,6 +83,13 @@ string(REGEX REPLACE - CMAKE_REQUIRED_FLAGS - "${CMAKE_REQUIRED_FLAGS}") - -+if (CMAKE_SYSTEM_NAME STREQUAL "Linux") -+ find_library(LIBRT rt) -+ if (LIBRT) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "rt") -+ endif() -+endif() -+ - check_symbol_exists(pthread_atfork pthread.h FOLLY_HAVE_PTHREAD_ATFORK) - - # Unfortunately check_symbol_exists() does not work for memrchr(): diff --git a/recipes/folly/all/patches/0015-benchmark-format-macros.patch b/recipes/folly/all/patches/0015-benchmark-format-macros.patch deleted file mode 100644 index 14f8b2088a1b3..0000000000000 --- a/recipes/folly/all/patches/0015-benchmark-format-macros.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/folly/Benchmark.cpp b/folly/Benchmark.cpp -index 389ee46a1..390b7674b 100644 ---- a/folly/Benchmark.cpp -+++ b/folly/Benchmark.cpp -@@ -16,6 +16,10 @@ - - // @author Andrei Alexandrescu (andrei.alexandrescu@fb.com) - -+#ifndef __STDC_FORMAT_MACROS -+#define __STDC_FORMAT_MACROS 1 -+#endif -+ - #include - - #include diff --git a/recipes/folly/all/patches/0021-typedef-clockid.patch b/recipes/folly/all/patches/0021-typedef-clockid.patch deleted file mode 100644 index fb46c057d58ce..0000000000000 --- a/recipes/folly/all/patches/0021-typedef-clockid.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/portability/Time.h b/folly/portability/Time.h -index 994a09e5d70..e4f0d101ca9 100644 ---- a/folly/portability/Time.h -+++ b/folly/portability/Time.h -@@ -49,7 +49,6 @@ - #define CLOCK_PROCESS_CPUTIME_ID 2 - #define CLOCK_THREAD_CPUTIME_ID 3 - --typedef uint8_t clockid_t; - extern "C" int clock_gettime(clockid_t clk_id, struct timespec* ts); - extern "C" int clock_getres(clockid_t clk_id, struct timespec* ts); - #endif diff --git a/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch b/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch deleted file mode 100644 index 193d42bffdec6..0000000000000 --- a/recipes/folly/all/patches/0024-fix-cmake-generator-expr.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake -index f8701b469..59a0c9f57 100644 ---- a/CMake/GenPkgConfig.cmake -+++ b/CMake/GenPkgConfig.cmake -@@ -92,7 +92,19 @@ function(gen_pkgconfig_vars) - - # Set the output variables - string(REPLACE ";" " " cflags "${cflags}") -- set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) - string(REPLACE ";" " " private_libs "${private_libs}") -+ -+ # Since CMake 3.18 FindThreads may include a generator expression requiring -+ # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. -+ # Before CMake 3.19 there's no way to solve this in a general way, so we -+ # work around the specific case. See #1414 and CMake bug #21074. -+ if(CMAKE_VERSION VERSION_LESS 3.19) -+ string(REPLACE -+ "" "" -+ cflags "${cflags}" -+ ) -+ endif() -+ -+ set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE) - set("${var_prefix}_PRIVATE_LIBS" "${private_libs}" PARENT_SCOPE) - endfunction() -diff --git a/CMakeLists.txt b/CMakeLists.txt -index c57ba69fa..5dd071bcf 100755 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -442,17 +442,20 @@ configure_file( - ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen - @ONLY - ) -+ -+# Specify target to allow resolving generator expressions requiring -+# a target for CMake >=3.19. See #1414. -+# VERSION_GREATER_EQUAL isn't available before CMake 3.7. -+if(NOT CMAKE_VERSION VERSION_LESS 3.19) -+ set(target_arg TARGET folly_deps) -+endif() -+ - file( - GENERATE - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc - INPUT ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc.gen -+ ${target_arg} - ) --install( -- FILES ${CMAKE_CURRENT_BINARY_DIR}/libfolly.pc -- DESTINATION ${LIB_INSTALL_DIR}/pkgconfig -- COMPONENT dev --) -- - option(BUILD_TESTS "If enabled, compile the tests." OFF) - option(BUILD_BROKEN_TESTS "If enabled, compile tests that are known to be broken." OFF) - option(BUILD_HANGING_TESTS "If enabled, compile tests that are known to hang." OFF) diff --git a/recipes/folly/all/patches/0028-fix-numeric-limits-include.patch b/recipes/folly/all/patches/0028-fix-numeric-limits-include.patch deleted file mode 100644 index ff932cde55885..0000000000000 --- a/recipes/folly/all/patches/0028-fix-numeric-limits-include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/TimeoutQueue.cpp b/folly/TimeoutQueue.cpp -index 706715f71..5ea970679 100644 ---- a/folly/TimeoutQueue.cpp -+++ b/folly/TimeoutQueue.cpp -@@ -16,6 +16,7 @@ - - #include - #include -+#include - #include - - namespace folly { diff --git a/recipes/folly/all/test_package/CMakeLists.txt b/recipes/folly/all/test_package/CMakeLists.txt index 35424dcfd2230..82796f7de6547 100644 --- a/recipes/folly/all/test_package/CMakeLists.txt +++ b/recipes/folly/all/test_package/CMakeLists.txt @@ -5,10 +5,4 @@ find_package(folly REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) target_link_libraries(${PROJECT_NAME} PRIVATE Folly::folly) - - -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() +target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) diff --git a/recipes/folly/all/test_package/conanfile.py b/recipes/folly/all/test_package/conanfile.py index 60e121e0c9146..182ad8fa961d0 100644 --- a/recipes/folly/all/test_package/conanfile.py +++ b/recipes/folly/all/test_package/conanfile.py @@ -28,4 +28,4 @@ def build(self): def test(self): if can_run(self): - self.run(os.path.join(self.cpp.build.bindirs[0], "test_package"), env="conanrun") + self.run(os.path.join(self.cpp.build.bindir, "test_package"), env="conanrun") diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index a86ec24158d82..7890518af2edf 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,6 +1,4 @@ versions: - "2020.08.10.00": - folder: all "2022.01.31.00": folder: all "2022.10.31.00": From b8e5c90f6408aec1ca5f6db98492b3e366b9f1f8 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 14 Nov 2023 09:42:14 +0200 Subject: [PATCH 046/109] folly: bump deps --- recipes/folly/all/conanfile.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 743c7b619e118..61d9c97e5d014 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -61,26 +61,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.78.0", transitive_headers=True, transitive_libs=True) + self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True) self.requires("bzip2/1.0.8") - self.requires("double-conversion/3.2.1", transitive_headers=True, transitive_libs=True) + self.requires("double-conversion/3.3.0", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") - self.requires("glog/0.4.0", transitive_headers=True, transitive_libs=True) + self.requires("glog/0.6.0", transitive_headers=True, transitive_libs=True) self.requires("libevent/2.1.12", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]") - self.requires("lz4/1.9.3", transitive_libs=True) - self.requires("snappy/1.1.9") - self.requires("zlib/1.2.13") - self.requires("zstd/1.5.2", transitive_libs=True) + self.requires("lz4/1.9.4", transitive_libs=True) + self.requires("snappy/1.1.10") + self.requires("zlib/[>=1.2.11 <2]") + self.requires("zstd/1.5.5", transitive_libs=True) if not is_msvc(self): self.requires("libdwarf/20191104") - self.requires("libsodium/1.0.18") - self.requires("xz_utils/5.4.0") + self.requires("libsodium/1.0.19") + self.requires("xz_utils/5.4.4") # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") self.requires("libunwind/1.6.2") - self.requires("fmt/8.0.1", transitive_headers=True, transitive_libs=True) # Folly bump fmt to 8.0.1 in v2022.01.31.00 + self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): From d43651bb66086850158383c13e4a8fcf8bf0f56d Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 14 Nov 2023 09:45:03 +0200 Subject: [PATCH 047/109] folly: do not set CMAKE_C_FLAGS directly --- recipes/folly/all/conanfile.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 61d9c97e5d014..d319a241aa08b 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -151,15 +151,17 @@ def generate(self): tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ['x86', 'x86_64']: + if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ["x86", "x86_64"]: tc.preprocessor_definitions["FOLLY_SSE"] = "4" tc.preprocessor_definitions["FOLLY_SSE_MINOR"] = "2" if not is_msvc(self): - tc.variables["CMAKE_C_FLAGS"] = "-mfma" - tc.variables["CMAKE_CXX_FLAGS"] = "-mfma" + cflags = "-mfma" else: - tc.variables["CMAKE_C_FLAGS"] = "/arch:FMA" - tc.variables["CMAKE_CXX_FLAGS"] = "/arch:FMA" + cflags = "/arch:FMA" + tc.blocks["cmake_flags_init"].template += ( + f'string(APPEND CMAKE_CXX_FLAGS_INIT " {cflags}")\n' + f'string(APPEND CMAKE_C_FLAGS_INIT " {cflags}")\n' + ) # Folly is not respecting this from the helper https://github.com/conan-io/conan-center-index/pull/15726/files#r1097068754 tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) From 68cf93f1fa5d713e2ed276e669977d48e95c0cde Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 14 Nov 2023 09:46:24 +0200 Subject: [PATCH 048/109] folly: add msvc version check --- recipes/folly/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index d319a241aa08b..2ab711d3bc3e9 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -40,6 +40,7 @@ def _compilers_minimum_version(self): return { "gcc": "7", "Visual Studio": "16", + "msvc": "192", "clang": "6", "apple-clang": "10", } @@ -87,7 +88,7 @@ def _required_boost_components(self): return ["context", "filesystem", "program_options", "regex", "system", "thread"] def validate(self): - if self.settings.get_safe("compiler.cppstd"): + if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: From 39c6fe1e2ad2b323d15dc5cb27bcde983260af73 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Tue, 14 Nov 2023 09:47:47 +0200 Subject: [PATCH 049/109] folly: use is_apple_os() --- recipes/folly/all/conanfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 2ab711d3bc3e9..49b60943eef01 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,5 +1,6 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration +from conan.tools.apple import is_apple_os from conan.tools.build import can_run, check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file @@ -96,13 +97,13 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self.settings.os == "Macos" and self.settings.arch != "x86_64": + if is_apple_os(self) and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") - if self.settings.os in ["Macos", "Windows"] and self.options.shared: + if (is_apple_os(self) or self.settings.os == "Windows") and self.options.shared: raise ConanInvalidConfiguration(f"Folly could not be built on {self.settings.os} as shared library") if self.settings.os == "Windows": @@ -260,11 +261,11 @@ def package_info(self): if (self.settings.os in ["Linux", "FreeBSD"] and self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libstdc++") or \ - (self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and + (self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"): self.cpp_info.components["libfolly"].system_libs.append("atomic") - if self.settings.os == "Macos" and self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": From 49201d46c5ac233ce3b89b4574e77cc8b2c1f2ba Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Dec 2023 19:12:19 +0200 Subject: [PATCH 050/109] folly: keep only the newest version --- recipes/folly/all/conandata.yml | 19 -- recipes/folly/all/conanfile.py | 2 +- .../all/patches/0016-find-packages.patch | 174 ------------------ .../folly/all/patches/0018-find-glog.patch | 16 -- .../all/patches/0022-fix-windows-minmax.patch | 12 -- recipes/folly/config.yml | 2 - 6 files changed, 1 insertion(+), 224 deletions(-) delete mode 100644 recipes/folly/all/patches/0016-find-packages.patch delete mode 100644 recipes/folly/all/patches/0018-find-glog.patch delete mode 100644 recipes/folly/all/patches/0022-fix-windows-minmax.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 44cc9ca503684..b44c3570ca27d 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,27 +1,8 @@ sources: - "2022.01.31.00": - url: "https://github.com/facebook/folly/releases/download/v2022.01.31.00/folly-v2022.01.31.00.tar.gz" - sha256: "7b8d5dd2eb51757858247af0ad27af2e3e93823f84033a628722b01e06cd68a9" "2022.10.31.00": url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: - "2022.01.31.00": - - patch_file: "patches/0016-find-packages.patch" - patch_description: "fix folly-deps.cmake" - patch_type: "conan" - - patch_file: "patches/0017-compiler-flags.patch" - patch_description: "fix flags" - patch_type: "conan" - - patch_file: "patches/0018-find-glog.patch" - patch_description: "fix cmake script" - patch_type: "conan" - - patch_file: "patches/0019-exclude-example.patch" - patch_description: "exclude examples" - patch_type: "conan" - - patch_file: "patches/0022-fix-windows-minmax.patch" - patch_description: "fix cmake script on window" - patch_type: "conan" "2022.10.31.00": - patch_file: "patches/0017-compiler-flags.patch" patch_description: "fix the hard-coded flag" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 49b60943eef01..b8644ec407896 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -109,7 +109,7 @@ def validate(self): if self.settings.os == "Windows": raise ConanInvalidConfiguration(f"{self.ref} could not be built on {self.settings.os}. PR's are welcome.") - if Version(self.version) >= "2020.08.10.00" and self.settings.compiler == "clang" and self.options.shared: + if self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") boost = self.dependencies["boost"] diff --git a/recipes/folly/all/patches/0016-find-packages.patch b/recipes/folly/all/patches/0016-find-packages.patch deleted file mode 100644 index 83485efa04107..0000000000000 --- a/recipes/folly/all/patches/0016-find-packages.patch +++ /dev/null @@ -1,174 +0,0 @@ -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 9c9d9ea60..05e439b48 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -35,7 +35,7 @@ else() - endif() - set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}") - --find_package(Boost 1.51.0 MODULE -+find_package(Boost - COMPONENTS - context - filesystem -@@ -48,27 +48,27 @@ find_package(Boost 1.51.0 MODULE - 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(Gflags MODULE) --set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) --if(LIBGFLAGS_FOUND) -- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) -- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) -- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) -+find_package(double-conversion REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) -+ -+find_package(gflags REQUIRED) -+set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) -+if(gflags_FOUND) -+ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) -+ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) -+ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIR}) - 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(glog REQUIRED) -+set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) -+find_package(Libevent REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) - - find_package(ZLIB MODULE) - set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND}) -@@ -79,22 +79,22 @@ if (ZLIB_FOUND) - endif() - - find_package(OpenSSL MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) --list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) - check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) --list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) --list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) - if (ZLIB_FOUND) - list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) - endif() - - find_package(BZip2 MODULE) --set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) --if (BZIP2_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) -- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) -+set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) -+if (BZip2_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) - endif() - - find_package(LibLZMA MODULE) -@@ -104,18 +104,18 @@ if (LIBLZMA_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) - endif() - --find_package(LZ4 MODULE) --set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) --if (LZ4_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) -+find_package(lz4 MODULE) -+set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) -+if (lz4_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) - endif() - --find_package(Zstd MODULE) --set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) --if(ZSTD_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) -+find_package(zstd MODULE) -+set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) -+if(zstd_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) - endif() - - find_package(Snappy MODULE) -@@ -125,11 +125,11 @@ if (SNAPPY_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) - endif() - --find_package(LibDwarf) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) -+find_package(libdwarf) -+list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) - --find_package(Libiberty) -+find_package(libiberty) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) - -@@ -141,9 +141,9 @@ find_package(LibUring) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) - --find_package(Libsodium) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) -+find_package(libsodium) -+list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) - - list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -@@ -153,10 +153,10 @@ if (PYTHON_EXTENSIONS) - find_package(Cython 0.26 REQUIRED) - endif () - --find_package(LibUnwind) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS}) --if (LIBUNWIND_FOUND) -+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) - endif() - if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -@@ -173,7 +173,7 @@ CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF) - find_package(Backtrace) - - set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND}) --set(FOLLY_HAVE_DWARF ${LIBDWARF_FOUND}) -+set(FOLLY_HAVE_DWARF ${libdwarf_FOUND}) - if (NOT WIN32 AND NOT APPLE) - set(FOLLY_USE_SYMBOLIZER ON) - endif() diff --git a/recipes/folly/all/patches/0018-find-glog.patch b/recipes/folly/all/patches/0018-find-glog.patch deleted file mode 100644 index b2d17ad455a7b..0000000000000 --- a/recipes/folly/all/patches/0018-find-glog.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/build/fbcode_builder/CMake/FindGlog.cmake b/build/fbcode_builder/CMake/FindGlog.cmake -index 752647c..aa2fa1c 100644 ---- a/build/fbcode_builder/CMake/FindGlog.cmake -+++ b/build/fbcode_builder/CMake/FindGlog.cmake -@@ -10,9 +10,9 @@ include(FindPackageHandleStandardArgs) - include(SelectLibraryConfigurations) - - find_library(GLOG_LIBRARY_RELEASE glog -- PATHS ${GLOG_LIBRARYDIR}) -+ PATHS ${CONAN_GLOG_ROOT}) - find_library(GLOG_LIBRARY_DEBUG glogd -- PATHS ${GLOG_LIBRARYDIR}) -+ PATHS ${CONAN_GLOG_ROOT}) - - find_path(GLOG_INCLUDE_DIR glog/logging.h - PATHS ${GLOG_INCLUDEDIR}) diff --git a/recipes/folly/all/patches/0022-fix-windows-minmax.patch b/recipes/folly/all/patches/0022-fix-windows-minmax.patch deleted file mode 100644 index 1fc69a43a83e5..0000000000000 --- a/recipes/folly/all/patches/0022-fix-windows-minmax.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake -index ec2ce1a1d..16deda71c 100644 ---- a/CMake/FollyCompilerMSVC.cmake -+++ b/CMake/FollyCompilerMSVC.cmake -@@ -289,6 +289,7 @@ function(apply_folly_compile_options_to_target THETARGET) - # And the extra defines: - target_compile_definitions(${THETARGET} - PUBLIC -+ NOMINMAX - _CRT_NONSTDC_NO_WARNINGS # Don't deprecate posix names of functions. - _CRT_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. - _SCL_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 7890518af2edf..00d12a3887049 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,5 +1,3 @@ versions: - "2022.01.31.00": - folder: all "2022.10.31.00": folder: all From d7a2f8a312bbb85304eb3dfccd5a2b226d30a93f Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Dec 2023 19:14:32 +0200 Subject: [PATCH 051/109] folly: bump deps --- recipes/folly/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index b8644ec407896..68eca57cfee3b 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -77,11 +77,11 @@ def requirements(self): if not is_msvc(self): self.requires("libdwarf/20191104") self.requires("libsodium/1.0.19") - self.requires("xz_utils/5.4.4") + self.requires("xz_utils/5.4.5") # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") - self.requires("libunwind/1.6.2") + self.requires("libunwind/1.7.2") self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) @property From ce233d6e322b55efa3a9d05865dabcb96f84e286 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Dec 2023 19:31:57 +0200 Subject: [PATCH 052/109] folly: fix _cppstd_flag_value() --- recipes/folly/all/conanfile.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 68eca57cfee3b..3238bfc4ee235 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -131,15 +131,18 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=False) def _cppstd_flag_value(self, cppstd): - cppstd_prefix_gnu, cppstd_value = (cppstd[:3], cppstd[3:]) if "gnu" in cppstd else ("", cppstd) - if not cppstd_prefix_gnu: - cppstd_prefix_gnu = "c" + cppstd = str(cppstd) + if cppstd.startswith("gnu"): + prefix = "gnu" + year = cppstd[3:] + else: + prefix = "c" + year = cppstd if is_msvc(self): - cppstd_prefix_gnu = "" - if cppstd_value > "17": - cppstd_value = "latest" - cxx_std_value = f"{cppstd_prefix_gnu}++{cppstd_value}" - return cxx_std_value + prefix = "" + if year > "17": + year = "latest" + return f"{prefix}++{year}" def generate(self): tc = CMakeToolchain(self) From b9749543b2287dda7c2901940b0cc3c70c8cd605 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Dec 2023 19:39:20 +0200 Subject: [PATCH 053/109] folly: simplify libatomic check --- recipes/folly/all/conanfile.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 3238bfc4ee235..bc795f07d81e1 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -223,16 +223,12 @@ def package_info(self): "folly_exception_counter", "folly_exception_tracer", "folly_exception_tracer_base", - "folly_test_util", - "follybenchmark", - "folly" - ] - else: - self.cpp_info.components["libfolly"].libs = [ - "folly_test_util", - "follybenchmark", - "folly" ] + self.cpp_info.components["libfolly"].libs += [ + "folly_test_util", + "follybenchmark", + "folly" + ] self.cpp_info.components["libfolly"].requires = [ "boost::context", "boost::filesystem", "boost::program_options", "boost::regex", "boost::system", "boost::thread", @@ -262,10 +258,11 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) - if (self.settings.os in ["Linux", "FreeBSD"] and self.settings.compiler == "clang" and - self.settings.compiler.libcxx == "libstdc++") or \ - (self.settings.compiler == "apple-clang" and - Version(self.settings.compiler.version.value) == "9.0" and self.settings.compiler.libcxx == "libc++"): + if str(self.settings.compiler.libcxx) == "libstdc++" or ( + self.settings.compiler == "apple-clang" and + Version(self.settings.compiler.version.value) == "9.0" and + self.settings.compiler.libcxx == "libc++" + ): self.cpp_info.components["libfolly"].system_libs.append("atomic") if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": From 66826a59ecce365897781f3a7abfdca272de51de Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Dec 2023 20:21:15 +0200 Subject: [PATCH 054/109] folly: simplify patching --- recipes/folly/all/conan_deps.cmake | 39 ++++ recipes/folly/all/conandata.yml | 11 +- recipes/folly/all/conanfile.py | 79 ++++---- .../all/patches/0017-compiler-flags.patch | 9 +- .../all/patches/0019-exclude-example.patch | 12 -- .../all/patches/0025-find-packages.patch | 174 ------------------ .../all/patches/0026-fix-windows-minmax.patch | 12 -- 7 files changed, 78 insertions(+), 258 deletions(-) create mode 100644 recipes/folly/all/conan_deps.cmake delete mode 100644 recipes/folly/all/patches/0019-exclude-example.patch delete mode 100644 recipes/folly/all/patches/0025-find-packages.patch delete mode 100644 recipes/folly/all/patches/0026-fix-windows-minmax.patch diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake new file mode 100644 index 0000000000000..bdc0907f2db08 --- /dev/null +++ b/recipes/folly/all/conan_deps.cmake @@ -0,0 +1,39 @@ +# Set the dependency flags expected by https://github.com/facebook/folly/blob/v2023.12.18.00/CMake/folly-deps.cmake + +macro(custom_find_package name var) + find_package(${name} ${ARGN} + # Allow only Conan packages + NO_DEFAULT_PATH + PATHS ${CMAKE_PREFIX_PATH} + ) + set(${var}_FOUND TRUE) + set(${var}_VERSION ${${name}_VERSION}) + set(${var}_VERSION_STRING ${${name}_VERSION_STRING}) + set(${var}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) + set(${var}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) + set(${var}_INCLUDE ${${name}_INCLUDE_DIR}) + set(${var}_LIB ${${name}_LIBRARIES}) + set(${var}_LIBRARY ${${name}_LIBRARIES}) + set(${var}_LIBRARIES ${${name}_LIBRARIES}) + set(${var}_DEFINITIONS ${${name}_DEFINITIONS}) +endmacro() + +custom_find_package(BZip2 BZIP2) +custom_find_package(Backtrace BACKTRACE) +custom_find_package(DoubleConversion DOUBLE_CONVERSION REQUIRED) +custom_find_package(Gflags LIBGFLAGS) +custom_find_package(Glog GLOG) +custom_find_package(LZ4 LZ4) +custom_find_package(LibAIO LIBAIO) +custom_find_package(LibDwarf LIBDWARF) +custom_find_package(LibEvent LIBEVENT REQUIRED) +custom_find_package(LibLZMA LIBLZMA) +custom_find_package(LibUnwind LIBUNWIND) +custom_find_package(LibUring LIBURING) +custom_find_package(Libiberty LIBIBERTY) +custom_find_package(Libsodium LIBSODIUM) +custom_find_package(OpenSSL OPENSSL REQUIRED) +custom_find_package(Snappy SNAPPY) +custom_find_package(ZLIB ZLIB) +custom_find_package(Zstd ZSTD) +custom_find_package(fmt FMT REQUIRED) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index b44c3570ca27d..6713d46ee3665 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -5,14 +5,5 @@ sources: patches: "2022.10.31.00": - patch_file: "patches/0017-compiler-flags.patch" - patch_description: "fix the hard-coded flag" - patch_type: "conan" - - patch_file: "patches/0019-exclude-example.patch" - patch_description: "exclude example" - patch_type: "conan" - - patch_file: "patches/0025-find-packages.patch" - patch_description: "fix cmake find_package" - patch_type: "conan" - - patch_file: "patches/0026-fix-windows-minmax.patch" - patch_description: "fix cmake script on window" + patch_description: "Do not hard-code debug flag for all build types" patch_type: "conan" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index bc795f07d81e1..fdb391df3694a 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.apple import is_apple_os from conan.tools.build import can_run, check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, save from conan.tools.microsoft import is_msvc, msvc_runtime_flag from conan.tools.scm import Version import os @@ -48,6 +48,7 @@ def _compilers_minimum_version(self): def export_sources(self): export_conandata_patches(self) + copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): if self.settings.os == "Windows": @@ -124,9 +125,6 @@ def validate(self): if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") - def build_requirements(self): - pass - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=False) @@ -146,15 +144,13 @@ def _cppstd_flag_value(self, cppstd): def generate(self): tc = CMakeToolchain(self) + + tc.cache_variables["CMAKE_PROJECT_folly_INCLUDE"] = os.path.join(self.source_folder, "conan_deps.cmake") + if can_run(self): - tc.variables["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE"] = "0" - tc.variables["FOLLY_HAVE_UNALIGNED_ACCESS_EXITCODE__TRYRUN_OUTPUT"] = "" - tc.variables["FOLLY_HAVE_LINUX_VDSO_EXITCODE"] = "0" - tc.variables["FOLLY_HAVE_LINUX_VDSO_EXITCODE__TRYRUN_OUTPUT"] = "" - tc.variables["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE"] = "0" - tc.variables["FOLLY_HAVE_WCHAR_SUPPORT_EXITCODE__TRYRUN_OUTPUT"] = "" - tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE"] = "0" - tc.variables["HAVE_VSNPRINTF_ERRORS_EXITCODE__TRYRUN_OUTPUT"] = "" + for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: + tc.variables[f"{var}_EXITCODE"] = "0" + tc.variables[f"{var}_EXITCODE__TRYRUN_OUTPUT"] = "" if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ["x86", "x86_64"]: tc.preprocessor_definitions["FOLLY_SSE"] = "4" @@ -176,6 +172,8 @@ def generate(self): tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0075"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" + # Honor Boost_ROOT set by boost recipe + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", self._min_cppstd)) # 2019.10.21.00 -> either MSVC_ flags or CXX_STD @@ -183,6 +181,7 @@ def generate(self): tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False tc.variables["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) + tc.preprocessor_definitions["NOMINMAX"] = "" else: tc.variables["CXX_STD"] = cxx_std_value @@ -193,12 +192,35 @@ def generate(self): tc.generate() deps = CMakeDeps(self) + # deps.set_property("backtrace", "cmake_file_name", "Backtrace") + deps.set_property("boost", "cmake_file_name", "Boost") + deps.set_property("bzip2", "cmake_file_name", "BZip2") + deps.set_property("double-conversion", "cmake_file_name", "DoubleConversion") + deps.set_property("fmt", "cmake_file_name", "fmt") + deps.set_property("gflags", "cmake_file_name", "Gflags") + deps.set_property("glog", "cmake_file_name", "Glog") + # deps.set_property("libaio", "cmake_file_name", "LibAIO") + deps.set_property("libdwarf", "cmake_file_name", "LibDwarf") + deps.set_property("libevent", "cmake_file_name", "LibEvent") + deps.set_property("libiberty", "cmake_file_name", "Libiberty") + deps.set_property("libsodium", "cmake_file_name", "Libsodium") + deps.set_property("libunwind", "cmake_file_name", "LibUnwind") + # deps.set_property("liburing", "cmake_file_name", "LibUring") + deps.set_property("lz4", "cmake_file_name", "LZ4") + deps.set_property("openssl", "cmake_file_name", "OpenSSL") + deps.set_property("snappy", "cmake_file_name", "Snappy") + deps.set_property("xz_utils", "cmake_file_name", "LibLZMA") + deps.set_property("zlib", "cmake_file_name", "ZLIB") + deps.set_property("zstd", "cmake_file_name", "Zstd") deps.generate() def _patch_sources(self): apply_conandata_patches(self) folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") - replace_in_file(self, folly_deps, "MODULE", "") + replace_in_file(self, folly_deps, " MODULE", " ") + replace_in_file(self, folly_deps, "OpenSSL 1.1.1", "OpenSSL") + # Disable example + save(self, os.path.join(self.source_folder, "folly", "logging", "example", "CMakeLists.txt"), "") def build(self): self._patch_sources() @@ -325,34 +347,3 @@ def package_info(self): self.cpp_info.components["folly_exception_counter"].set_property("pkg_config_name", "libfolly_exception_counter") self.cpp_info.components["folly_exception_counter"].libs = ["folly_exception_counter"] self.cpp_info.components["folly_exception_counter"].requires = ["folly_exception_tracer"] - - - # Folly release every two weeks and it is hard to maintain cmake scripts. - # This script is used to fix CMake/folly-deps.cmake. - # I attach it here for convenience. All the 00xx-find-packages.patches are generated by this script - # ```shell - # sed -i 's/^find_package(Boost.*$/find_package(Boost /' CMake/folly-deps.cmake - # sed -i 's/DoubleConversion MODULE/double-conversion /ig' CMake/folly-deps.cmake - # sed -i 's/DOUBLE_CONVERSION/double-conversion/ig' CMake/folly-deps.cmake - # sed -i 's/^find_package(Gflags.*$/find_package(gflags REQUIRED)/g' CMake/folly-deps.cmake - # sed -i 's/LIBGFLAGS_FOUND/gflags_FOUND/g' CMake/folly-deps.cmake - # sed -i 's/[^_]LIBGFLAGS_LIBRARY/{gflags_LIBRARIES/' CMake/folly-deps.cmake - # sed -i 's/[^_]LIBGFLAGS_INCLUDE/{gflags_INCLUDE/' CMake/folly-deps.cmake - # sed -i 's/find_package(Glog MODULE)/find_package(glog REQUIRED)/g' CMake/folly-deps.cmake - # sed -i 's/GLOG_/glog_/g' CMake/folly-deps.cmake - # sed -i 's/find_package(LibEvent MODULE/find_package(Libevent /' CMake/folly-deps.cmake - # sed -i 's/LIBEVENT_/Libevent_/ig' CMake/folly-deps.cmake - # sed -i 's/OPENSSL_LIB/OpenSSL_LIB/g' CMake/folly-deps.cmake - # sed -i 's/OPENSSL_INCLUDE/OpenSSL_INCLUDE/g' CMake/folly-deps.cmake - # sed -i 's/BZIP2_/BZip2_/g' CMake/folly-deps.cmake - # sed -i 's/(LZ4/(lz4/g' CMake/folly-deps.cmake - # sed -i 's/LZ4_/lz4_/g' CMake/folly-deps.cmake - # sed -i 's/Zstd /zstd /g' CMake/folly-deps.cmake - # sed -i 's/ZSTD_/zstd_/g' CMake/folly-deps.cmake - # sed -i 's/(LibDwarf/(libdwarf/g' CMake/folly-deps.cmake - # sed -i 's/LIBDWARF_/libdwarf_/g' CMake/folly-deps.cmake - # sed -i 's/Libiberty/libiberty/g' CMake/folly-deps.cmake - # sed -i 's/Libsodium/libsodium/ig' CMake/folly-deps.cmake - # sed -i 's/LibUnwind/libunwind/g' CMake/folly-deps.cmake - # sed -i 's/LibUnwind_/libunwind_/ig' CMake/folly-deps.cmake - # ``` diff --git a/recipes/folly/all/patches/0017-compiler-flags.patch b/recipes/folly/all/patches/0017-compiler-flags.patch index 1290e801ba4ba..f7894a5b8c762 100644 --- a/recipes/folly/all/patches/0017-compiler-flags.patch +++ b/recipes/folly/all/patches/0017-compiler-flags.patch @@ -1,7 +1,5 @@ -diff --git a/CMake/FollyCompilerUnix.cmake b/CMake/FollyCompilerUnix.cmake -index 8dcaf14..200fe8d 100644 ---- a/CMake/FollyCompilerUnix.cmake -+++ b/CMake/FollyCompilerUnix.cmake +--- CMake/FollyCompilerUnix.cmake ++++ CMake/FollyCompilerUnix.cmake @@ -28,9 +28,9 @@ set( ) mark_as_advanced(CXX_STD) @@ -9,8 +7,7 @@ index 8dcaf14..200fe8d 100644 -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}") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3") # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") diff --git a/recipes/folly/all/patches/0019-exclude-example.patch b/recipes/folly/all/patches/0019-exclude-example.patch deleted file mode 100644 index d2afb310ff8a0..0000000000000 --- a/recipes/folly/all/patches/0019-exclude-example.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/folly/CMakeLists.txt b/folly/CMakeLists.txt -index 883f27c..2d2086f 100644 ---- a/folly/CMakeLists.txt -+++ b/folly/CMakeLists.txt -@@ -28,7 +28,6 @@ install( - ) - - add_subdirectory(experimental/exception_tracer) --add_subdirectory(logging/example) - - if (PYTHON_EXTENSIONS) - # Create tree of symbolic links in structure required for successful diff --git a/recipes/folly/all/patches/0025-find-packages.patch b/recipes/folly/all/patches/0025-find-packages.patch deleted file mode 100644 index 1f471ece7d995..0000000000000 --- a/recipes/folly/all/patches/0025-find-packages.patch +++ /dev/null @@ -1,174 +0,0 @@ -diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake -index 989259a87..156d2d861 100644 ---- a/CMake/folly-deps.cmake -+++ b/CMake/folly-deps.cmake -@@ -35,7 +35,7 @@ else() - endif() - set(Boost_USE_STATIC_LIBS "${FOLLY_BOOST_LINK_STATIC}") - --find_package(Boost 1.51.0 MODULE -+find_package(Boost - COMPONENTS - context - filesystem -@@ -48,27 +48,27 @@ find_package(Boost 1.51.0 MODULE - 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(Gflags MODULE) --set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND}) --if(LIBGFLAGS_FOUND) -- list(APPEND FOLLY_LINK_LIBRARIES ${LIBGFLAGS_LIBRARY}) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBGFLAGS_INCLUDE_DIR}) -- set(FOLLY_LIBGFLAGS_LIBRARY ${LIBGFLAGS_LIBRARY}) -- set(FOLLY_LIBGFLAGS_INCLUDE ${LIBGFLAGS_INCLUDE_DIR}) -+find_package(double-conversion REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${double-conversion_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${double-conversion_INCLUDE_DIR}) -+ -+find_package(gflags REQUIRED) -+set(FOLLY_HAVE_LIBGFLAGS ${gflags_FOUND}) -+if(gflags_FOUND) -+ list(APPEND FOLLY_LINK_LIBRARIES ${gflags_LIBRARIES}) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${gflags_INCLUDE_DIR}) -+ set(FOLLY_LIBGFLAGS_LIBRARY ${gflags_LIBRARIES}) -+ set(FOLLY_LIBGFLAGS_INCLUDE ${gflags_INCLUDE_DIR}) - 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(glog REQUIRED) -+set(FOLLY_HAVE_LIBGLOG ${glog_FOUND}) -+list(APPEND FOLLY_LINK_LIBRARIES ${glog_LIBRARY}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${glog_INCLUDE_DIR}) - --find_package(LibEvent MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBEVENT_LIB}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBEVENT_INCLUDE_DIR}) -+find_package(Libevent REQUIRED) -+list(APPEND FOLLY_LINK_LIBRARIES ${Libevent_LIB}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${Libevent_INCLUDE_DIR}) - - find_package(ZLIB MODULE) - set(FOLLY_HAVE_LIBZ ${ZLIB_FOUND}) -@@ -79,22 +79,22 @@ if (ZLIB_FOUND) - endif() - - find_package(OpenSSL 1.1.1 MODULE REQUIRED) --list(APPEND FOLLY_LINK_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OPENSSL_INCLUDE_DIR}) --list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) --list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+list(APPEND FOLLY_LINK_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${OpenSSL_INCLUDE_DIR}) -+list(APPEND CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(APPEND CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) - check_function_exists(ASN1_TIME_diff FOLLY_HAVE_OPENSSL_ASN1_TIME_DIFF) --list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) --list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) -+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${OpenSSL_LIBRARIES}) -+list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${OpenSSL_INCLUDE_DIR}) - if (ZLIB_FOUND) - list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) - endif() - - find_package(BZip2 MODULE) --set(FOLLY_HAVE_LIBBZ2 ${BZIP2_FOUND}) --if (BZIP2_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZIP2_INCLUDE_DIRS}) -- list(APPEND FOLLY_LINK_LIBRARIES ${BZIP2_LIBRARIES}) -+set(FOLLY_HAVE_LIBBZ2 ${BZip2_FOUND}) -+if (BZip2_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${BZip2_INCLUDE_DIRS}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${BZip2_LIBRARIES}) - endif() - - find_package(LibLZMA MODULE) -@@ -104,18 +104,18 @@ if (LIBLZMA_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBLZMA_LIBRARIES}) - endif() - --find_package(LZ4 MODULE) --set(FOLLY_HAVE_LIBLZ4 ${LZ4_FOUND}) --if (LZ4_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LZ4_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${LZ4_LIBRARY}) -+find_package(lz4 MODULE) -+set(FOLLY_HAVE_LIBLZ4 ${lz4_FOUND}) -+if (lz4_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${lz4_LIBRARY}) - endif() - --find_package(Zstd MODULE) --set(FOLLY_HAVE_LIBZSTD ${ZSTD_FOUND}) --if(ZSTD_FOUND) -- list(APPEND FOLLY_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}) -- list(APPEND FOLLY_LINK_LIBRARIES ${ZSTD_LIBRARY}) -+find_package(zstd MODULE) -+set(FOLLY_HAVE_LIBZSTD ${zstd_FOUND}) -+if(zstd_FOUND) -+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIR}) -+ list(APPEND FOLLY_LINK_LIBRARIES ${zstd_LIBRARY}) - endif() - - find_package(Snappy MODULE) -@@ -125,11 +125,11 @@ if (SNAPPY_FOUND) - list(APPEND FOLLY_LINK_LIBRARIES ${SNAPPY_LIBRARY}) - endif() - --find_package(LibDwarf) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBDWARF_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBDWARF_INCLUDE_DIRS}) -+find_package(libdwarf) -+list(APPEND FOLLY_LINK_LIBRARIES ${libdwarf_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libdwarf_INCLUDE_DIRS}) - --find_package(Libiberty) -+find_package(libiberty) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBIBERTY_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBIBERTY_INCLUDE_DIRS}) - -@@ -141,9 +141,9 @@ find_package(LibUring) - list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES}) - list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS}) - --find_package(Libsodium) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS}) -+find_package(libsodium) -+list(APPEND FOLLY_LINK_LIBRARIES ${libsodium_LIBRARIES}) -+list(APPEND FOLLY_INCLUDE_DIRECTORIES ${libsodium_INCLUDE_DIRS}) - - list(APPEND FOLLY_LINK_LIBRARIES ${CMAKE_DL_LIBS}) - list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) -@@ -153,10 +153,10 @@ if (PYTHON_EXTENSIONS) - find_package(Cython 0.26 REQUIRED) - endif () - --find_package(LibUnwind) --list(APPEND FOLLY_LINK_LIBRARIES ${LIBUNWIND_LIBRARIES}) --list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBUNWIND_INCLUDE_DIRS}) --if (LIBUNWIND_FOUND) -+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) - endif() - if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -@@ -173,7 +173,7 @@ CHECK_INCLUDE_FILE_CXX(elf.h FOLLY_HAVE_ELF) - find_package(Backtrace) - - set(FOLLY_HAVE_BACKTRACE ${Backtrace_FOUND}) --set(FOLLY_HAVE_DWARF ${LIBDWARF_FOUND}) -+set(FOLLY_HAVE_DWARF ${libdwarf_FOUND}) - if (NOT WIN32 AND NOT APPLE) - set(FOLLY_USE_SYMBOLIZER ON) - endif() diff --git a/recipes/folly/all/patches/0026-fix-windows-minmax.patch b/recipes/folly/all/patches/0026-fix-windows-minmax.patch deleted file mode 100644 index 24e4b9eac11bd..0000000000000 --- a/recipes/folly/all/patches/0026-fix-windows-minmax.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMake/FollyCompilerMSVC.cmake b/CMake/FollyCompilerMSVC.cmake -index ad03039aa..1c76e0f00 100644 ---- a/CMake/FollyCompilerMSVC.cmake -+++ b/CMake/FollyCompilerMSVC.cmake -@@ -289,6 +289,7 @@ function(apply_folly_compile_options_to_target THETARGET) - # And the extra defines: - target_compile_definitions(${THETARGET} - PUBLIC -+ NOMINMAX - _CRT_NONSTDC_NO_WARNINGS # Don't deprecate posix names of functions. - _CRT_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. - _SCL_SECURE_NO_WARNINGS # Don't deprecate the non _s versions of various standard library functions, because safety is for chumps. From 7cdcb5ace7bd2644244ca75fdd1221bb21975a31 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Thu, 21 Dec 2023 20:26:26 +0200 Subject: [PATCH 055/109] folly: add v2023.12.18.00 --- recipes/folly/all/conandata.yml | 9 ++++++++- ...gs.patch => 2022-001-compiler-flags.patch} | 0 .../all/patches/2023-001-compiler-flags.patch | 19 +++++++++++++++++++ recipes/folly/config.yml | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) rename recipes/folly/all/patches/{0017-compiler-flags.patch => 2022-001-compiler-flags.patch} (100%) create mode 100644 recipes/folly/all/patches/2023-001-compiler-flags.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 6713d46ee3665..79416ef223635 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,9 +1,16 @@ sources: + "2023.12.18.00": + url: "https://github.com/facebook/folly/releases/download/v2023.12.18.00/folly-v2023.12.18.00.tar.gz" + sha256: "57ce880e3ae7b4d4fe0980be64da9e6ca7dd09e2de477670bf984e11cf7739f2" "2022.10.31.00": url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: + "2023.12.18.00": + - patch_file: "patches/2023-001-compiler-flags.patch" + patch_description: "Do not hard-code debug flag for all build types" + patch_type: "conan" "2022.10.31.00": - - patch_file: "patches/0017-compiler-flags.patch" + - patch_file: "patches/2022-001-compiler-flags.patch" patch_description: "Do not hard-code debug flag for all build types" patch_type: "conan" diff --git a/recipes/folly/all/patches/0017-compiler-flags.patch b/recipes/folly/all/patches/2022-001-compiler-flags.patch similarity index 100% rename from recipes/folly/all/patches/0017-compiler-flags.patch rename to recipes/folly/all/patches/2022-001-compiler-flags.patch diff --git a/recipes/folly/all/patches/2023-001-compiler-flags.patch b/recipes/folly/all/patches/2023-001-compiler-flags.patch new file mode 100644 index 0000000000000..728a3771575bf --- /dev/null +++ b/recipes/folly/all/patches/2023-001-compiler-flags.patch @@ -0,0 +1,19 @@ +--- CMake/FollyCompilerUnix.cmake ++++ CMake/FollyCompilerUnix.cmake +@@ -12,7 +12,7 @@ + # 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") + +@@ -25,7 +25,6 @@ + ) + target_compile_options(${THETARGET} + PRIVATE +- -g + -finput-charset=UTF-8 + -fsigned-char + -Wall diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 00d12a3887049..53e32a839994d 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,3 +1,5 @@ versions: + "2023.12.18.00": + folder: all "2022.10.31.00": folder: all From c90074fde0196365da149a693b8ac5ea69f84c25 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Fri, 12 Jan 2024 22:56:06 +0000 Subject: [PATCH 056/109] folly: fix ambiguity between package cmake target and libfolly cmake target --- recipes/folly/all/conanfile.py | 86 +++++++++++++++------------------- 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index fdb391df3694a..5b062093e1bb5 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -89,6 +89,14 @@ def requirements(self): def _required_boost_components(self): return ["context", "filesystem", "program_options", "regex", "system", "thread"] + @property + def _required_boost_conan_components(self): + return [f"boost::{comp}" for comp in self._required_boost_components] + + @property + def _required_boost_cmake_targets(self): + return [f"Boost::{comp}" for comp in self._required_boost_components] + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) @@ -237,24 +245,13 @@ def package(self): def package_info(self): self.cpp_info.set_property("cmake_file_name", "folly") - self.cpp_info.set_property("cmake_target_name", "Folly::folly") + self.cpp_info.set_property("cmake_target_name", "folly::folly") self.cpp_info.set_property("pkg_config_name", "libfolly") - if self.settings.os in ["Linux", "FreeBSD"]: - self.cpp_info.components["libfolly"].libs = [ - "folly_exception_counter", - "folly_exception_tracer", - "folly_exception_tracer_base", - ] - self.cpp_info.components["libfolly"].libs += [ - "folly_test_util", - "follybenchmark", - "folly" - ] - - self.cpp_info.components["libfolly"].requires = [ - "boost::context", "boost::filesystem", "boost::program_options", "boost::regex", "boost::system", "boost::thread", - "bzip2::bzip2", + self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") + self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") + self.cpp_info.components["libfolly"].libs = ["folly"] + self.cpp_info.components["libfolly"].requires = ["fmt::fmt"] + self._required_boost_conan_components + [ "double-conversion::double-conversion", "gflags::gflags", "glog::glog", @@ -272,19 +269,14 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) - - self.cpp_info.components["libfolly"].requires.append("fmt::fmt") - if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) - elif self.settings.os == "Windows": self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) if str(self.settings.compiler.libcxx) == "libstdc++" or ( self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) == "9.0" and - self.settings.compiler.libcxx == "libc++" - ): + self.settings.compiler.libcxx == "libc++"): self.cpp_info.components["libfolly"].system_libs.append("atomic") if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": @@ -296,24 +288,6 @@ def package_info(self): if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "9": self.cpp_info.components["libfolly"].system_libs.append("stdc++fs" if self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] else "c++fs") - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.filenames["cmake_find_package"] = "folly" - self.cpp_info.filenames["cmake_find_package_multi"] = "folly" - self.cpp_info.names["cmake_find_package"] = "Folly" - self.cpp_info.names["cmake_find_package_multi"] = "Folly" - self.cpp_info.names["pkg_config"] = "libfolly" - self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" - self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" - - self.cpp_info.components["libfolly"].set_property("cmake_target_name", "Folly::folly") - self.cpp_info.components["libfolly"].set_property("pkg_config_name", "libfolly") - - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.components["follybenchmark"].names["cmake_find_package"] = "follybenchmark" - self.cpp_info.components["follybenchmark"].names["cmake_find_package_multi"] = "follybenchmark" - self.cpp_info.components["folly_test_util"].names["cmake_find_package"] = "folly_test_util" - self.cpp_info.components["folly_test_util"].names["cmake_find_package_multi"] = "folly_test_util" - self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] @@ -325,14 +299,6 @@ def package_info(self): self.cpp_info.components["folly_test_util"].requires = ["libfolly"] if self.settings.os in ["Linux", "FreeBSD"]: - # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed - self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base" - self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package_multi"] = "folly_exception_tracer_base" - self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package"] = "folly_exception_tracer" - self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package_multi"] = "folly_exception_tracer" - self.cpp_info.components["folly_exception_counter"].names["cmake_find_package"] = "folly_exception_counter" - self.cpp_info.components["folly_exception_counter"].names["cmake_find_package_multi"] = "folly_exception_counter" - self.cpp_info.components["folly_exception_tracer_base"].set_property("cmake_target_name", "Folly::folly_exception_tracer_base") self.cpp_info.components["folly_exception_tracer_base"].set_property("pkg_config_name", "libfolly_exception_tracer_base") self.cpp_info.components["folly_exception_tracer_base"].libs = ["folly_exception_tracer_base"] @@ -347,3 +313,27 @@ def package_info(self): self.cpp_info.components["folly_exception_counter"].set_property("pkg_config_name", "libfolly_exception_counter") self.cpp_info.components["folly_exception_counter"].libs = ["folly_exception_counter"] self.cpp_info.components["folly_exception_counter"].requires = ["folly_exception_tracer"] + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.filenames["cmake_find_package"] = "folly" + self.cpp_info.filenames["cmake_find_package_multi"] = "folly" + self.cpp_info.names["cmake_find_package"] = "Folly" + self.cpp_info.names["cmake_find_package_multi"] = "Folly" + self.cpp_info.names["pkg_config"] = "libfolly" + self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" + self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" + + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.components["follybenchmark"].names["cmake_find_package"] = "follybenchmark" + self.cpp_info.components["follybenchmark"].names["cmake_find_package_multi"] = "follybenchmark" + self.cpp_info.components["folly_test_util"].names["cmake_find_package"] = "folly_test_util" + self.cpp_info.components["folly_test_util"].names["cmake_find_package_multi"] = "folly_test_util" + + if self.settings.os in ["Linux", "FreeBSD"]: + # TODO: to remove in conan v2 once cmake_find_package_* & pkg_config generators removed + self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package"] = "folly_exception_tracer_base" + self.cpp_info.components["folly_exception_tracer_base"].names["cmake_find_package_multi"] = "folly_exception_tracer_base" + self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package"] = "folly_exception_tracer" + self.cpp_info.components["folly_exception_tracer"].names["cmake_find_package_multi"] = "folly_exception_tracer" + self.cpp_info.components["folly_exception_counter"].names["cmake_find_package"] = "folly_exception_counter" + self.cpp_info.components["folly_exception_counter"].names["cmake_find_package_multi"] = "folly_exception_counter" From de8fa74ac5ac6cf46e680f85533f42d87b55aafd Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sat, 13 Jan 2024 11:19:02 +0000 Subject: [PATCH 057/109] Add missing libfolly dependency --- recipes/folly/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 5b062093e1bb5..d248f9d329f4b 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -83,7 +83,7 @@ def requirements(self): if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") self.requires("libunwind/1.7.2") - self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) + self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -258,6 +258,7 @@ def package_info(self): "libevent::libevent", "lz4::lz4", "openssl::openssl", + "bzip2::bzip2", "snappy::snappy", "zlib::zlib", "zstd::zstd", From 2bee3527700e53e16ebd4f4eb8dc83a465f0a980 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 14 Jan 2024 19:41:03 +0000 Subject: [PATCH 058/109] Do not allow static glog if building shared folly --- recipes/folly/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index d248f9d329f4b..54df35129e6e8 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -121,6 +121,10 @@ def validate(self): if self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") + glog = self.dependencies["glog"] + if self.options.shared and not glog.options.shared: + raise ConanInvalidConfiguration(f"If Folly is built as shared lib, glog must be a shared lib too.") + boost = self.dependencies["boost"] if boost.options.header_only: raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") From bb319ff7e45dc29dff8ac1499d7c567d4264ae46 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Sun, 14 Jan 2024 20:57:56 +0000 Subject: [PATCH 059/109] Leave fixing recipe for macos for the future --- recipes/folly/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 54df35129e6e8..b553167f4bcc3 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -109,6 +109,9 @@ def validate(self): if is_apple_os(self) and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") + if is_apple_os(self): + raise ConanInvalidConfiguration("Current recipe doesn't support Macos. Contributions are welcome.") + if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") From de46f2177821edad833d4280dbf837a0608ded29 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Mon, 15 Jan 2024 09:21:56 +0000 Subject: [PATCH 060/109] Link only boost components specified in requirements --- recipes/folly/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index b553167f4bcc3..2875ae67eefaf 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -233,6 +233,7 @@ def _patch_sources(self): apply_conandata_patches(self) folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " ") + replace_in_file(self, folly_deps, "${Boost_LIBRARIES}", f"{' '.join(self._required_boost_cmake_targets)}") replace_in_file(self, folly_deps, "OpenSSL 1.1.1", "OpenSSL") # Disable example save(self, os.path.join(self.source_folder, "folly", "logging", "example", "CMakeLists.txt"), "") From 8f81d79a4bdfe08b9ae4b58cae8c488d92d86cf4 Mon Sep 17 00:00:00 2001 From: Pau Farre Date: Thu, 4 Apr 2024 14:47:43 +0000 Subject: [PATCH 061/109] Refactor conan_deps.cmake --- recipes/folly/all/conan_deps.cmake | 31 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake index bdc0907f2db08..b82b9a2c56133 100644 --- a/recipes/folly/all/conan_deps.cmake +++ b/recipes/folly/all/conan_deps.cmake @@ -1,21 +1,28 @@ # Set the dependency flags expected by https://github.com/facebook/folly/blob/v2023.12.18.00/CMake/folly-deps.cmake -macro(custom_find_package name var) - find_package(${name} ${ARGN} +macro(custom_find_package package_name variable_prefix) + find_package(${package_name} ${ARGN} # Allow only Conan packages NO_DEFAULT_PATH PATHS ${CMAKE_PREFIX_PATH} ) - set(${var}_FOUND TRUE) - set(${var}_VERSION ${${name}_VERSION}) - set(${var}_VERSION_STRING ${${name}_VERSION_STRING}) - set(${var}_INCLUDE_DIRS ${${name}_INCLUDE_DIRS}) - set(${var}_INCLUDE_DIR ${${name}_INCLUDE_DIR}) - set(${var}_INCLUDE ${${name}_INCLUDE_DIR}) - set(${var}_LIB ${${name}_LIBRARIES}) - set(${var}_LIBRARY ${${name}_LIBRARIES}) - set(${var}_LIBRARIES ${${name}_LIBRARIES}) - set(${var}_DEFINITIONS ${${name}_DEFINITIONS}) + list(APPEND FROM FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE_DIR LIBRARIES LIBRARIES LIBRARIES DEFINITIONS) + list(APPEND TO FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE LIB LIBRARY LIBRARIES DEFINITIONS) + + foreach (from_substr to_substr IN ZIP_LISTS FROM TO) + set(src_var ${package_name}_${from_substr}) + set(dst_var ${variable_prefix}_${to_substr}) + if (NOT DEFINED ${src_var}) + # if Conan doesn't define any content for one of the properties + continue() + endif() + if ((DEFINED ${dst_var}) AND ("${${dst_var}}" STREQUAL "${${src_var}}")) + # if they're equal, skip + continue() + endif() + message(STATUS "custom_find_package definining ${dst_var} with ${src_var} contents: ${${src_var}}") + set(${dst_var} ${${src_var}}) + endforeach() endmacro() custom_find_package(BZip2 BZIP2) From 79768564137983ef0be5ca006b829929d813b6bc Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 27 May 2024 17:50:31 +0300 Subject: [PATCH 062/109] folly: bump deps, fix version conflicts --- recipes/folly/all/conanfile.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 2875ae67eefaf..904b7915a051d 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -64,26 +64,26 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.83.0", transitive_headers=True, transitive_libs=True) + self.requires("boost/1.84.0", transitive_headers=True, transitive_libs=True) self.requires("bzip2/1.0.8") self.requires("double-conversion/3.3.0", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") - self.requires("glog/0.6.0", transitive_headers=True, transitive_libs=True) + self.requires("glog/0.7.0", transitive_headers=True, transitive_libs=True) self.requires("libevent/2.1.12", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]") self.requires("lz4/1.9.4", transitive_libs=True) - self.requires("snappy/1.1.10") + self.requires("snappy/1.2.1") self.requires("zlib/[>=1.2.11 <2]") self.requires("zstd/1.5.5", transitive_libs=True) if not is_msvc(self): - self.requires("libdwarf/20191104") + self.requires("libdwarf/0.9.1") self.requires("libsodium/1.0.19") self.requires("xz_utils/5.4.5") - # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.2.1") + # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.3.0") if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") - self.requires("libunwind/1.7.2") - self.requires("fmt/10.1.1", transitive_headers=True, transitive_libs=True) + self.requires("libunwind/1.8.0") + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) @property def _required_boost_components(self): @@ -92,11 +92,11 @@ def _required_boost_components(self): @property def _required_boost_conan_components(self): return [f"boost::{comp}" for comp in self._required_boost_components] - + @property def _required_boost_cmake_targets(self): return [f"Boost::{comp}" for comp in self._required_boost_components] - + def validate(self): if self.settings.compiler.cppstd: check_min_cppstd(self, self._min_cppstd) @@ -111,7 +111,7 @@ def validate(self): if is_apple_os(self): raise ConanInvalidConfiguration("Current recipe doesn't support Macos. Contributions are welcome.") - + if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") @@ -127,7 +127,7 @@ def validate(self): glog = self.dependencies["glog"] if self.options.shared and not glog.options.shared: raise ConanInvalidConfiguration(f"If Folly is built as shared lib, glog must be a shared lib too.") - + boost = self.dependencies["boost"] if boost.options.header_only: raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") From f7fdc840cc5fd274bb1a68d0ef49beca073a4130 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 27 May 2024 18:47:32 +0300 Subject: [PATCH 063/109] folly: add latest version, drop -g patch, fix missing include --- recipes/folly/all/conandata.yml | 20 +++++++++--------- .../all/patches/001-add-missing-include.patch | 10 +++++++++ .../all/patches/2022-001-compiler-flags.patch | 21 ------------------- .../all/patches/2023-001-compiler-flags.patch | 19 ----------------- recipes/folly/config.yml | 2 +- 5 files changed, 21 insertions(+), 51 deletions(-) create mode 100644 recipes/folly/all/patches/001-add-missing-include.patch delete mode 100644 recipes/folly/all/patches/2022-001-compiler-flags.patch delete mode 100644 recipes/folly/all/patches/2023-001-compiler-flags.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 79416ef223635..17a5498645166 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,16 +1,16 @@ sources: - "2023.12.18.00": - url: "https://github.com/facebook/folly/releases/download/v2023.12.18.00/folly-v2023.12.18.00.tar.gz" - sha256: "57ce880e3ae7b4d4fe0980be64da9e6ca7dd09e2de477670bf984e11cf7739f2" + "2024.05.27.00": + url: "https://github.com/facebook/folly/releases/download/v2024.05.27.00/folly-v2024.05.27.00.tar.gz" + sha256: "8299499b2d7e52ef68f0d4229fb16bf913d965bf9d122a9467005f8d3b1a8aad" "2022.10.31.00": url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: - "2023.12.18.00": - - patch_file: "patches/2023-001-compiler-flags.patch" - patch_description: "Do not hard-code debug flag for all build types" - patch_type: "conan" + "2024.05.27.00": + - patch_file: "patches/001-add-missing-include.patch" + patch_description: "Add a missing include to Elf.cpp" + patch_type: "bugfix" "2022.10.31.00": - - patch_file: "patches/2022-001-compiler-flags.patch" - patch_description: "Do not hard-code debug flag for all build types" - patch_type: "conan" + - patch_file: "patches/001-add-missing-include.patch" + patch_description: "Add a missing include to Elf.cpp" + patch_type: "bugfix" diff --git a/recipes/folly/all/patches/001-add-missing-include.patch b/recipes/folly/all/patches/001-add-missing-include.patch new file mode 100644 index 0000000000000..b2699d3068c79 --- /dev/null +++ b/recipes/folly/all/patches/001-add-missing-include.patch @@ -0,0 +1,10 @@ +--- folly/experimental/symbolizer/Elf.cpp ++++ folly/experimental/symbolizer/Elf.cpp +@@ -20,6 +20,7 @@ + #include + #include + #include + #include ++#include + + #include diff --git a/recipes/folly/all/patches/2022-001-compiler-flags.patch b/recipes/folly/all/patches/2022-001-compiler-flags.patch deleted file mode 100644 index f7894a5b8c762..0000000000000 --- a/recipes/folly/all/patches/2022-001-compiler-flags.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- CMake/FollyCompilerUnix.cmake -+++ CMake/FollyCompilerUnix.cmake -@@ -28,9 +28,9 @@ set( - ) - mark_as_advanced(CXX_STD) - --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") - - # Note that CMAKE_REQUIRED_FLAGS must be a string, not a list - set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}") -@@ -43,7 +43,6 @@ function(apply_folly_compile_options_to_target THETARGET) - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -std=${CXX_STD} - -finput-charset=UTF-8 - -fsigned-char diff --git a/recipes/folly/all/patches/2023-001-compiler-flags.patch b/recipes/folly/all/patches/2023-001-compiler-flags.patch deleted file mode 100644 index 728a3771575bf..0000000000000 --- a/recipes/folly/all/patches/2023-001-compiler-flags.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- CMake/FollyCompilerUnix.cmake -+++ CMake/FollyCompilerUnix.cmake -@@ -12,7 +12,7 @@ - # 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") - -@@ -25,7 +25,6 @@ - ) - target_compile_options(${THETARGET} - PRIVATE -- -g - -finput-charset=UTF-8 - -fsigned-char - -Wall diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 53e32a839994d..7bf4e087570ab 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,5 +1,5 @@ versions: - "2023.12.18.00": + "2024.05.27.00": folder: all "2022.10.31.00": folder: all From 1820e38540dfc61c844fda860ab3b4986b662e83 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 27 May 2024 21:07:14 +0300 Subject: [PATCH 064/109] folly: update min GCC version --- recipes/folly/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 904b7915a051d..ef9eb72db8cea 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -39,7 +39,8 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): return { - "gcc": "7", + # https://github.com/facebook/folly/commit/3e001b85f4cbfcf962a696b89c1284a00083fce1 + "gcc": "8" if Version(self.version) >= "2024.04.01.00" else "7", "Visual Studio": "16", "msvc": "192", "clang": "6", From 539cfb7de63d703e8f93be9ef364ea6859d0d286 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 27 May 2024 21:10:30 +0300 Subject: [PATCH 065/109] folly: CMP0075 is set by project since 2019 --- recipes/folly/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index ef9eb72db8cea..fb659a8e1220f 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -184,8 +184,6 @@ def generate(self): tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" - # Honor CMAKE_REQUIRED_LIBRARIES in check_include_file_xxx - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0075"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" # Honor Boost_ROOT set by boost recipe From 0c8f174095c9e58d69fc0af46b162161c1ba358b Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 27 May 2024 22:51:31 +0300 Subject: [PATCH 066/109] folly: use is_msvc_static_runtime() --- recipes/folly/all/conanfile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index fb659a8e1220f..dcd8ef71903c5 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import can_run, check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, save -from conan.tools.microsoft import is_msvc, msvc_runtime_flag +from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -161,7 +161,7 @@ def _cppstd_flag_value(self, cppstd): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_PROJECT_folly_INCLUDE"] = os.path.join(self.source_folder, "conan_deps.cmake") + tc.cache_variables["CMAKE_PROJECT_folly_INCLUDE"] = "conan_deps.cmake" if can_run(self): for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: @@ -194,7 +194,7 @@ def generate(self): if is_msvc(self): tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False - tc.variables["MSVC_USE_STATIC_RUNTIME"] = "MT" in msvc_runtime_flag(self) + tc.variables["MSVC_USE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.preprocessor_definitions["NOMINMAX"] = "" else: tc.variables["CXX_STD"] = cxx_std_value From 9eb644f30d22b240cf91af72919eadc864b81c3e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 15 Jul 2024 17:36:42 +0300 Subject: [PATCH 067/109] folly: bump to v2024.07.08.00 --- recipes/folly/all/conandata.yml | 8 ++++---- recipes/folly/config.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 17a5498645166..9d603fcaaf8f3 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,12 +1,12 @@ sources: - "2024.05.27.00": - url: "https://github.com/facebook/folly/releases/download/v2024.05.27.00/folly-v2024.05.27.00.tar.gz" - sha256: "8299499b2d7e52ef68f0d4229fb16bf913d965bf9d122a9467005f8d3b1a8aad" + "2024.07.08.00": + url: "https://github.com/facebook/folly/releases/download/v2024.07.08.00/folly-v2024.07.08.00.tar.gz" + sha256: "07ce0bf5017189ef758145217aa1d6b3f70cffec24b25d3a53fd7a595a8ddd7b" "2022.10.31.00": url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: - "2024.05.27.00": + "2024.07.08.00": - patch_file: "patches/001-add-missing-include.patch" patch_description: "Add a missing include to Elf.cpp" patch_type: "bugfix" diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 7bf4e087570ab..8b8010195c08f 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,5 +1,5 @@ versions: - "2024.05.27.00": + "2024.07.08.00": folder: all "2022.10.31.00": folder: all From 4c387bf16c3bd567302a557b5fc483445595bcc5 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 15 Jul 2024 17:59:46 +0300 Subject: [PATCH 068/109] folly: drop v2022.10.31.00 Focus on getting the latest version working first. --- recipes/folly/all/conandata.yml | 7 ------- recipes/folly/config.yml | 3 +-- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 9d603fcaaf8f3..1c1d5584bd698 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -2,15 +2,8 @@ sources: "2024.07.08.00": url: "https://github.com/facebook/folly/releases/download/v2024.07.08.00/folly-v2024.07.08.00.tar.gz" sha256: "07ce0bf5017189ef758145217aa1d6b3f70cffec24b25d3a53fd7a595a8ddd7b" - "2022.10.31.00": - url: "https://github.com/facebook/folly/releases/download/v2022.10.31.00/folly-v2022.10.31.00.tar.gz" - sha256: "d7749f78eee2a327c1fa6b4a290e4bcd7115cdd7f7ef59f9e043ed59e597ab30" patches: "2024.07.08.00": - patch_file: "patches/001-add-missing-include.patch" patch_description: "Add a missing include to Elf.cpp" patch_type: "bugfix" - "2022.10.31.00": - - patch_file: "patches/001-add-missing-include.patch" - patch_description: "Add a missing include to Elf.cpp" - patch_type: "bugfix" diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 8b8010195c08f..1f515b7486301 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,5 +1,4 @@ versions: "2024.07.08.00": folder: all - "2022.10.31.00": - folder: all + From bcc7f066da21239fecbea1b9b6b0502448b58e8c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 15 Jul 2024 18:04:00 +0300 Subject: [PATCH 069/109] folly: update min compiler versions --- recipes/folly/all/conanfile.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index dcd8ef71903c5..e27aa61739308 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -38,13 +38,13 @@ def _min_cppstd(self): @property def _compilers_minimum_version(self): + # https://github.com/facebook/folly/blob/v2024.07.08.00/folly/Portability.h return { - # https://github.com/facebook/folly/commit/3e001b85f4cbfcf962a696b89c1284a00083fce1 - "gcc": "8" if Version(self.version) >= "2024.04.01.00" else "7", - "Visual Studio": "16", - "msvc": "192", - "clang": "6", + "gcc": "10", + "clang": "10", "apple-clang": "10", + "msvc": "192", + "Visual Studio": "16", } def export_sources(self): From e9a890572236a0353de9a309bcac421eb6b1adbc Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 15 Jul 2024 19:06:13 +0300 Subject: [PATCH 070/109] folly: workaround for CMAKE_PROJECT_folly_INCLUDE --- recipes/folly/all/conanfile.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index e27aa61739308..ca191d5356e93 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -161,8 +161,6 @@ def _cppstd_flag_value(self, cppstd): def generate(self): tc = CMakeToolchain(self) - tc.cache_variables["CMAKE_PROJECT_folly_INCLUDE"] = "conan_deps.cmake" - if can_run(self): for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: tc.variables[f"{var}_EXITCODE"] = "0" @@ -230,10 +228,17 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) + + # -DCMAKE_PROJECT_folly_INCLUDE=conan_deps.cmake does not work in C3I for some reason, force the inclusion + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), + "project(${PACKAGE_NAME} CXX C ASM)", + "project(${PACKAGE_NAME} CXX C ASM)\ninclude(conan_deps.cmake)") + folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " ") replace_in_file(self, folly_deps, "${Boost_LIBRARIES}", f"{' '.join(self._required_boost_cmake_targets)}") replace_in_file(self, folly_deps, "OpenSSL 1.1.1", "OpenSSL") + # Disable example save(self, os.path.join(self.source_folder, "folly", "logging", "example", "CMakeLists.txt"), "") From 7b61ad4e5046227f35257ec4878b37491ea2bc03 Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Mon, 15 Jul 2024 23:04:46 +0300 Subject: [PATCH 071/109] folly: bump to v2024.07.15.00 --- recipes/folly/all/conandata.yml | 4 ++-- recipes/folly/config.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 1c1d5584bd698..1515ea08307eb 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,9 +1,9 @@ sources: - "2024.07.08.00": + "2024.07.15.00": url: "https://github.com/facebook/folly/releases/download/v2024.07.08.00/folly-v2024.07.08.00.tar.gz" sha256: "07ce0bf5017189ef758145217aa1d6b3f70cffec24b25d3a53fd7a595a8ddd7b" patches: - "2024.07.08.00": + "2024.07.15.00": - patch_file: "patches/001-add-missing-include.patch" patch_description: "Add a missing include to Elf.cpp" patch_type: "bugfix" diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 1f515b7486301..9a70d37e10397 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,4 +1,4 @@ versions: - "2024.07.08.00": + "2024.07.15.00": folder: all From eccca58513c01fe14896903d8b1e63d71cbf5944 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 14 Aug 2024 14:31:10 +0200 Subject: [PATCH 072/109] Follow official patch Signed-off-by: Uilian Ries --- recipes/folly/all/conandata.yml | 1 + recipes/folly/all/patches/001-add-missing-include.patch | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 1515ea08307eb..091fa680d97f2 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -7,3 +7,4 @@ patches: - patch_file: "patches/001-add-missing-include.patch" patch_description: "Add a missing include to Elf.cpp" patch_type: "bugfix" + patch_source: "https://github.com/facebook/folly/pull/2245" diff --git a/recipes/folly/all/patches/001-add-missing-include.patch b/recipes/folly/all/patches/001-add-missing-include.patch index b2699d3068c79..9b81f55d30eaa 100644 --- a/recipes/folly/all/patches/001-add-missing-include.patch +++ b/recipes/folly/all/patches/001-add-missing-include.patch @@ -5,6 +5,6 @@ #include #include #include -+#include - ++#include + #include From bf40b9f11488146cb9b7bbd82d641611f377c3d1 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 10:04:22 +0200 Subject: [PATCH 073/109] Improve invalid conf messages Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index ca191d5356e93..0a949a54c4f86 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -103,40 +103,39 @@ def validate(self): check_min_cppstd(self, self._min_cppstd) minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False) if minimum_version and Version(self.settings.compiler.version) < minimum_version: - raise ConanInvalidConfiguration( - f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." - ) + raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") if is_apple_os(self) and self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Conan currently requires a 64bit target architecture for Folly on Macos") + # TODO: Validate this rule!! + raise ConanInvalidConfiguration(f"{self.ref} currently requires a 64bit target architecture for Folly on Macos.") if is_apple_os(self): - raise ConanInvalidConfiguration("Current recipe doesn't support Macos. Contributions are welcome.") + raise ConanInvalidConfiguration(f"{self.ref} current recipe doesn't support Macos. Contributions are welcome!") if self.settings.os == "Windows" and self.settings.arch != "x86_64": - raise ConanInvalidConfiguration("Folly requires a 64bit target architecture on Windows") + raise ConanInvalidConfiguration(f"{self.ref} Folly requires a 64bit target architecture on Windows.") if (is_apple_os(self) or self.settings.os == "Windows") and self.options.shared: - raise ConanInvalidConfiguration(f"Folly could not be built on {self.settings.os} as shared library") + raise ConanInvalidConfiguration(f"{self.ref} Folly could not be built on {self.settings.os} as shared library. Please, use static library.") if self.settings.os == "Windows": - raise ConanInvalidConfiguration(f"{self.ref} could not be built on {self.settings.os}. PR's are welcome.") + raise ConanInvalidConfiguration(f"{self.ref} could not be built on {self.settings.os}. Contributions are welcome!") if self.settings.compiler == "clang" and self.options.shared: - raise ConanInvalidConfiguration(f"Folly {self.version} could not be built by clang as a shared library") + raise ConanInvalidConfiguration(f"{self.ref} could not be built by clang as a shared library.") glog = self.dependencies["glog"] if self.options.shared and not glog.options.shared: - raise ConanInvalidConfiguration(f"If Folly is built as shared lib, glog must be a shared lib too.") + raise ConanInvalidConfiguration(f"{self.ref} and {glog.ref} must be both shared or both static.") boost = self.dependencies["boost"] if boost.options.header_only: - raise ConanInvalidConfiguration("Folly could not be built with a header only Boost") + raise ConanInvalidConfiguration(f"{self.ref} could not be built with a header only Boost. Use -o 'boost/*:header_only=False'") miss_boost_required_comp = any(getattr(boost.options, f"without_{boost_comp}", True) for boost_comp in self._required_boost_components) if miss_boost_required_comp: required_components = ", ".join(self._required_boost_components) - raise ConanInvalidConfiguration(f"Folly requires these boost components: {required_components}") + raise ConanInvalidConfiguration(f"{self.ref} requires these Boost components: {required_components}. Try with '-o boost/*:without_{required_components}=False'") if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") From b90107a0f79f511b0d958f692cb62d5dd78a9dda Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 10:04:44 +0200 Subject: [PATCH 074/109] Remove folly custom find cmake files Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 0a949a54c4f86..3fc1ab43a4394 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.apple import is_apple_os from conan.tools.build import can_run, check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, save +from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, save, rm from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -240,6 +240,9 @@ def _patch_sources(self): # Disable example save(self, os.path.join(self.source_folder, "folly", "logging", "example", "CMakeLists.txt"), "") + # Ensure only consume Conan dependencies + rm(self, "Find*.cmake", os.path.join(self.source_folder, "CMake")) + rm(self, "Find*.cmake", os.path.join(self.source_folder, "build", "fbcode_builder", "CMake")) def build(self): self._patch_sources() From 0e0772451d80e18ba0f405ac6d58296dfe6e48f9 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 10:05:29 +0200 Subject: [PATCH 075/109] Add version 2024.08.12.00 Signed-off-by: Uilian Ries --- recipes/folly/all/conandata.yml | 3 +++ recipes/folly/config.yml | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 091fa680d97f2..67bdcc2006f93 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "2024.08.12.00": + url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" + sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" "2024.07.15.00": url: "https://github.com/facebook/folly/releases/download/v2024.07.08.00/folly-v2024.07.08.00.tar.gz" sha256: "07ce0bf5017189ef758145217aa1d6b3f70cffec24b25d3a53fd7a595a8ddd7b" diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 9a70d37e10397..86c91b22b9cc5 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,4 +1,5 @@ versions: + "2024.08.12.00": + folder: all "2024.07.15.00": folder: all - From 47b753a15de0e11c1060770a9790c4c0ec9c9278 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 10:07:35 +0200 Subject: [PATCH 076/109] Use cmake cache variables Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 3fc1ab43a4394..74bda9b69c7d9 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -162,8 +162,8 @@ def generate(self): if can_run(self): for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: - tc.variables[f"{var}_EXITCODE"] = "0" - tc.variables[f"{var}_EXITCODE__TRYRUN_OUTPUT"] = "" + tc.cache_variables[f"{var}_EXITCODE"] = "0" + tc.cache_variables[f"{var}_EXITCODE__TRYRUN_OUTPUT"] = "" if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ["x86", "x86_64"]: tc.preprocessor_definitions["FOLLY_SSE"] = "4" @@ -178,7 +178,7 @@ def generate(self): ) # Folly is not respecting this from the helper https://github.com/conan-io/conan-center-index/pull/15726/files#r1097068754 - tc.variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) + tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) @@ -189,12 +189,12 @@ def generate(self): cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", self._min_cppstd)) # 2019.10.21.00 -> either MSVC_ flags or CXX_STD if is_msvc(self): - tc.variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value - tc.variables["MSVC_ENABLE_ALL_WARNINGS"] = False - tc.variables["MSVC_USE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) + tc.cache_variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value + tc.cache_variables["MSVC_ENABLE_ALL_WARNINGS"] = False + tc.cache_variables["MSVC_USE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.preprocessor_definitions["NOMINMAX"] = "" else: - tc.variables["CXX_STD"] = cxx_std_value + tc.cache_variables["CXX_STD"] = cxx_std_value if not self.dependencies["boost"].options.header_only: tc.cache_variables["BOOST_LINK_STATIC"] = not self.dependencies["boost"].options.shared From cfb41affefc2efaecef270cf3aa526f17bad5c65 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 12:49:29 +0200 Subject: [PATCH 077/109] Simplify test package Signed-off-by: Uilian Ries --- .../folly/all/test_package/test_package.cpp | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/recipes/folly/all/test_package/test_package.cpp b/recipes/folly/all/test_package/test_package.cpp index cc522b8b0280d..9a9bda5906bbe 100644 --- a/recipes/folly/all/test_package/test_package.cpp +++ b/recipes/folly/all/test_package/test_package.cpp @@ -1,29 +1,12 @@ #include #include -#include + #include -#include -#include -#include #include -#if FOLLY_HAVE_ELF -#include -#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 promise; - folly::Future future = promise.getSemiFuture().via(&executor); - folly::Future unit = std::move(future).thenValue(print_uri); - promise.setValue("https://github.com/bincrafters"); - std::move(unit).get(); -#if FOLLY_HAVE_ELF - folly::symbolizer::ElfFile elffile; -#endif + folly::fbstring message{"The answer is {}."}; + std::cout << folly::format(message, 42); return EXIT_SUCCESS; } From 36b1853d2100da7effad4f7ca5122a47ecf943f4 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 12:51:37 +0200 Subject: [PATCH 078/109] Remove folly version from tests Signed-off-by: Uilian Ries --- recipes/folly/all/test_package/conanfile.py | 2 -- recipes/folly/all/test_v1_package/conanfile.py | 1 - 2 files changed, 3 deletions(-) diff --git a/recipes/folly/all/test_package/conanfile.py b/recipes/folly/all/test_package/conanfile.py index 182ad8fa961d0..7aa104bd186ed 100644 --- a/recipes/folly/all/test_package/conanfile.py +++ b/recipes/folly/all/test_package/conanfile.py @@ -3,7 +3,6 @@ from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.build import can_run -required_conan_version = ">=1.43.0" class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" @@ -15,7 +14,6 @@ def requirements(self): def generate(self): tc = CMakeToolchain(self) - tc.variables["FOLLY_VERSION"] = self.dependencies["folly"].ref.version tc.generate() def layout(self): diff --git a/recipes/folly/all/test_v1_package/conanfile.py b/recipes/folly/all/test_v1_package/conanfile.py index 7ab5b10bfbe4b..49a3a66ea5bad 100644 --- a/recipes/folly/all/test_v1_package/conanfile.py +++ b/recipes/folly/all/test_v1_package/conanfile.py @@ -8,7 +8,6 @@ class TestPackageConan(ConanFile): def build(self): cmake = CMake(self) - cmake.definitions["FOLLY_VERSION"] = self.deps_cpp_info["folly"].version cmake.configure() cmake.build() From 9952a04214922fecf41bc8d49152bd1f6e77f0d8 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 12:52:28 +0200 Subject: [PATCH 079/109] Require cmake 3.17 for conan_deps.cmake Signed-off-by: Uilian Ries --- recipes/folly/all/conan_deps.cmake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake index b82b9a2c56133..358b5744e0ae0 100644 --- a/recipes/folly/all/conan_deps.cmake +++ b/recipes/folly/all/conan_deps.cmake @@ -1,7 +1,8 @@ +cmake_minimum_required(VERSION 3.17) # Set the dependency flags expected by https://github.com/facebook/folly/blob/v2023.12.18.00/CMake/folly-deps.cmake macro(custom_find_package package_name variable_prefix) - find_package(${package_name} ${ARGN} + find_package(${package_name} REQUIRED CONFIG ${ARGN} # Allow only Conan packages NO_DEFAULT_PATH PATHS ${CMAKE_PREFIX_PATH} @@ -13,20 +14,18 @@ macro(custom_find_package package_name variable_prefix) set(src_var ${package_name}_${from_substr}) set(dst_var ${variable_prefix}_${to_substr}) if (NOT DEFINED ${src_var}) - # if Conan doesn't define any content for one of the properties continue() endif() if ((DEFINED ${dst_var}) AND ("${${dst_var}}" STREQUAL "${${src_var}}")) # if they're equal, skip continue() endif() - message(STATUS "custom_find_package definining ${dst_var} with ${src_var} contents: ${${src_var}}") + message(DEBUG "custom_find_package definining ${dst_var} with ${src_var} contents: ${${src_var}}") set(${dst_var} ${${src_var}}) endforeach() endmacro() custom_find_package(BZip2 BZIP2) -custom_find_package(Backtrace BACKTRACE) custom_find_package(DoubleConversion DOUBLE_CONVERSION REQUIRED) custom_find_package(Gflags LIBGFLAGS) custom_find_package(Glog GLOG) From b37802137a9362b4a83a950cb0b66f67b64b752c Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 12:52:58 +0200 Subject: [PATCH 080/109] Update dependencies versions Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 74bda9b69c7d9..130a3d31fa56a 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -8,7 +8,8 @@ from conan.tools.scm import Version import os -required_conan_version = ">=1.53.0" + +required_conan_version = ">=1.54.0" class FollyConan(ConanFile): @@ -65,26 +66,34 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("boost/1.84.0", transitive_headers=True, transitive_libs=True) + self.requires("boost/1.85.0", transitive_headers=True, transitive_libs=True) self.requires("bzip2/1.0.8") self.requires("double-conversion/3.3.0", transitive_headers=True, transitive_libs=True) self.requires("gflags/2.2.2") - self.requires("glog/0.7.0", transitive_headers=True, transitive_libs=True) + self.requires("glog/0.7.1", transitive_headers=True, transitive_libs=True) self.requires("libevent/2.1.12", transitive_headers=True, transitive_libs=True) self.requires("openssl/[>=1.1 <4]") - self.requires("lz4/1.9.4", transitive_libs=True) + self.requires("lz4/1.10.0", transitive_libs=True) self.requires("snappy/1.2.1") self.requires("zlib/[>=1.2.11 <2]") - self.requires("zstd/1.5.5", transitive_libs=True) + self.requires("zstd/[~1.5.5]", transitive_libs=True) if not is_msvc(self): self.requires("libdwarf/0.9.1") self.requires("libsodium/1.0.19") - self.requires("xz_utils/5.4.5") - # FIXME: Causing compilation issues on clang: self.requires("jemalloc/5.3.0") + self.requires("xz_utils/[>=5.4.5 <6]") + # FIXME: Causing compilation issues on clang: + # self.requires("jemalloc/5.3.0") if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") self.requires("libunwind/1.8.0") - self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) + if self.settings.os == "Linux": + self.requires("libaio/0.3.113") + self.requires("liburing/2.6") + self.requires("fmt/11.0.2", transitive_headers=True, transitive_libs=True) + + def build_requirements(self): + # INFO: Required due ZIP_LISTS CMake feature in conan_deps.cmake + self.tool_requires("cmake/[>=3.17 <4]") @property def _required_boost_components(self): @@ -159,6 +168,7 @@ def _cppstd_flag_value(self, cppstd): def generate(self): tc = CMakeToolchain(self) + tc.variables["CMAKE_PROJECT_folly_INCLUDE"] = "conan_deps.cmake" if can_run(self): for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: @@ -203,20 +213,19 @@ def generate(self): tc.generate() deps = CMakeDeps(self) - # deps.set_property("backtrace", "cmake_file_name", "Backtrace") deps.set_property("boost", "cmake_file_name", "Boost") deps.set_property("bzip2", "cmake_file_name", "BZip2") deps.set_property("double-conversion", "cmake_file_name", "DoubleConversion") deps.set_property("fmt", "cmake_file_name", "fmt") deps.set_property("gflags", "cmake_file_name", "Gflags") deps.set_property("glog", "cmake_file_name", "Glog") - # deps.set_property("libaio", "cmake_file_name", "LibAIO") deps.set_property("libdwarf", "cmake_file_name", "LibDwarf") deps.set_property("libevent", "cmake_file_name", "LibEvent") deps.set_property("libiberty", "cmake_file_name", "Libiberty") + deps.set_property("libaio", "cmake_file_name", "LibAIO") deps.set_property("libsodium", "cmake_file_name", "Libsodium") deps.set_property("libunwind", "cmake_file_name", "LibUnwind") - # deps.set_property("liburing", "cmake_file_name", "LibUring") + deps.set_property("liburing", "cmake_file_name", "LibUring") deps.set_property("lz4", "cmake_file_name", "LZ4") deps.set_property("openssl", "cmake_file_name", "OpenSSL") deps.set_property("snappy", "cmake_file_name", "Snappy") @@ -227,14 +236,8 @@ def generate(self): def _patch_sources(self): apply_conandata_patches(self) - - # -DCMAKE_PROJECT_folly_INCLUDE=conan_deps.cmake does not work in C3I for some reason, force the inclusion - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "project(${PACKAGE_NAME} CXX C ASM)", - "project(${PACKAGE_NAME} CXX C ASM)\ninclude(conan_deps.cmake)") - folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") - replace_in_file(self, folly_deps, " MODULE", " ") + replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") replace_in_file(self, folly_deps, "${Boost_LIBRARIES}", f"{' '.join(self._required_boost_cmake_targets)}") replace_in_file(self, folly_deps, "OpenSSL 1.1.1", "OpenSSL") @@ -277,12 +280,14 @@ def package_info(self): "zlib::zlib", "zstd::zstd", "libsodium::libsodium", - "xz_utils::xz_utils" + "xz_utils::xz_utils", ] if not is_msvc(self): self.cpp_info.components["libfolly"].requires.append("libdwarf::libdwarf") if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) + if self.settings.os == "Linux": + self.cpp_info.components["libfolly"].requires.extend(["libaio::libaio", "liburing::liburing"]) self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) elif self.settings.os == "Windows": @@ -334,7 +339,6 @@ def package_info(self): self.cpp_info.filenames["cmake_find_package_multi"] = "folly" self.cpp_info.names["cmake_find_package"] = "Folly" self.cpp_info.names["cmake_find_package_multi"] = "Folly" - self.cpp_info.names["pkg_config"] = "libfolly" self.cpp_info.components["libfolly"].names["cmake_find_package"] = "folly" self.cpp_info.components["libfolly"].names["cmake_find_package_multi"] = "folly" From 50aefdd57b145ba006d7361fbf6f6e149d4821da Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 12:56:48 +0200 Subject: [PATCH 081/109] Exclude 2024.07.15.00 Signed-off-by: Uilian Ries --- recipes/folly/all/conandata.yml | 9 --------- recipes/folly/all/conanfile.py | 4 +--- .../folly/all/patches/001-add-missing-include.patch | 10 ---------- recipes/folly/config.yml | 2 -- 4 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 recipes/folly/all/patches/001-add-missing-include.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index 67bdcc2006f93..a21030554ee04 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -2,12 +2,3 @@ sources: "2024.08.12.00": url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" - "2024.07.15.00": - url: "https://github.com/facebook/folly/releases/download/v2024.07.08.00/folly-v2024.07.08.00.tar.gz" - sha256: "07ce0bf5017189ef758145217aa1d6b3f70cffec24b25d3a53fd7a595a8ddd7b" -patches: - "2024.07.15.00": - - patch_file: "patches/001-add-missing-include.patch" - patch_description: "Add a missing include to Elf.cpp" - patch_type: "bugfix" - patch_source: "https://github.com/facebook/folly/pull/2245" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 130a3d31fa56a..f5d7fcc7936e9 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -3,7 +3,7 @@ from conan.tools.apple import is_apple_os from conan.tools.build import can_run, check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file, save, rm +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -49,7 +49,6 @@ def _compilers_minimum_version(self): } def export_sources(self): - export_conandata_patches(self) copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): @@ -235,7 +234,6 @@ def generate(self): deps.generate() def _patch_sources(self): - apply_conandata_patches(self) folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") replace_in_file(self, folly_deps, "${Boost_LIBRARIES}", f"{' '.join(self._required_boost_cmake_targets)}") diff --git a/recipes/folly/all/patches/001-add-missing-include.patch b/recipes/folly/all/patches/001-add-missing-include.patch deleted file mode 100644 index 9b81f55d30eaa..0000000000000 --- a/recipes/folly/all/patches/001-add-missing-include.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- folly/experimental/symbolizer/Elf.cpp -+++ folly/experimental/symbolizer/Elf.cpp -@@ -20,6 +20,7 @@ - #include - #include - #include - #include -+#include - - #include diff --git a/recipes/folly/config.yml b/recipes/folly/config.yml index 86c91b22b9cc5..e799fbeee0433 100644 --- a/recipes/folly/config.yml +++ b/recipes/folly/config.yml @@ -1,5 +1,3 @@ versions: "2024.08.12.00": folder: all - "2024.07.15.00": - folder: all From b04f2be1a0cc5a7b234bca8c16b1bad6d42126bd Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:04:40 +0200 Subject: [PATCH 082/109] Remove not used defines Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index f5d7fcc7936e9..da4f463ddd91d 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -172,7 +172,6 @@ def generate(self): if can_run(self): for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: tc.cache_variables[f"{var}_EXITCODE"] = "0" - tc.cache_variables[f"{var}_EXITCODE__TRYRUN_OUTPUT"] = "" if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ["x86", "x86_64"]: tc.preprocessor_definitions["FOLLY_SSE"] = "4" @@ -189,21 +188,21 @@ def generate(self): # Folly is not respecting this from the helper https://github.com/conan-io/conan-center-index/pull/15726/files#r1097068754 tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) # Relocatable shared lib on Macos - tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" + if is_apple_os(self): + tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0042"] = "NEW" # Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840) tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW" # Honor Boost_ROOT set by boost recipe tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0074"] = "NEW" - cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", self._min_cppstd)) + # 2019.10.21.00 -> either MSVC_ flags or CXX_STD if is_msvc(self): + cxx_std_value = self._cppstd_flag_value(self.settings.get_safe("compiler.cppstd", self._min_cppstd)) tc.cache_variables["MSVC_LANGUAGE_VERSION"] = cxx_std_value tc.cache_variables["MSVC_ENABLE_ALL_WARNINGS"] = False tc.cache_variables["MSVC_USE_STATIC_RUNTIME"] = is_msvc_static_runtime(self) tc.preprocessor_definitions["NOMINMAX"] = "" - else: - tc.cache_variables["CXX_STD"] = cxx_std_value if not self.dependencies["boost"].options.header_only: tc.cache_variables["BOOST_LINK_STATIC"] = not self.dependencies["boost"].options.shared From e89f385c9b057f78054694f9599b45ff176186ca Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:19:20 +0200 Subject: [PATCH 083/109] Update boost modules based on headers Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index da4f463ddd91d..fea5b0c5bcfd0 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -96,7 +96,8 @@ def build_requirements(self): @property def _required_boost_components(self): - return ["context", "filesystem", "program_options", "regex", "system", "thread"] + return ["context", "crc", "filesystem", "multi-index", "program_options", "regex", + "smart-ptr", "system", "thread", "variant"] @property def _required_boost_conan_components(self): From 0f501d9673713ba7ae4802b73e356398c5b9824b Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:34:55 +0200 Subject: [PATCH 084/109] Solve version conflict Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index fea5b0c5bcfd0..80795ce6fbcbc 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -75,7 +75,7 @@ def requirements(self): self.requires("lz4/1.10.0", transitive_libs=True) self.requires("snappy/1.2.1") self.requires("zlib/[>=1.2.11 <2]") - self.requires("zstd/[~1.5.5]", transitive_libs=True) + self.requires("zstd/1.5.5", transitive_libs=True) if not is_msvc(self): self.requires("libdwarf/0.9.1") self.requires("libsodium/1.0.19") @@ -96,7 +96,7 @@ def build_requirements(self): @property def _required_boost_components(self): - return ["context", "crc", "filesystem", "multi-index", "program_options", "regex", + return ["context", "filesystem", "multi-index", "program_options", "regex", "smart-ptr", "system", "thread", "variant"] @property From 22877a7db495f3e54ae9674c79183dc9c657fb22 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:37:37 +0200 Subject: [PATCH 085/109] Fix required boost modules Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 80795ce6fbcbc..b3633fd292048 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -96,8 +96,7 @@ def build_requirements(self): @property def _required_boost_components(self): - return ["context", "filesystem", "multi-index", "program_options", "regex", - "smart-ptr", "system", "thread", "variant"] + return ["context", "filesystem", "program_options", "regex", "system", "thread"] @property def _required_boost_conan_components(self): From 2905247bf814ce12573d12599106cc7810e632a0 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:47:43 +0200 Subject: [PATCH 086/109] Enable dependencies based on system Signed-off-by: Uilian Ries --- recipes/folly/all/conan_deps.cmake | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake index 358b5744e0ae0..171977506b3d1 100644 --- a/recipes/folly/all/conan_deps.cmake +++ b/recipes/folly/all/conan_deps.cmake @@ -30,16 +30,21 @@ custom_find_package(DoubleConversion DOUBLE_CONVERSION REQUIRED) custom_find_package(Gflags LIBGFLAGS) custom_find_package(Glog GLOG) custom_find_package(LZ4 LZ4) -custom_find_package(LibAIO LIBAIO) -custom_find_package(LibDwarf LIBDWARF) custom_find_package(LibEvent LIBEVENT REQUIRED) custom_find_package(LibLZMA LIBLZMA) -custom_find_package(LibUnwind LIBUNWIND) -custom_find_package(LibUring LIBURING) -custom_find_package(Libiberty LIBIBERTY) custom_find_package(Libsodium LIBSODIUM) custom_find_package(OpenSSL OPENSSL REQUIRED) custom_find_package(Snappy SNAPPY) custom_find_package(ZLIB ZLIB) custom_find_package(Zstd ZSTD) custom_find_package(fmt FMT REQUIRED) + +if (NOT MSVC) + custom_find_package(LibDwarf LIBDWARF) +endif() +if (UNIX AND NOT APPLE) + custom_find_package(LibAIO LIBAIO) + custom_find_package(LibUring LIBURING) + custom_find_package(LibUnwind LIBUNWIND) + custom_find_package(Libiberty LIBIBERTY) +endif() \ No newline at end of file From 1b79357bb250f6a2383e9fb7cd255b660aa4e4a1 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:56:40 +0200 Subject: [PATCH 087/109] Avoid folly format due deprecation Signed-off-by: Uilian Ries --- recipes/folly/all/test_package/test_package.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/folly/all/test_package/test_package.cpp b/recipes/folly/all/test_package/test_package.cpp index 9a9bda5906bbe..247e44f76e0fd 100644 --- a/recipes/folly/all/test_package/test_package.cpp +++ b/recipes/folly/all/test_package/test_package.cpp @@ -2,11 +2,11 @@ #include #include -#include +#include int main() { - folly::fbstring message{"The answer is {}."}; - std::cout << folly::format(message, 42); + folly::fbstring address{"127.0.0.1"}; + folly::IPAddress::validate(address); return EXIT_SUCCESS; } From 55762a6462de461127d2abaf39bc9241a39edc11 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 13:58:47 +0200 Subject: [PATCH 088/109] Drop apple restriction Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index b3633fd292048..0e0602c021ad5 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -113,13 +113,6 @@ def validate(self): if minimum_version and Version(self.settings.compiler.version) < minimum_version: raise ConanInvalidConfiguration(f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support.") - if is_apple_os(self) and self.settings.arch != "x86_64": - # TODO: Validate this rule!! - raise ConanInvalidConfiguration(f"{self.ref} currently requires a 64bit target architecture for Folly on Macos.") - - if is_apple_os(self): - raise ConanInvalidConfiguration(f"{self.ref} current recipe doesn't support Macos. Contributions are welcome!") - if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration(f"{self.ref} Folly requires a 64bit target architecture on Windows.") From fa85fb5c7fa53dc48262077a06fcdaf8204f3f4d Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 16 Aug 2024 14:05:41 +0200 Subject: [PATCH 089/109] Drop Windows restriction Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 0e0602c021ad5..5afa0575a78b0 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -116,12 +116,9 @@ def validate(self): if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration(f"{self.ref} Folly requires a 64bit target architecture on Windows.") - if (is_apple_os(self) or self.settings.os == "Windows") and self.options.shared: + if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} Folly could not be built on {self.settings.os} as shared library. Please, use static library.") - if self.settings.os == "Windows": - raise ConanInvalidConfiguration(f"{self.ref} could not be built on {self.settings.os}. Contributions are welcome!") - if self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} could not be built by clang as a shared library.") From 548d364d7d61669e1d38ca996fd3d4dbe63af4b7 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 08:51:48 +0200 Subject: [PATCH 090/109] Drop sse4 option Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 5afa0575a78b0..2aea12ebd0006 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -1,7 +1,8 @@ from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os -from conan.tools.build import can_run, check_min_cppstd +from conan.tools.build import check_min_cppstd, cross_building +from conan.tools.env import VirtualBuildEnv from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm from conan.tools.microsoft import is_msvc, is_msvc_static_runtime @@ -25,12 +26,10 @@ class FollyConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "use_sse4_2": [True, False], } default_options = { "shared": False, "fPIC": True, - "use_sse4_2": False } @property @@ -54,8 +53,6 @@ def export_sources(self): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - if str(self.settings.arch) not in ["x86", "x86_64"]: - del self.options.use_sse4_2 def configure(self): if self.options.shared: @@ -135,9 +132,6 @@ def validate(self): required_components = ", ".join(self._required_boost_components) raise ConanInvalidConfiguration(f"{self.ref} requires these Boost components: {required_components}. Try with '-o boost/*:without_{required_components}=False'") - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) not in ['x86', 'x86_64']: - raise ConanInvalidConfiguration(f"{self.ref} can use the option use_sse4_2 only on x86 and x86_64 archs.") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=False) @@ -156,24 +150,16 @@ def _cppstd_flag_value(self, cppstd): return f"{prefix}++{year}" def generate(self): + env = VirtualBuildEnv(self) + env.generate() tc = CMakeToolchain(self) tc.variables["CMAKE_PROJECT_folly_INCLUDE"] = "conan_deps.cmake" - if can_run(self): + if is_apple_os(self) and cross_building(self): + # INFO: Folly fails to configure Mac M1 -> Mac Intel: + # CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately: HAVE_VSNPRINTF_ERRORS_EXITCODE (advanced) for var in ["FOLLY_HAVE_UNALIGNED_ACCESS", "FOLLY_HAVE_LINUX_VDSO", "FOLLY_HAVE_WCHAR_SUPPORT", "HAVE_VSNPRINTF_ERRORS"]: - tc.cache_variables[f"{var}_EXITCODE"] = "0" - - if self.options.get_safe("use_sse4_2") and str(self.settings.arch) in ["x86", "x86_64"]: - tc.preprocessor_definitions["FOLLY_SSE"] = "4" - tc.preprocessor_definitions["FOLLY_SSE_MINOR"] = "2" - if not is_msvc(self): - cflags = "-mfma" - else: - cflags = "/arch:FMA" - tc.blocks["cmake_flags_init"].template += ( - f'string(APPEND CMAKE_CXX_FLAGS_INIT " {cflags}")\n' - f'string(APPEND CMAKE_C_FLAGS_INIT " {cflags}")\n' - ) + tc.cache_variables[f"{var}_EXITCODE"] = 0 # Folly is not respecting this from the helper https://github.com/conan-io/conan-center-index/pull/15726/files#r1097068754 tc.cache_variables["CMAKE_POSITION_INDEPENDENT_CODE"] = self.options.get_safe("fPIC", True) From d2994e0cceeb412912ceea4991d0ed61df8f67e4 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 09:14:52 +0200 Subject: [PATCH 091/109] Drop jemalloc Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 2aea12ebd0006..16c49314a1979 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -77,8 +77,6 @@ def requirements(self): self.requires("libdwarf/0.9.1") self.requires("libsodium/1.0.19") self.requires("xz_utils/[>=5.4.5 <6]") - # FIXME: Causing compilation issues on clang: - # self.requires("jemalloc/5.3.0") if self.settings.os in ["Linux", "FreeBSD"]: self.requires("libiberty/9.1.0") self.requires("libunwind/1.8.0") From fd8afd1cf4a550a455b79fd4d76e229740e4c226 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 11:04:27 +0200 Subject: [PATCH 092/109] Skip apple clang <=13 Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 16c49314a1979..79163658b1311 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -117,6 +117,10 @@ def validate(self): if self.settings.compiler == "clang" and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} could not be built by clang as a shared library.") + if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14.0": + # + raise ConanInvalidConfiguration(f"{self.ref} could not be built by apple-clang < 14.0.") + glog = self.dependencies["glog"] if self.options.shared and not glog.options.shared: raise ConanInvalidConfiguration(f"{self.ref} and {glog.ref} must be both shared or both static.") From 8398ca167b1c7e963460a943e29c2733a3fb50da Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 12:01:59 +0200 Subject: [PATCH 093/109] Enable shared build with Clang in Linux Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 79163658b1311..fa5e779cd4e96 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -114,12 +114,9 @@ def validate(self): if self.settings.os == "Windows" and self.options.shared: raise ConanInvalidConfiguration(f"{self.ref} Folly could not be built on {self.settings.os} as shared library. Please, use static library.") - if self.settings.compiler == "clang" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} could not be built by clang as a shared library.") - if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14.0": - # - raise ConanInvalidConfiguration(f"{self.ref} could not be built by apple-clang < 14.0.") + # https://github.com/facebook/folly/issues/2266 + raise ConanInvalidConfiguration(f"{self.ref} could not be built by apple-clang < 14.0. Use apple-clang >= 14.0") glog = self.dependencies["glog"] if self.options.shared and not glog.options.shared: From 2fcd3252fa7ff80b00a4bcf78d89a306795831a9 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 12:10:37 +0200 Subject: [PATCH 094/109] Require Apple clang 14 Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index fa5e779cd4e96..c359ff484a005 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -42,7 +42,7 @@ def _compilers_minimum_version(self): return { "gcc": "10", "clang": "10", - "apple-clang": "10", + "apple-clang": "14", "msvc": "192", "Visual Studio": "16", } From 59b8dfd20e1e2b657a52c229e71803068230d651 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 12:27:57 +0200 Subject: [PATCH 095/109] Drop glog restriction Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index c359ff484a005..0edbc1ba1f0fd 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -118,10 +118,6 @@ def validate(self): # https://github.com/facebook/folly/issues/2266 raise ConanInvalidConfiguration(f"{self.ref} could not be built by apple-clang < 14.0. Use apple-clang >= 14.0") - glog = self.dependencies["glog"] - if self.options.shared and not glog.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} and {glog.ref} must be both shared or both static.") - boost = self.dependencies["boost"] if boost.options.header_only: raise ConanInvalidConfiguration(f"{self.ref} could not be built with a header only Boost. Use -o 'boost/*:header_only=False'") From 1319de437c158f1684e8733f19e907ada07e634f Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 19 Aug 2024 15:19:40 +0200 Subject: [PATCH 096/109] Downgrade fmt to version 10.x due Windows Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 0edbc1ba1f0fd..c25bf34650486 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -57,6 +57,10 @@ def config_options(self): def configure(self): if self.options.shared: self.options.rm_safe("fPIC") + if is_msvc(self): + # Folly does not support shared library on Windows: https://github.com/facebook/folly/issues/962 + self.package_type = "static-library" + del self.options.shared def layout(self): cmake_layout(self, src_folder="src") @@ -83,7 +87,8 @@ def requirements(self): if self.settings.os == "Linux": self.requires("libaio/0.3.113") self.requires("liburing/2.6") - self.requires("fmt/11.0.2", transitive_headers=True, transitive_libs=True) + # INFO: FMT 11.x is not compatible in Windows due utf-8: https://github.com/facebook/folly/issues/2250 + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) def build_requirements(self): # INFO: Required due ZIP_LISTS CMake feature in conan_deps.cmake @@ -111,9 +116,6 @@ def validate(self): if self.settings.os == "Windows" and self.settings.arch != "x86_64": raise ConanInvalidConfiguration(f"{self.ref} Folly requires a 64bit target architecture on Windows.") - if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration(f"{self.ref} Folly could not be built on {self.settings.os} as shared library. Please, use static library.") - if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version) < "14.0": # https://github.com/facebook/folly/issues/2266 raise ConanInvalidConfiguration(f"{self.ref} could not be built by apple-clang < 14.0. Use apple-clang >= 14.0") @@ -139,7 +141,7 @@ def _cppstd_flag_value(self, cppstd): prefix = "c" year = cppstd if is_msvc(self): - prefix = "" + prefix = "c" if year > "17": year = "latest" return f"{prefix}++{year}" @@ -261,10 +263,9 @@ def package_info(self): elif self.settings.os == "Windows": self.cpp_info.components["libfolly"].system_libs.extend(["ws2_32", "iphlpapi", "crypt32"]) - if str(self.settings.compiler.libcxx) == "libstdc++" or ( - self.settings.compiler == "apple-clang" and - Version(self.settings.compiler.version.value) == "9.0" and - self.settings.compiler.libcxx == "libc++"): + if self.settings.get_safe("compiler.libcxx") == "libstdc++" or \ + (self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) == "9.0" and \ + self.settings.get_safe("compiler.libcxx") == "libc++"): self.cpp_info.components["libfolly"].system_libs.append("atomic") if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": From d407212e0c52eec4d96abe6cbcbadc34847be588 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 08:41:50 +0200 Subject: [PATCH 097/109] Add support for fmt-11 Signed-off-by: Uilian Ries --- recipes/folly/all/conandata.yml | 6 ++++++ recipes/folly/all/conanfile.py | 11 ++++++----- recipes/folly/all/patches/0001-support-fmt11.patch | 12 ++++++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 recipes/folly/all/patches/0001-support-fmt11.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index a21030554ee04..b8fc33abf6795 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -2,3 +2,9 @@ sources: "2024.08.12.00": url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" +patches: + "2024.08.12.00": + - patch_file: "patches/0001-support-fmt11.patch" + patch_source: "https://github.com/facebook/folly/issues/2250" + patch_type: "portabilty" + patch_description: "Fix CMake generator expression for fmt-11" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index c25bf34650486..5b71782be2f46 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -48,6 +48,7 @@ def _compilers_minimum_version(self): } def export_sources(self): + export_conandata_patches(self) copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): @@ -87,8 +88,7 @@ def requirements(self): if self.settings.os == "Linux": self.requires("libaio/0.3.113") self.requires("liburing/2.6") - # INFO: FMT 11.x is not compatible in Windows due utf-8: https://github.com/facebook/folly/issues/2250 - self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) + self.requires("fmt/11.0.2", transitive_headers=True, transitive_libs=True) def build_requirements(self): # INFO: Required due ZIP_LISTS CMake feature in conan_deps.cmake @@ -206,14 +206,15 @@ def generate(self): deps.generate() def _patch_sources(self): + apply_conandata_patches(self) + # Make sure will consume Conan dependencies folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") replace_in_file(self, folly_deps, "${Boost_LIBRARIES}", f"{' '.join(self._required_boost_cmake_targets)}") replace_in_file(self, folly_deps, "OpenSSL 1.1.1", "OpenSSL") - # Disable example save(self, os.path.join(self.source_folder, "folly", "logging", "example", "CMakeLists.txt"), "") - # Ensure only consume Conan dependencies + # Disable custom find modules to use Conan CMakeDeps instead rm(self, "Find*.cmake", os.path.join(self.source_folder, "CMake")) rm(self, "Find*.cmake", os.path.join(self.source_folder, "build", "fbcode_builder", "CMake")) diff --git a/recipes/folly/all/patches/0001-support-fmt11.patch b/recipes/folly/all/patches/0001-support-fmt11.patch new file mode 100644 index 0000000000000..f8d60de8e57f7 --- /dev/null +++ b/recipes/folly/all/patches/0001-support-fmt11.patch @@ -0,0 +1,12 @@ +diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake +index 0e93175..501c5c0 100644 +--- a/CMake/GenPkgConfig.cmake ++++ b/CMake/GenPkgConfig.cmake +@@ -98,6 +98,7 @@ function(gen_pkgconfig_vars) + # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. + # Before CMake 3.19 there's no way to solve this in a general way, so we + # work around the specific case. See #1414 and CMake bug #21074. ++ string(REPLACE "<$:/utf-8>" "/utf-8" cflags "${cflags}") + if(CMAKE_VERSION VERSION_LESS 3.19) + string(REPLACE + "" "" From 9f0a7398efd75505a3092d72572f5468d434aeb3 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 08:44:50 +0200 Subject: [PATCH 098/109] Try to fix gflags check in msvc Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 5b71782be2f46..0d2f3ec864c67 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -151,6 +151,8 @@ def generate(self): env.generate() tc = CMakeToolchain(self) tc.variables["CMAKE_PROJECT_folly_INCLUDE"] = "conan_deps.cmake" + # Folly fails to check Gflags: https://github.com/conan-io/conan/issues/12012 + tc.variables["CMAKE_TRY_COMPILE_CONFIGURATION"] = str(self.settings.build_type) if is_apple_os(self) and cross_building(self): # INFO: Folly fails to configure Mac M1 -> Mac Intel: From 09cefbb6049ff4fc88acbc7efc7bdab7b7fa8360 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 12:11:33 +0200 Subject: [PATCH 099/109] Drop libaio dependency Signed-off-by: Uilian Ries --- recipes/folly/all/conan_deps.cmake | 1 - recipes/folly/all/conanfile.py | 10 +--------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake index 171977506b3d1..f4b1df9eb8ce3 100644 --- a/recipes/folly/all/conan_deps.cmake +++ b/recipes/folly/all/conan_deps.cmake @@ -43,7 +43,6 @@ if (NOT MSVC) custom_find_package(LibDwarf LIBDWARF) endif() if (UNIX AND NOT APPLE) - custom_find_package(LibAIO LIBAIO) custom_find_package(LibUring LIBURING) custom_find_package(LibUnwind LIBUNWIND) custom_find_package(Libiberty LIBIBERTY) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 0d2f3ec864c67..213fcfea25e0a 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -86,7 +86,6 @@ def requirements(self): self.requires("libiberty/9.1.0") self.requires("libunwind/1.8.0") if self.settings.os == "Linux": - self.requires("libaio/0.3.113") self.requires("liburing/2.6") self.requires("fmt/11.0.2", transitive_headers=True, transitive_libs=True) @@ -195,7 +194,6 @@ def generate(self): deps.set_property("libdwarf", "cmake_file_name", "LibDwarf") deps.set_property("libevent", "cmake_file_name", "LibEvent") deps.set_property("libiberty", "cmake_file_name", "Libiberty") - deps.set_property("libaio", "cmake_file_name", "LibAIO") deps.set_property("libsodium", "cmake_file_name", "Libsodium") deps.set_property("libunwind", "cmake_file_name", "LibUnwind") deps.set_property("liburing", "cmake_file_name", "LibUring") @@ -260,7 +258,7 @@ def package_info(self): if self.settings.os in ["Linux", "FreeBSD"]: self.cpp_info.components["libfolly"].requires.extend(["libiberty::libiberty", "libunwind::libunwind"]) if self.settings.os == "Linux": - self.cpp_info.components["libfolly"].requires.extend(["libaio::libaio", "liburing::liburing"]) + self.cpp_info.components["libfolly"].requires.append("liburing::liburing") self.cpp_info.components["libfolly"].system_libs.extend(["pthread", "dl", "rt"]) self.cpp_info.components["libfolly"].defines.extend(["FOLLY_HAVE_ELF", "FOLLY_HAVE_DWARF"]) elif self.settings.os == "Windows": @@ -274,12 +272,6 @@ def package_info(self): if self.settings.compiler == "apple-clang" and Version(self.settings.compiler.version.value) >= "11.0": self.cpp_info.components["libfolly"].system_libs.append("c++abi") - if self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "9": - self.cpp_info.components["libfolly"].system_libs.append("stdc++fs") - - if self.settings.compiler == "clang" and Version(self.settings.compiler.version) < "9": - self.cpp_info.components["libfolly"].system_libs.append("stdc++fs" if self.settings.compiler.libcxx in ["libstdc++", "libstdc++11"] else "c++fs") - self.cpp_info.components["follybenchmark"].set_property("cmake_target_name", "Folly::follybenchmark") self.cpp_info.components["follybenchmark"].set_property("pkg_config_name", "libfollybenchmark") self.cpp_info.components["follybenchmark"].libs = ["follybenchmark"] From f9ce3edd384af0b765eff308661c655ea5c60c57 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 12:56:12 +0200 Subject: [PATCH 100/109] Simplify cpp flag for windows Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 213fcfea25e0a..6af40143cdfea 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -132,15 +132,9 @@ def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=False) def _cppstd_flag_value(self, cppstd): - cppstd = str(cppstd) - if cppstd.startswith("gnu"): - prefix = "gnu" - year = cppstd[3:] - else: - prefix = "c" - year = cppstd if is_msvc(self): prefix = "c" + year = str(cppstd) if year > "17": year = "latest" return f"{prefix}++{year}" From 4b4b95c650a26b9efbbb4a2e98836777d8364062 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 13:03:52 +0200 Subject: [PATCH 101/109] Avoid generating .pc file Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 6af40143cdfea..0fe0f1488c509 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -211,6 +211,8 @@ def _patch_sources(self): # Disable custom find modules to use Conan CMakeDeps instead rm(self, "Find*.cmake", os.path.join(self.source_folder, "CMake")) rm(self, "Find*.cmake", os.path.join(self.source_folder, "build", "fbcode_builder", "CMake")) + # Skip generating .pc file to avoid Windows errors when trying to compile with pkg-config + replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), "gen_pkgconfig_vars(FOLLY_PKGCONFIG folly_deps)", "") def build(self): self._patch_sources() From 37a450230fff4cc8865a557477efc17fe9b70ca8 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 13:04:56 +0200 Subject: [PATCH 102/109] Avoid using fmt-11 patch Signed-off-by: Uilian Ries --- recipes/folly/all/conandata.yml | 6 ------ recipes/folly/all/conanfile.py | 4 +--- recipes/folly/all/patches/0001-support-fmt11.patch | 12 ------------ 3 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 recipes/folly/all/patches/0001-support-fmt11.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index b8fc33abf6795..a21030554ee04 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -2,9 +2,3 @@ sources: "2024.08.12.00": url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" -patches: - "2024.08.12.00": - - patch_file: "patches/0001-support-fmt11.patch" - patch_source: "https://github.com/facebook/folly/issues/2250" - patch_type: "portabilty" - patch_description: "Fix CMake generator expression for fmt-11" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 0fe0f1488c509..6b28d7b5c0dc6 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -48,7 +48,6 @@ def _compilers_minimum_version(self): } def export_sources(self): - export_conandata_patches(self) copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): @@ -200,7 +199,6 @@ def generate(self): deps.generate() def _patch_sources(self): - apply_conandata_patches(self) # Make sure will consume Conan dependencies folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") diff --git a/recipes/folly/all/patches/0001-support-fmt11.patch b/recipes/folly/all/patches/0001-support-fmt11.patch deleted file mode 100644 index f8d60de8e57f7..0000000000000 --- a/recipes/folly/all/patches/0001-support-fmt11.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake -index 0e93175..501c5c0 100644 ---- a/CMake/GenPkgConfig.cmake -+++ b/CMake/GenPkgConfig.cmake -@@ -98,6 +98,7 @@ function(gen_pkgconfig_vars) - # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. - # Before CMake 3.19 there's no way to solve this in a general way, so we - # work around the specific case. See #1414 and CMake bug #21074. -+ string(REPLACE "<$:/utf-8>" "/utf-8" cflags "${cflags}") - if(CMAKE_VERSION VERSION_LESS 3.19) - string(REPLACE - "" "" From 57abdc0ccef8645d93fcee9e826d1427de069991 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Tue, 20 Aug 2024 13:56:31 +0200 Subject: [PATCH 103/109] Revert "Avoid using fmt-11 patch" This reverts commit 37a450230fff4cc8865a557477efc17fe9b70ca8. --- recipes/folly/all/conandata.yml | 6 ++++++ recipes/folly/all/conanfile.py | 4 +++- recipes/folly/all/patches/0001-support-fmt11.patch | 12 ++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 recipes/folly/all/patches/0001-support-fmt11.patch diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index a21030554ee04..b8fc33abf6795 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -2,3 +2,9 @@ sources: "2024.08.12.00": url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" +patches: + "2024.08.12.00": + - patch_file: "patches/0001-support-fmt11.patch" + patch_source: "https://github.com/facebook/folly/issues/2250" + patch_type: "portabilty" + patch_description: "Fix CMake generator expression for fmt-11" diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 6b28d7b5c0dc6..0fe0f1488c509 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm, export_conandata_patches, apply_conandata_patches from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -48,6 +48,7 @@ def _compilers_minimum_version(self): } def export_sources(self): + export_conandata_patches(self) copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): @@ -199,6 +200,7 @@ def generate(self): deps.generate() def _patch_sources(self): + apply_conandata_patches(self) # Make sure will consume Conan dependencies folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") diff --git a/recipes/folly/all/patches/0001-support-fmt11.patch b/recipes/folly/all/patches/0001-support-fmt11.patch new file mode 100644 index 0000000000000..f8d60de8e57f7 --- /dev/null +++ b/recipes/folly/all/patches/0001-support-fmt11.patch @@ -0,0 +1,12 @@ +diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake +index 0e93175..501c5c0 100644 +--- a/CMake/GenPkgConfig.cmake ++++ b/CMake/GenPkgConfig.cmake +@@ -98,6 +98,7 @@ function(gen_pkgconfig_vars) + # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. + # Before CMake 3.19 there's no way to solve this in a general way, so we + # work around the specific case. See #1414 and CMake bug #21074. ++ string(REPLACE "<$:/utf-8>" "/utf-8" cflags "${cflags}") + if(CMAKE_VERSION VERSION_LESS 3.19) + string(REPLACE + "" "" From 2207f417d27502388f6b4daa003e41e89ff412ed Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Aug 2024 08:39:16 +0200 Subject: [PATCH 104/109] Downgrade fmt to 10 Signed-off-by: Uilian Ries --- recipes/folly/all/conanfile.py | 7 +++---- recipes/folly/all/patches/0001-support-fmt11.patch | 12 ------------ 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 recipes/folly/all/patches/0001-support-fmt11.patch diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 0fe0f1488c509..7b2eee5c31d02 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -4,7 +4,7 @@ from conan.tools.build import check_min_cppstd, cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm, export_conandata_patches, apply_conandata_patches +from conan.tools.files import get, copy, rmdir, replace_in_file, save, rm from conan.tools.microsoft import is_msvc, is_msvc_static_runtime from conan.tools.scm import Version import os @@ -48,7 +48,6 @@ def _compilers_minimum_version(self): } def export_sources(self): - export_conandata_patches(self) copy(self, "conan_deps.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src")) def config_options(self): @@ -87,7 +86,8 @@ def requirements(self): self.requires("libunwind/1.8.0") if self.settings.os == "Linux": self.requires("liburing/2.6") - self.requires("fmt/11.0.2", transitive_headers=True, transitive_libs=True) + # INFO: Folly does not support fmt 11 on MSVC: https://github.com/facebook/folly/issues/2250 + self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) def build_requirements(self): # INFO: Required due ZIP_LISTS CMake feature in conan_deps.cmake @@ -200,7 +200,6 @@ def generate(self): deps.generate() def _patch_sources(self): - apply_conandata_patches(self) # Make sure will consume Conan dependencies folly_deps = os.path.join(self.source_folder, "CMake", "folly-deps.cmake") replace_in_file(self, folly_deps, " MODULE", " REQUIRED CONFIG") diff --git a/recipes/folly/all/patches/0001-support-fmt11.patch b/recipes/folly/all/patches/0001-support-fmt11.patch deleted file mode 100644 index f8d60de8e57f7..0000000000000 --- a/recipes/folly/all/patches/0001-support-fmt11.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMake/GenPkgConfig.cmake b/CMake/GenPkgConfig.cmake -index 0e93175..501c5c0 100644 ---- a/CMake/GenPkgConfig.cmake -+++ b/CMake/GenPkgConfig.cmake -@@ -98,6 +98,7 @@ function(gen_pkgconfig_vars) - # a target, which gets propagated to us through INTERFACE_COMPILE_OPTIONS. - # Before CMake 3.19 there's no way to solve this in a general way, so we - # work around the specific case. See #1414 and CMake bug #21074. -+ string(REPLACE "<$:/utf-8>" "/utf-8" cflags "${cflags}") - if(CMAKE_VERSION VERSION_LESS 3.19) - string(REPLACE - "" "" From 2875fd7647df6ff17fa8df0d9505b1fc2ba11533 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Aug 2024 08:52:36 +0200 Subject: [PATCH 105/109] remove patch from conandata Signed-off-by: Uilian Ries --- recipes/folly/all/conandata.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/recipes/folly/all/conandata.yml b/recipes/folly/all/conandata.yml index b8fc33abf6795..a21030554ee04 100644 --- a/recipes/folly/all/conandata.yml +++ b/recipes/folly/all/conandata.yml @@ -2,9 +2,3 @@ sources: "2024.08.12.00": url: "https://github.com/facebook/folly/releases/download/v2024.08.12.00/folly-v2024.08.12.00.tar.gz" sha256: "18d7be721721db547cb9c5dd5cc50df05cd88b0a8e683e3126ec6f9ce2c41c4d" -patches: - "2024.08.12.00": - - patch_file: "patches/0001-support-fmt11.patch" - patch_source: "https://github.com/facebook/folly/issues/2250" - patch_type: "portabilty" - patch_description: "Fix CMake generator expression for fmt-11" From 2eb919d6c672192c187ff690a838a13d33d7f28e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 21 Aug 2024 11:10:36 +0300 Subject: [PATCH 106/109] folly: use a version range for zstd, bump liburing --- recipes/folly/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 7b2eee5c31d02..23671ce3d0eeb 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -76,7 +76,7 @@ def requirements(self): self.requires("lz4/1.10.0", transitive_libs=True) self.requires("snappy/1.2.1") self.requires("zlib/[>=1.2.11 <2]") - self.requires("zstd/1.5.5", transitive_libs=True) + self.requires("zstd/[~1.5]", transitive_libs=True) if not is_msvc(self): self.requires("libdwarf/0.9.1") self.requires("libsodium/1.0.19") @@ -85,7 +85,7 @@ def requirements(self): self.requires("libiberty/9.1.0") self.requires("libunwind/1.8.0") if self.settings.os == "Linux": - self.requires("liburing/2.6") + self.requires("liburing/2.7") # INFO: Folly does not support fmt 11 on MSVC: https://github.com/facebook/folly/issues/2250 self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) From 90c54d2932767e8ec71c5105202ace9a2c51ada7 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Aug 2024 10:20:16 +0200 Subject: [PATCH 107/109] Revert "folly: use a version range for zstd, bump liburing" This reverts commit 2eb919d6c672192c187ff690a838a13d33d7f28e. --- recipes/folly/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/folly/all/conanfile.py b/recipes/folly/all/conanfile.py index 23671ce3d0eeb..7b2eee5c31d02 100755 --- a/recipes/folly/all/conanfile.py +++ b/recipes/folly/all/conanfile.py @@ -76,7 +76,7 @@ def requirements(self): self.requires("lz4/1.10.0", transitive_libs=True) self.requires("snappy/1.2.1") self.requires("zlib/[>=1.2.11 <2]") - self.requires("zstd/[~1.5]", transitive_libs=True) + self.requires("zstd/1.5.5", transitive_libs=True) if not is_msvc(self): self.requires("libdwarf/0.9.1") self.requires("libsodium/1.0.19") @@ -85,7 +85,7 @@ def requirements(self): self.requires("libiberty/9.1.0") self.requires("libunwind/1.8.0") if self.settings.os == "Linux": - self.requires("liburing/2.7") + self.requires("liburing/2.6") # INFO: Folly does not support fmt 11 on MSVC: https://github.com/facebook/folly/issues/2250 self.requires("fmt/10.2.1", transitive_headers=True, transitive_libs=True) From 1d2f485070e1ef18f717128418d33d2bdce8f7c2 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 21 Aug 2024 11:02:29 +0200 Subject: [PATCH 108/109] do not enforce cmake prefix path in deps.cmake Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com> --- recipes/folly/all/conan_deps.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake index f4b1df9eb8ce3..0ad0b1b890503 100644 --- a/recipes/folly/all/conan_deps.cmake +++ b/recipes/folly/all/conan_deps.cmake @@ -4,8 +4,6 @@ cmake_minimum_required(VERSION 3.17) macro(custom_find_package package_name variable_prefix) find_package(${package_name} REQUIRED CONFIG ${ARGN} # Allow only Conan packages - NO_DEFAULT_PATH - PATHS ${CMAKE_PREFIX_PATH} ) list(APPEND FROM FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE_DIR LIBRARIES LIBRARIES LIBRARIES DEFINITIONS) list(APPEND TO FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE LIB LIBRARY LIBRARIES DEFINITIONS) From 8a4735159046a41a1e0fb6319219878a7e92041c Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Wed, 21 Aug 2024 12:08:14 +0300 Subject: [PATCH 109/109] folly: remove a leftover comment in conan_deps.cmake --- recipes/folly/all/conan_deps.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/folly/all/conan_deps.cmake b/recipes/folly/all/conan_deps.cmake index 0ad0b1b890503..075e362b62636 100644 --- a/recipes/folly/all/conan_deps.cmake +++ b/recipes/folly/all/conan_deps.cmake @@ -2,9 +2,7 @@ cmake_minimum_required(VERSION 3.17) # Set the dependency flags expected by https://github.com/facebook/folly/blob/v2023.12.18.00/CMake/folly-deps.cmake macro(custom_find_package package_name variable_prefix) - find_package(${package_name} REQUIRED CONFIG ${ARGN} - # Allow only Conan packages - ) + find_package(${package_name} REQUIRED CONFIG ${ARGN}) list(APPEND FROM FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE_DIR LIBRARIES LIBRARIES LIBRARIES DEFINITIONS) list(APPEND TO FOUND VERSION VERSION_STRING INCLUDE_DIRS INCLUDE_DIR INCLUDE LIB LIBRARY LIBRARIES DEFINITIONS)