From 4888b9f53fb3e4986a56ed61d1eb50872a031aaa Mon Sep 17 00:00:00 2001 From: Yellow Shine Date: Tue, 6 Aug 2024 14:53:46 +0800 Subject: [PATCH] cherry pick abseil Signed-off-by: Yellow Shine --- abseil/all/conandata.yml | 64 +++++++++---------- abseil/all/conanfile.py | 11 +++- .../0003-absl-string-libm-20240116.patch | 15 ----- .../0004-test-allocator-testonly.patch | 10 --- ...240116.1-0001-fix-filesystem-include.patch | 53 --------------- abseil/config.yml | 12 ++-- 6 files changed, 48 insertions(+), 117 deletions(-) delete mode 100644 abseil/all/patches/0003-absl-string-libm-20240116.patch delete mode 100644 abseil/all/patches/0004-test-allocator-testonly.patch delete mode 100644 abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch diff --git a/abseil/all/conandata.yml b/abseil/all/conandata.yml index b213e4b..1f04efd 100644 --- a/abseil/all/conandata.yml +++ b/abseil/all/conandata.yml @@ -1,49 +1,29 @@ sources: - "20240116.2": - url: "https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz" - sha256: "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc" - "20240116.1": - url: "https://github.com/abseil/abseil-cpp/archive/20240116.1.tar.gz" - sha256: "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a" "20230802.1": url: "https://github.com/abseil/abseil-cpp/archive/20230802.1.tar.gz" sha256: "987ce98f02eefbaf930d6e38ab16aa05737234d7afbab2d5c4ea7adbe50c28ed" "20230125.3": url: "https://github.com/abseil/abseil-cpp/archive/20230125.3.tar.gz" sha256: "5366D7E7FA7BA0D915014D387B66D0D002C03236448E1BA9EF98122C13B35C36" + "20230125.2": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.2.tar.gz" + sha256: "9a2b5752d7bfade0bdeee2701de17c9480620f8b237e1964c1b9967c75374906" + "20230125.1": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.1.tar.gz" + sha256: "81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145" + "20230125.0": + url: "https://github.com/abseil/abseil-cpp/archive/20230125.0.tar.gz" + sha256: "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21" "20220623.1": url: "https://github.com/abseil/abseil-cpp/archive/20220623.1.tar.gz" sha256: "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8" + "20220623.0": + url: "https://github.com/abseil/abseil-cpp/archive/20220623.0.tar.gz" + sha256: "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602" "20211102.0": url: "https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz" sha256: "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4" patches: - "20240116.2": - - patch_file: "patches/0003-absl-string-libm-20240116.patch" - patch_description: "link libm to absl string" - patch_type: "portability" - patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" - - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" - patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" - patch_type: "portability" - patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" - - patch_file: "patches/0004-test-allocator-testonly.patch" - patch_description: "Do not build test_allocator target when tests are disabled" - patch_type: "portability" - patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" - "20240116.1": - - patch_file: "patches/0003-absl-string-libm-20240116.patch" - patch_description: "link libm to absl string" - patch_type: "portability" - patch_source: "https://github.com/abseil/abseil-cpp/issues/1100" - - patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch" - patch_description: "Fix GCC 7 including in C++17 mode when it is not available (until GCC 8)" - patch_type: "portability" - patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303" - - patch_file: "patches/0004-test-allocator-testonly.patch" - patch_description: "Do not build test_allocator target when tests are disabled" - patch_type: "portability" - patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5" "20230802.1": - patch_file: "patches/0003-absl-string-libm-20230802.patch" patch_description: "link libm to absl string" @@ -57,6 +37,18 @@ patches: - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" patch_type: "portability" + "20230125.2": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20230125.1": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + "20230125.0": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" "20220623.1": - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" @@ -65,6 +57,14 @@ patches: patch_description: "Workaround bug in GCC 7.2" patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" patch_type: "portability" + "20220623.0": + - patch_file: "patches/0003-absl-string-libm.patch" + patch_description: "link libm to absl string" + patch_type: "portability" + - patch_file: "patches/0005-has-unique-object-representations.patch" + patch_description: "Workaround bug in GCC 7.2" + patch_source: "https://github.com/abseil/abseil-cpp/pull/1250" + patch_type: "portability" "20211102.0": - patch_file: "patches/0003-absl-string-libm.patch" patch_description: "link libm to absl string" diff --git a/abseil/all/conanfile.py b/abseil/all/conanfile.py index 6c10812..1d57cb0 100644 --- a/abseil/all/conanfile.py +++ b/abseil/all/conanfile.py @@ -70,9 +70,9 @@ def validate(self): f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support." ) - if self.options.shared and is_msvc(self) and Version(self.version) < "20230802.1": + if self.options.shared and is_msvc(self): # upstream tries its best to export symbols, but it's broken for the moment - raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio, please use version 20230802.1 or newer") + raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio (yet)") def layout(self): cmake_layout(self, src_folder="src") @@ -161,7 +161,7 @@ def _load_components_from_cmake_target_file(self, absl_target_file_path): if cmake_function_name == "add_library": cmake_imported_target_type = cmake_function_args[1] if cmake_imported_target_type in ["STATIC", "SHARED"]: - components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else ['abseil_dll'] + components[potential_lib_name]["libs"] = [potential_lib_name] if cmake_target_nonamespace != "abseil_dll" else [] elif cmake_function_name == "set_target_properties": target_properties = re.findall(r"(?PINTERFACE_COMPILE_DEFINITIONS|INTERFACE_INCLUDE_DIRECTORIES|INTERFACE_LINK_LIBRARIES)[\n|\s]+(?P.+)", cmake_function_args[2]) for target_property in target_properties: @@ -232,6 +232,11 @@ def package_info(self): self.cpp_info.components[pkgconfig_name].system_libs = values.get("system_libs", []) self.cpp_info.components[pkgconfig_name].frameworks = values.get("frameworks", []) self.cpp_info.components[pkgconfig_name].requires = values.get("requires", []) + if is_msvc(self) and self.settings.compiler.get_safe("cppstd") == "20": + self.cpp_info.components[pkgconfig_name].defines.extend([ + "_HAS_DEPRECATED_RESULT_OF", + "_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING", + ]) self.cpp_info.components[pkgconfig_name].names["cmake_find_package"] = cmake_target self.cpp_info.components[pkgconfig_name].names["cmake_find_package_multi"] = cmake_target diff --git a/abseil/all/patches/0003-absl-string-libm-20240116.patch b/abseil/all/patches/0003-absl-string-libm-20240116.patch deleted file mode 100644 index 640ce8d..0000000 --- a/abseil/all/patches/0003-absl-string-libm-20240116.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/absl/strings/CMakeLists.txt -+++ b/absl/strings/CMakeLists.txt -@@ -32,9 +32,12 @@ - PUBLIC - ) - -+find_library(LIBM m) - absl_cc_library( - NAME - strings -+ LINKOPTS -+ $<$:-lm> - HDRS - "ascii.h" - "charconv.h" diff --git a/abseil/all/patches/0004-test-allocator-testonly.patch b/abseil/all/patches/0004-test-allocator-testonly.patch deleted file mode 100644 index 909c1f7..0000000 --- a/abseil/all/patches/0004-test-allocator-testonly.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/absl/container/CMakeLists.txt -+++ b/absl/container/CMakeLists.txt -@@ -213,6 +213,7 @@ absl_cc_library( - DEPS - absl::config - GTest::gmock -+ TESTONLY - ) - - absl_cc_test( diff --git a/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch b/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch deleted file mode 100644 index f29ce61..0000000 --- a/abseil/all/patches/20240116.1-0001-fix-filesystem-include.patch +++ /dev/null @@ -1,53 +0,0 @@ -From bb83aceacb554e79e7cd2404856f0be30bd00303 Mon Sep 17 00:00:00 2001 -From: Derek Mauro -Date: Tue, 12 Mar 2024 08:33:40 -0700 -Subject: [PATCH] Fix GCC7 C++17 build - -GCC did not support until GCC8. - -Fixes #1635 - -PiperOrigin-RevId: 615051227 -Change-Id: If7cd5802ead40805b1ff1c3bdfc10ba6d2858ef0 ---- - absl/hash/hash_test.cc | 2 +- - absl/hash/internal/hash.h | 12 ++++++++++-- - 2 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h -index f4a94f9129f..b7d89b01807 100644 ---- a/absl/hash/internal/hash.h -+++ b/absl/hash/internal/hash.h -@@ -24,6 +24,15 @@ - #include - #endif - -+#include "absl/base/config.h" -+ -+// For feature testing and determining which headers can be included. -+#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L -+#include -+#else -+#include -+#endif -+ - #include - #include - #include -@@ -47,7 +56,6 @@ - #include - #include - --#include "absl/base/config.h" - #include "absl/base/internal/unaligned_access.h" - #include "absl/base/port.h" - #include "absl/container/fixed_array.h" -@@ -61,7 +69,7 @@ - #include "absl/types/variant.h" - #include "absl/utility/utility.h" - --#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 201703L && \ -+#if defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && \ - !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) - #include // NOLINT - #endif diff --git a/abseil/config.yml b/abseil/config.yml index 0af2b7b..a5bf230 100644 --- a/abseil/config.yml +++ b/abseil/config.yml @@ -1,13 +1,17 @@ versions: - "20240116.2": - folder: all - "20240116.1": - folder: all "20230802.1": folder: all "20230125.3": folder: all + "20230125.2": + folder: all + "20230125.1": + folder: all + "20230125.0": + folder: all "20220623.1": folder: all + "20220623.0": + folder: all "20211102.0": folder: all