Skip to content

Commit

Permalink
(#22982) abseil: Add 20240116.1, remove old versions
Browse files Browse the repository at this point in the history
* Add abseil 20240116.1

* Skip C++17 build on latest version with GCC 7

* Remove old "patch" versions

* Convert compiler major version to int in v1 test package

* Backport GCC7/C++17/filesystem fix

* Revert GCC 7 hacks

* Remove std::result_of workaround defines
  • Loading branch information
Ahajha authored Mar 14, 2024
1 parent cab4970 commit b0546ef
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 45 deletions.
44 changes: 12 additions & 32 deletions recipes/abseil/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
sources:
"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.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 <filesystem> 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"
"20230802.1":
- patch_file: "patches/0003-absl-string-libm-20230802.patch"
patch_description: "link libm to absl string"
Expand All @@ -37,18 +37,6 @@ 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"
Expand All @@ -57,14 +45,6 @@ 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"
Expand Down
5 changes: 0 additions & 5 deletions recipes/abseil/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ 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
Expand Down
15 changes: 15 additions & 0 deletions recipes/abseil/all/patches/0003-absl-string-libm-20240116.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- 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
+ $<$<BOOL:${LIBM}>:-lm>
HDRS
"ascii.h"
"charconv.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From bb83aceacb554e79e7cd2404856f0be30bd00303 Mon Sep 17 00:00:00 2001
From: Derek Mauro <dmauro@google.com>
Date: Tue, 12 Mar 2024 08:33:40 -0700
Subject: [PATCH] Fix GCC7 C++17 build

GCC did not support <filesystem> 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 <TargetConditionals.h>
#endif

+#include "absl/base/config.h"
+
+// For feature testing and determining which headers can be included.
+#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
+#include <version>
+#else
+#include <ciso646>
+#endif
+
#include <algorithm>
#include <array>
#include <bitset>
@@ -47,7 +56,6 @@
#include <utility>
#include <vector>

-#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 <filesystem> // NOLINT
#endif
10 changes: 2 additions & 8 deletions recipes/abseil/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
versions:
"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

0 comments on commit b0546ef

Please sign in to comment.