Skip to content

Commit

Permalink
(#21109) folly: migrate to Conan v2
Browse files Browse the repository at this point in the history
* 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

* attach shell script for convenience

* minor fix & fix lint warning

* backport latest fix for  generator expr

* support conan-v1 cmake_find_package/cmake_find_package_multi generator

* fix libunwind

* bugfix: enable CMP0077

* fix issues on windows

* More modernize

* Handle stdc++fs

* Bump zlib to 1.2.13

* Handle case where compiler.cppstd is not provided, compiler minimal checks pass, but default_cppstd is lower than minimal_cppstd

* Revert CMAKE_POSITION_INDEPENDENT_CODE removal

* Remove duplication in test_package

* Prefer official release artifacts

* Change patch_type of PR folly/pull/1433 from backport to portability

* Bump libunwind requirement to 1.6.2

* Prune imports

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

* Instead of invalidating configuration if default_cppstd is lower than min_cppstd, set min_cppstd if the compiler supports it

* Bump required openssl to openssl/1.1.1s

* Remove default_cppstd checks and default to min_cppstd if user doesn't provide compiler.cppstd

* Apply suggestions from code review

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

* Improve test_package

* Add patch for missing limits include

* Set BOOST_LINK_STATIC

Which in turn sets FOLLY_BOOST_LINK_STATIC, which ends up setting Boost_USE_STATIC_LIBS

* Set policy CMP0074

* Switch to f-strings

* Make sure it uses cmake >= 3.13

* Folly 2022.01.31 & 2022.10.31 build on Macos armv8

* Disable windows

* Revert "Folly 2022.01.31 & 2022.10.31 build on Macos armv8"

This reverts commit 0f3fffe.

* Fix conan2 version conflicts and provide trasitive_headers trait

* Bump double-conversion to 3.2.1

* Remove cmake_new_enough

* Remove folly/2019.10.21.00

* Declare openssl requirement with >=1.1 <4 version range

* Remove 2019.10.21.00 from config.yml

* Do not specify requires traits for now

* Define test_type explicit

* Add transitive_headers/transitive_libs to double-conversion

* Add transitive traits to boost

* Add more transitive_headers, transitive_libs
- make boost, double-conversion, glog, libevent, fmt available to consumers

* Add transitive_libs traits to lz4, zstd

* Order imports

* folly: drop v2020.08.10.00

* folly: bump deps

* folly: do not set CMAKE_C_FLAGS directly

* folly: add msvc version check

* folly: use is_apple_os()

* folly: keep only the newest version

* folly: bump deps

* folly: fix _cppstd_flag_value()

* folly: simplify libatomic check

* folly: simplify patching

* folly: add v2023.12.18.00

* folly: fix ambiguity between package cmake target and libfolly cmake target

* Add missing libfolly dependency

* Do not allow static glog if building shared folly

* Leave fixing recipe for macos for the future

* Link only boost components specified in requirements

* Refactor conan_deps.cmake

* folly: bump deps, fix version conflicts

* folly: add latest version, drop -g patch, fix missing include

* folly: update min GCC version

* folly: CMP0075 is set by project since 2019

* folly: use is_msvc_static_runtime()

* folly: bump to v2024.07.08.00

* folly: drop v2022.10.31.00

Focus on getting the latest version working first.

* folly: update min compiler versions

* folly: workaround for CMAKE_PROJECT_folly_INCLUDE

* folly: bump to v2024.07.15.00

* Follow official patch

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Improve invalid conf messages

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Remove folly custom find cmake files

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add version 2024.08.12.00

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Use cmake cache variables

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Simplify test package

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Remove folly version from tests

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Require cmake 3.17 for conan_deps.cmake

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update dependencies versions

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Exclude 2024.07.15.00

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Remove not used defines

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Update boost modules based on headers

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Solve version conflict

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Fix required boost modules

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Enable dependencies based on system

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Avoid folly format due deprecation

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Drop apple restriction

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Drop Windows restriction

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Drop sse4 option

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Drop jemalloc

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Skip apple clang <=13

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Enable shared build with Clang in Linux

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Require Apple clang 14

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Drop glog restriction

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Downgrade fmt to version 10.x due Windows

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Add support for fmt-11

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Try to fix gflags check in msvc

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Drop libaio dependency

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Simplify cpp flag for windows

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Avoid generating .pc file

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Avoid using fmt-11 patch

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* Revert "Avoid using fmt-11 patch"

This reverts commit 37a4502.

* Downgrade fmt to 10

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* remove patch from conandata

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* folly: use a version range for zstd, bump liburing

* Revert "folly: use a version range for zstd, bump liburing"

This reverts commit 2eb919d.

* do not enforce cmake prefix path in deps.cmake

Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>

* folly: remove a leftover comment in conan_deps.cmake

---------

Signed-off-by: Uilian Ries <uilianries@gmail.com>
Co-authored-by: Xianda Ke <kexianda@gmail.com>
Co-authored-by: Pau Farre <pau.farre@esperantotech.com>
Co-authored-by: Pau Farré <Hopobcn@users.noreply.github.com>
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
Co-authored-by: Uilian Ries <uilianries@gmail.com>
Co-authored-by: Luis Caro Campos <3535649+jcar87@users.noreply.github.com>
  • Loading branch information
7 people authored Aug 22, 2024
1 parent c11f8dd commit 8eff1ad
Show file tree
Hide file tree
Showing 33 changed files with 270 additions and 1,014 deletions.
7 changes: 0 additions & 7 deletions recipes/folly/all/CMakeLists.txt

This file was deleted.

45 changes: 45 additions & 0 deletions recipes/folly/all/conan_deps.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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})
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})
continue()
endif()
if ((DEFINED ${dst_var}) AND ("${${dst_var}}" STREQUAL "${${src_var}}"))
# if they're equal, skip
continue()
endif()
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(DoubleConversion DOUBLE_CONVERSION REQUIRED)
custom_find_package(Gflags LIBGFLAGS)
custom_find_package(Glog GLOG)
custom_find_package(LZ4 LZ4)
custom_find_package(LibEvent LIBEVENT REQUIRED)
custom_find_package(LibLZMA LIBLZMA)
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(LibUring LIBURING)
custom_find_package(LibUnwind LIBUNWIND)
custom_find_package(Libiberty LIBIBERTY)
endif()
58 changes: 3 additions & 55 deletions recipes/folly/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,56 +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"
"2022.01.31.00":
url: "https://github.com/facebook/folly/archive/v2022.01.31.00.tar.gz"
sha256: "d764b9a7832d967bb7cfea4bcda15d650315aa4d559fde1da2a52b015cd88b9c"
patches:
"2019.10.21.00":
- patch_file: "patches/0001-find-packages.patch"
base_path: "source_subfolder"
- patch_file: "patches/0002-compiler-flags.patch"
base_path: "source_subfolder"
- patch_file: "patches/0003-boost-shared-ptr.patch"
base_path: "source_subfolder"
- patch_file: "patches/0004-disable-posix-names.patch"
base_path: "source_subfolder"
- patch_file: "patches/0005-include-atomic.patch"
base_path: "source_subfolder"
- patch_file: "patches/0006-duplicate-hash.patch"
base_path: "source_subfolder"
- patch_file: "patches/0007-allow-builtins.patch"
base_path: "source_subfolder"
- patch_file: "patches/0013-include-bit.patch"
base_path: "source_subfolder"
- patch_file: "patches/0020-include-ssizet.patch"
base_path: "source_subfolder"
"2020.08.10.00":
- patch_file: "patches/0008-find-packages.patch"
base_path: "source_subfolder"
- 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_file: "patches/0011-disable-logger-example.patch"
base_path: "source_subfolder"
- patch_file: "patches/0012-compiler-flags.patch"
base_path: "source_subfolder"
- patch_file: "patches/0014-find-librt.patch"
base_path: "source_subfolder"
- patch_file: "patches/0015-benchmark-format-macros.patch"
base_path: "source_subfolder"
"2022.01.31.00":
- patch_file: "patches/0016-find-packages.patch"
base_path: "source_subfolder"
- patch_file: "patches/0017-compiler-flags.patch"
base_path: "source_subfolder"
- patch_file: "patches/0018-find-glog.patch"
base_path: "source_subfolder"
- patch_file: "patches/0019-exclude-example.patch"
base_path: "source_subfolder"
- patch_file: "patches/0022-fix-windows-minmax.patch"
base_path: "source_subfolder"
"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"
Loading

0 comments on commit 8eff1ad

Please sign in to comment.