From eb312bd8a8e21f9d413e1f9fc191ae5c3f6e1015 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 8 May 2023 13:21:33 +1100 Subject: [PATCH] add patches to enable shared windows builds of test helpers --- recipe/meta.yaml | 3 ++ ...ch-out-the-build-issue-on-clang4-osx.patch | 5 +- ...to-the-CoreFoundation-framework-on-O.patch | 5 +- ...-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch | 5 +- .../0004-add-missing-osx-workaround.patch | 5 +- ...-ABSL_INTERNAL_DLL_TARGETS-for-share.patch | 5 +- .../0006-default-dll-import-for-windows.patch | 5 +- ...-ABSL_PROPAGATE_CXX_STD-cmake-option.patch | 5 +- ...STONLY-libraries-and-their-dependenc.patch | 7 +-- ...ry-source-files-to-ABSL_INTERNAL_TES.patch | 25 +++++++++ ...EST_LINKOPTS-when-using-shared-build.patch | 24 +++++++++ ...-and-relevant-internal-state-use-ABS.patch | 51 +++++++++++++++++++ 12 files changed, 112 insertions(+), 33 deletions(-) create mode 100644 recipe/patches/0009-add-some-necessary-source-files-to-ABSL_INTERNAL_TES.patch create mode 100644 recipe/patches/0010-update-ABSL_CC_TEST_LINKOPTS-when-using-shared-build.patch create mode 100644 recipe/patches/0011-make-CordzHandle-and-relevant-internal-state-use-ABS.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 465d7b2..4472fef 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -43,6 +43,9 @@ source: # backport https://github.com/abseil/abseil-cpp/commit/807763a7f57dcf0ba4af7c3b218013e8f525e811 # to be able to install TESTONLY libraries - patches/0008-CMake-Install-TESTONLY-libraries-and-their-dependenc.patch + - patches/0009-add-some-necessary-source-files-to-ABSL_INTERNAL_TES.patch + - patches/0010-update-ABSL_CC_TEST_LINKOPTS-when-using-shared-build.patch + - patches/0011-make-CordzHandle-and-relevant-internal-state-use-ABS.patch build: number: 0 diff --git a/recipe/patches/0001-patch-out-the-build-issue-on-clang4-osx.patch b/recipe/patches/0001-patch-out-the-build-issue-on-clang4-osx.patch index 9c2c334..87a5e9a 100644 --- a/recipe/patches/0001-patch-out-the-build-issue-on-clang4-osx.patch +++ b/recipe/patches/0001-patch-out-the-build-issue-on-clang4-osx.patch @@ -1,7 +1,7 @@ From d59eb9046823f39006350a508e30bac815b63383 Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sat, 21 Sep 2019 15:05:46 +0200 -Subject: [PATCH 1/8] patch out the build issue on clang4 osx +Subject: [PATCH 01/11] patch out the build issue on clang4 osx --- absl/time/internal/cctz/include/cctz/civil_time_detail.h | 4 ++++ @@ -22,6 +22,3 @@ index a5b084e6..0a9a4389 100644 #include #include #include --- -2.38.1.windows.1 - diff --git a/recipe/patches/0002-fix-for-linking-to-the-CoreFoundation-framework-on-O.patch b/recipe/patches/0002-fix-for-linking-to-the-CoreFoundation-framework-on-O.patch index a039573..1d84c42 100644 --- a/recipe/patches/0002-fix-for-linking-to-the-CoreFoundation-framework-on-O.patch +++ b/recipe/patches/0002-fix-for-linking-to-the-CoreFoundation-framework-on-O.patch @@ -1,7 +1,7 @@ From c8bd75a96ecb2bd528399829692307a03985da0b Mon Sep 17 00:00:00 2001 From: Francesco Biscani Date: Sat, 21 Sep 2019 21:39:26 +0200 -Subject: [PATCH 2/8] fix for linking to the CoreFoundation framework on OSX +Subject: [PATCH 02/11] fix for linking to the CoreFoundation framework on OSX --- absl/time/CMakeLists.txt | 6 ++++-- @@ -26,6 +26,3 @@ index 7b720540..cfed46a4 100644 # Internal-only target, do not depend on directly. absl_cc_library( NAME --- -2.38.1.windows.1 - diff --git a/recipe/patches/0003-remove-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch b/recipe/patches/0003-remove-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch index 872e3c1..49ff616 100644 --- a/recipe/patches/0003-remove-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch +++ b/recipe/patches/0003-remove-ignore-4221-from-ABSL_MSVC_LINKOPTS.patch @@ -1,7 +1,7 @@ From dfbac02988c119967037c53a0f78f03bdf01e1c8 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Thu, 30 Jul 2020 13:01:32 +0200 -Subject: [PATCH 3/8] remove "-ignore:4221" from ABSL_MSVC_LINKOPTS +Subject: [PATCH 03/11] remove "-ignore:4221" from ABSL_MSVC_LINKOPTS see also https://github.com/microsoft/vcpkg/issues/13945 --- @@ -40,6 +40,3 @@ index e6e11949..09ac7618 100644 # "HWAES" is an abbreviation for "hardware AES" (AES - Advanced Encryption # Standard). These flags are used for detecting whether or not the target # architecture has hardware support for AES instructions which can be used --- -2.38.1.windows.1 - diff --git a/recipe/patches/0004-add-missing-osx-workaround.patch b/recipe/patches/0004-add-missing-osx-workaround.patch index b2cbe66..b9f7730 100644 --- a/recipe/patches/0004-add-missing-osx-workaround.patch +++ b/recipe/patches/0004-add-missing-osx-workaround.patch @@ -1,7 +1,7 @@ From b6c0b4ffa8aa2ed4146e2c9ca9b0406e2da4f1d3 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 1 Jul 2022 13:37:17 +0200 -Subject: [PATCH 4/8] add missing osx workaround +Subject: [PATCH 04/11] add missing osx workaround --- absl/debugging/internal/examine_stack.cc | 4 ++++ @@ -22,6 +22,3 @@ index 57863228..91862aed 100644 #if defined(__linux__) || defined(__APPLE__) #include #endif --- -2.38.1.windows.1 - diff --git a/recipe/patches/0005-fix-some-missing-ABSL_INTERNAL_DLL_TARGETS-for-share.patch b/recipe/patches/0005-fix-some-missing-ABSL_INTERNAL_DLL_TARGETS-for-share.patch index 67c8824..121a620 100644 --- a/recipe/patches/0005-fix-some-missing-ABSL_INTERNAL_DLL_TARGETS-for-share.patch +++ b/recipe/patches/0005-fix-some-missing-ABSL_INTERNAL_DLL_TARGETS-for-share.patch @@ -1,7 +1,7 @@ From d6480ef5044ab0cb548dcae070327481a9da46c9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 7 Feb 2023 13:01:27 +1100 -Subject: [PATCH 5/8] fix some missing ABSL_INTERNAL_DLL_TARGETS for shared +Subject: [PATCH 05/11] fix some missing ABSL_INTERNAL_DLL_TARGETS for shared builds --- @@ -54,6 +54,3 @@ index c4a41e6d..c4c92359 100644 "random_internal_mock_overload_set" "scoped_mock_log" ) --- -2.38.1.windows.1 - diff --git a/recipe/patches/0006-default-dll-import-for-windows.patch b/recipe/patches/0006-default-dll-import-for-windows.patch index c3a8787..d6909b4 100644 --- a/recipe/patches/0006-default-dll-import-for-windows.patch +++ b/recipe/patches/0006-default-dll-import-for-windows.patch @@ -1,7 +1,7 @@ From d062fa3db9557ec227a40af6c40727249499022f Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 11 Sep 2022 10:32:19 -0400 -Subject: [PATCH 6/8] default dll import for windows +Subject: [PATCH 06/11] default dll import for windows --- absl/base/config.h | 5 ++--- @@ -24,6 +24,3 @@ index e35d2e48..391da4de 100644 #endif #else #define ABSL_DLL --- -2.38.1.windows.1 - diff --git a/recipe/patches/0007-Fix-ABSL_PROPAGATE_CXX_STD-cmake-option.patch b/recipe/patches/0007-Fix-ABSL_PROPAGATE_CXX_STD-cmake-option.patch index 12826b8..60312d2 100644 --- a/recipe/patches/0007-Fix-ABSL_PROPAGATE_CXX_STD-cmake-option.patch +++ b/recipe/patches/0007-Fix-ABSL_PROPAGATE_CXX_STD-cmake-option.patch @@ -1,7 +1,7 @@ From dd56821ac6927441e33387072b8dc3c3569644a4 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 15 Feb 2023 15:55:54 +0100 -Subject: [PATCH 7/8] Fix ABSL_PROPAGATE_CXX_STD cmake option +Subject: [PATCH 07/11] Fix ABSL_PROPAGATE_CXX_STD cmake option --- CMake/AbseilDll.cmake | 6 +++--- @@ -31,6 +31,3 @@ index c4c92359..1aecd926 100644 endif() install(TARGETS ${_dll} EXPORT ${PROJECT_NAME}Targets --- -2.38.1.windows.1 - diff --git a/recipe/patches/0008-CMake-Install-TESTONLY-libraries-and-their-dependenc.patch b/recipe/patches/0008-CMake-Install-TESTONLY-libraries-and-their-dependenc.patch index 238ecb9..e1f1a1e 100644 --- a/recipe/patches/0008-CMake-Install-TESTONLY-libraries-and-their-dependenc.patch +++ b/recipe/patches/0008-CMake-Install-TESTONLY-libraries-and-their-dependenc.patch @@ -1,8 +1,8 @@ From 4ed51580e60f87f0cdd2024b407aa6688f65c5ef Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Thu, 2 Mar 2023 17:32:02 -0800 -Subject: [PATCH 8/8] CMake: Install TESTONLY libraries and their dependencies - when they are built +Subject: [PATCH 08/11] CMake: Install TESTONLY libraries and their + dependencies when they are built https://github.com/abseil/abseil-cpp/issues/1407 @@ -136,6 +136,3 @@ index 6d059e7e..f452a676 100644 install(TARGETS ${_NAME} EXPORT ${PROJECT_NAME}Targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} --- -2.38.1.windows.1 - diff --git a/recipe/patches/0009-add-some-necessary-source-files-to-ABSL_INTERNAL_TES.patch b/recipe/patches/0009-add-some-necessary-source-files-to-ABSL_INTERNAL_TES.patch new file mode 100644 index 0000000..5cdbb6e --- /dev/null +++ b/recipe/patches/0009-add-some-necessary-source-files-to-ABSL_INTERNAL_TES.patch @@ -0,0 +1,25 @@ +From bfac9193f2b18fb585747df39c27ff94d3fce01d Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sun, 7 May 2023 18:24:46 +1100 +Subject: [PATCH 09/11] add some necessary source files to + ABSL_INTERNAL_TEST_DLL_FILES + +--- + CMake/AbseilDll.cmake | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake +index 1aecd926..26078596 100644 +--- a/CMake/AbseilDll.cmake ++++ b/CMake/AbseilDll.cmake +@@ -584,6 +584,10 @@ set(ABSL_INTERNAL_TEST_DLL_FILES + "hash/hash_testing.h" + "log/scoped_mock_log.cc" + "log/scoped_mock_log.h" ++ "random/internal/chi_square.cc" ++ "random/internal/chi_square.h" ++ "random/internal/distribution_test_util.cc" ++ "random/internal/distribution_test_util.h" + "random/internal/mock_helpers.h" + "random/internal/mock_overload_set.h" + "random/mocking_bit_gen.h" diff --git a/recipe/patches/0010-update-ABSL_CC_TEST_LINKOPTS-when-using-shared-build.patch b/recipe/patches/0010-update-ABSL_CC_TEST_LINKOPTS-when-using-shared-build.patch new file mode 100644 index 0000000..4864b36 --- /dev/null +++ b/recipe/patches/0010-update-ABSL_CC_TEST_LINKOPTS-when-using-shared-build.patch @@ -0,0 +1,24 @@ +From dd5375ee269b6431c029efd1dae91525cb891492 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sun, 7 May 2023 20:26:19 +1100 +Subject: [PATCH 10/11] update ABSL_CC_TEST_LINKOPTS when using shared build + +--- + CMake/AbseilHelpers.cmake | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake +index f452a676..89f6ba9a 100644 +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -427,6 +427,10 @@ function(absl_cc_test) + DEPS ${ABSL_CC_TEST_DEPS} + OUTPUT ABSL_CC_TEST_DEPS + ) ++ absl_internal_dll_targets( ++ DEPS ${ABSL_CC_TEST_LINKOPTS} ++ OUTPUT ABSL_CC_TEST_LINKOPTS ++ ) + else() + target_compile_definitions(${_NAME} + PUBLIC diff --git a/recipe/patches/0011-make-CordzHandle-and-relevant-internal-state-use-ABS.patch b/recipe/patches/0011-make-CordzHandle-and-relevant-internal-state-use-ABS.patch new file mode 100644 index 0000000..15159f8 --- /dev/null +++ b/recipe/patches/0011-make-CordzHandle-and-relevant-internal-state-use-ABS.patch @@ -0,0 +1,51 @@ +From 783fdeef3098ba22153507abe0f706505c667897 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Mon, 8 May 2023 11:15:46 +1100 +Subject: [PATCH 11/11] make CordzHandle and relevant internal state use + ABSL_DLL + +--- + absl/strings/internal/cord_internal.cc | 2 +- + absl/strings/internal/cord_internal.h | 2 +- + absl/strings/internal/cordz_handle.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/absl/strings/internal/cord_internal.cc b/absl/strings/internal/cord_internal.cc +index b6b06cfa..f2842511 100644 +--- a/absl/strings/internal/cord_internal.cc ++++ b/absl/strings/internal/cord_internal.cc +@@ -33,7 +33,7 @@ ABSL_CONST_INIT std::atomic cord_ring_buffer_enabled( + kCordEnableRingBufferDefault); + ABSL_CONST_INIT std::atomic shallow_subcords_enabled( + kCordShallowSubcordsDefault); +-ABSL_CONST_INIT std::atomic cord_btree_exhaustive_validation(false); ++ABSL_CONST_INIT ABSL_DLL std::atomic cord_btree_exhaustive_validation(false); + + void LogFatalNodeType(CordRep* rep) { + ABSL_INTERNAL_LOG(FATAL, absl::StrCat("Unexpected node type: ", +diff --git a/absl/strings/internal/cord_internal.h b/absl/strings/internal/cord_internal.h +index 63a81f4f..796d4de9 100644 +--- a/absl/strings/internal/cord_internal.h ++++ b/absl/strings/internal/cord_internal.h +@@ -73,7 +73,7 @@ extern std::atomic shallow_subcords_enabled; + // in debug assertions, and code that calls `IsValid()` explicitly. By default, + // assertions should be relatively cheap and AssertValid() can easily lead to + // O(n^2) complexity as recursive / full tree validation is O(n). +-extern std::atomic cord_btree_exhaustive_validation; ++ABSL_DLL extern std::atomic cord_btree_exhaustive_validation; + + inline void enable_cord_ring_buffer(bool enable) { + cord_ring_buffer_enabled.store(enable, std::memory_order_relaxed); +diff --git a/absl/strings/internal/cordz_handle.h b/absl/strings/internal/cordz_handle.h +index 3c800b43..c4ac7cb8 100644 +--- a/absl/strings/internal/cordz_handle.h ++++ b/absl/strings/internal/cordz_handle.h +@@ -34,7 +34,7 @@ namespace cord_internal { + // has gained visibility into a CordzInfo object, that CordzInfo object will not + // be deleted prematurely. This allows the profiler to inspect all CordzInfo + // objects that are alive without needing to hold a global lock. +-class CordzHandle { ++class ABSL_DLL CordzHandle { + public: + CordzHandle() : CordzHandle(false) {} +