From 5bc29e79acf2f985f74d5da62fcd9f5e31774759 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 17 Sep 2025 17:06:56 +0200 Subject: [PATCH] gnu: Remove abseil-cpp-20200923.3. * gnu/packages/cpp.scm (abseil-cpp-20200923.3): Delete variable. * gnu/packages/patches/abseil-cpp-20200923.3-adjust-sysinfo.patch, gnu/packages/patches/abseil-cpp-20200923.3-duration-test.patch: Remove files. * gnu/local.mk (dist_patch_DATA): Unregister patches. Change-Id: I52970fe693c0127850d7e7588836141b22ef0213 --- gnu/local.mk | 2 - gnu/packages/cpp.scm | 55 ------------ ...abseil-cpp-20200923.3-adjust-sysinfo.patch | 60 ------------- .../abseil-cpp-20200923.3-duration-test.patch | 86 ------------------- 4 files changed, 203 deletions(-) delete mode 100644 gnu/packages/patches/abseil-cpp-20200923.3-adjust-sysinfo.patch delete mode 100644 gnu/packages/patches/abseil-cpp-20200923.3-duration-test.patch diff --git a/gnu/local.mk b/gnu/local.mk index f341b1b1e63..4155dfdda9c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -961,8 +961,6 @@ dist_patch_DATA = \ %D%/packages/patches/abcl-fix-build-xml.patch \ %D%/packages/patches/ableton-link-system-libraries-debian.patch \ %D%/packages/patches/abiword-explictly-cast-bools.patch \ - %D%/packages/patches/abseil-cpp-20200923.3-adjust-sysinfo.patch \ - %D%/packages/patches/abseil-cpp-20200923.3-duration-test.patch \ %D%/packages/patches/abseil-cpp-20220623.1-no-kepsilon-i686.patch \ %D%/packages/patches/abseil-cpp-fix-strerror_test.patch \ %D%/packages/patches/adb-add-libraries.patch \ diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 05f564dcfb1..387c06af7e0 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -2042,61 +2042,6 @@ other values of screen objects, by setting their values as the tween starting point and then, after each tween step, plugging back the result.") (license license:expat))) -(define-public abseil-cpp-20200923.3 - ;; This is not needed anymore. - (package - (name "abseil-cpp") - (version "20200923.3") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/abseil/abseil-cpp") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1p4djhm1f011ficbjjxx3n8428p8481p20j4glpaawnpsi362hkl")) - (patches - (search-patches "abseil-cpp-fix-strerror_test.patch" - "abseil-cpp-20200923.3-adjust-sysinfo.patch" - "abseil-cpp-20200923.3-duration-test.patch")))) - (build-system cmake-build-system) - (arguments - `(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON" - "-DABSL_RUN_TESTS=ON" - "-DABSL_USE_EXTERNAL_GOOGLETEST=ON" - ;; Needed, else we get errors like: - ;; - ;; ld: CMakeFiles/absl_periodic_sampler_test.dir/internal/periodic_sampler_test.cc.o: - ;; undefined reference to symbol '_ZN7testing4Mock16UnregisterLockedEPNS_8internal25UntypedFunctionMockerBaseE' - ;; ld: /gnu/store/...-googletest-1.10.0/lib/libgmock.so: - ;; error adding symbols: DSO missing from command line - ;; collect2: error: ld returned 1 exit status - "-DCMAKE_EXE_LINKER_FLAGS=-lgtest -lpthread -lgmock") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-max - (lambda _ - (substitute* "absl/debugging/failure_signal_handler.cc" - (("std::max\\(SIGSTKSZ, 65536\\)") - "std::max(SIGSTKSZ, 65536)")))) - (add-before 'configure 'remove-gtest-check - ;; The CMakeLists fails to find our googletest for some reason, but - ;; it works nonetheless. - (lambda _ - (substitute* "CMakeLists.txt" - (("check_target\\(gtest\\)") "") - (("check_target\\(gtest_main\\)") "") - (("check_target\\(gmock\\)") ""))))))) - (native-inputs - (list googletest)) - (home-page "https://abseil.io") - (synopsis "Augmented C++ standard library") - (description "Abseil is a collection of C++ library code designed to -augment the C++ standard library. The Abseil library code is collected from -Google's C++ code base.") - (license license:asl2.0))) - (define-public abseil-cpp-20220623 (package (name "abseil-cpp") diff --git a/gnu/packages/patches/abseil-cpp-20200923.3-adjust-sysinfo.patch b/gnu/packages/patches/abseil-cpp-20200923.3-adjust-sysinfo.patch deleted file mode 100644 index ae52e103a7f..00000000000 --- a/gnu/packages/patches/abseil-cpp-20200923.3-adjust-sysinfo.patch +++ /dev/null @@ -1,60 +0,0 @@ -https://sources.debian.org/data/main/a/abseil/0~20200923.3-2/debian/patches/cpu-frequency.diff -This patch is taken from Debian instead of the upstream URL because the -upstream URL contains far more changes than occur in this patch. - -It was then modified to also work for armhf. - -From: Benjamin Barenblat -Subject: Ignore missing CPU frequency on more architectures -Forwarded: yes -Applied-Upstream: https://github.com/abseil/abseil-cpp/commit/1918ad2ae38aa32c74b558b322479a8efdd76363 - -Linux on MIPS, PA-RISC, RISC-V, and SystemZ doesn’t expose the nominal CPU -frequency via /sys, so don’t worry if `NominalCPUFrequency` returns 1.0 on those -platforms. - -Some POWER machines expose the CPU frequency; others do not. Since we can’t -predict which type of machine the tests will run on, simply disable testing for -`NominalCPUFrequency` on POWER. - -The author works at Google. Upstream applied this patch as Piper revision -347079873 and exported it to GitHub; the Applied-Upstream URL above points to -the exported commit. - ---- a/absl/base/internal/sysinfo_test.cc -+++ b/absl/base/internal/sysinfo_test.cc -@@ -37,17 +37,28 @@ TEST(SysinfoTest, NumCPUs) { - << "NumCPUs() should not have the default value of 0"; - } - -+// Ensure that NominalCPUFrequency returns a reasonable value, or 1.00 on -+// platforms where the CPU frequency is not available through sysfs. -+// -+// POWER is particularly problematic here; some Linux kernels expose the CPU -+// frequency, while others do not. Since we can't predict a priori what a given -+// machine is going to do, just disable this test on POWER on Linux. -+#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__))) - TEST(SysinfoTest, NominalCPUFrequency) { --#if !(defined(__aarch64__) && defined(__linux__)) && !defined(__EMSCRIPTEN__) -- EXPECT_GE(NominalCPUFrequency(), 1000.0) -- << "NominalCPUFrequency() did not return a reasonable value"; --#else -- // Aarch64 cannot read the CPU frequency from sysfs, so we get back 1.0. -- // Emscripten does not have a sysfs to read from at all. -+ // Linux only exposes the CPU frequency on certain architectures, and -+ // Emscripten doesn't expose it at all. -+#if defined(__linux__) && \ -+ (defined(__aarch64__) || defined(__hppa__) || defined(__mips__) || \ -+ defined(__arm__) || defined(__riscv) || defined(__s390x__)) || \ -+ defined(__EMSCRIPTEN__) - EXPECT_EQ(NominalCPUFrequency(), 1.0) - << "CPU frequency detection was fixed! Please update unittest."; -+#else -+ EXPECT_GE(NominalCPUFrequency(), 1000.0) -+ << "NominalCPUFrequency() did not return a reasonable value"; - #endif - } -+#endif - - TEST(SysinfoTest, GetTID) { - EXPECT_EQ(GetTID(), GetTID()); // Basic compile and equality test. diff --git a/gnu/packages/patches/abseil-cpp-20200923.3-duration-test.patch b/gnu/packages/patches/abseil-cpp-20200923.3-duration-test.patch deleted file mode 100644 index 9609c2588b6..00000000000 --- a/gnu/packages/patches/abseil-cpp-20200923.3-duration-test.patch +++ /dev/null @@ -1,86 +0,0 @@ -This patch is taken from upstream and helps the test pass on all architectures. - -The adjustment to absl/numeric/internal/bits.h was removed since the file -didn't appear in the git checkout. - -From b0735979d778a768caee207f01f327535cbd2140 Mon Sep 17 00:00:00 2001 -From: Abseil Team -Date: Tue, 2 Mar 2021 14:28:07 -0800 -Subject: [PATCH] Export of internal Abseil changes - --- -a74bdb72c3a6983e08a805938dd0e20e97d55bba by Abseil Team : - -Fix typo: calcualte -> calculate - -PiperOrigin-RevId: 360515509 - --- -3ddf8ac194e81a13e9de095e59dd061c1beacfe3 by Benjamin Barenblat : - -Make tests tolerant of FMA contraction - -Weaken Duration.ToDoubleSecondsCheckEdgeCases and -Duration.ToDoubleSecondsCheckRandom to make them less sensitive to fused -multiply/add contraction. - -PiperOrigin-RevId: 360297653 -GitOrigin-RevId: a74bdb72c3a6983e08a805938dd0e20e97d55bba -Change-Id: I0c55383bc13040ea77511c4130d142368103dc57 ---- - absl/numeric/internal/bits.h | 2 +- - absl/time/duration_test.cc | 18 +++++++++++------- - 2 files changed, 12 insertions(+), 8 deletions(-) - -diff --git a/absl/time/duration_test.cc b/absl/time/duration_test.cc -index 4d85a2c4f45..fb28fa987f6 100644 ---- a/absl/time/duration_test.cc -+++ b/absl/time/duration_test.cc -@@ -1369,10 +1369,13 @@ TEST(Duration, SmallConversions) { - EXPECT_THAT(ToTimeval(absl::Nanoseconds(2000)), TimevalMatcher(tv)); - } - --void VerifySameAsMul(double time_as_seconds, int* const misses) { -+void VerifyApproxSameAsMul(double time_as_seconds, int* const misses) { - auto direct_seconds = absl::Seconds(time_as_seconds); - auto mul_by_one_second = time_as_seconds * absl::Seconds(1); -- if (direct_seconds != mul_by_one_second) { -+ // These are expected to differ by up to one tick due to fused multiply/add -+ // contraction. -+ if (absl::AbsDuration(direct_seconds - mul_by_one_second) > -+ absl::time_internal::MakeDuration(0, 1u)) { - if (*misses > 10) return; - ASSERT_LE(++(*misses), 10) << "Too many errors, not reporting more."; - EXPECT_EQ(direct_seconds, mul_by_one_second) -@@ -1384,7 +1387,8 @@ void VerifySameAsMul(double time_as_seconds, int* const misses) { - // For a variety of interesting durations, we find the exact point - // where one double converts to that duration, and the very next double - // converts to the next duration. For both of those points, verify that --// Seconds(point) returns the same duration as point * Seconds(1.0) -+// Seconds(point) returns a duration near point * Seconds(1.0). (They may -+// not be exactly equal due to fused multiply/add contraction.) - TEST(Duration, ToDoubleSecondsCheckEdgeCases) { - constexpr uint32_t kTicksPerSecond = absl::time_internal::kTicksPerSecond; - constexpr auto duration_tick = absl::time_internal::MakeDuration(0, 1u); -@@ -1423,8 +1427,8 @@ TEST(Duration, ToDoubleSecondsCheckEdgeCases) { - } - // Now low_edge is the highest double that converts to Duration d, - // and high_edge is the lowest double that converts to Duration after_d. -- VerifySameAsMul(low_edge, &misses); -- VerifySameAsMul(high_edge, &misses); -+ VerifyApproxSameAsMul(low_edge, &misses); -+ VerifyApproxSameAsMul(high_edge, &misses); - } - } - } -@@ -1444,8 +1448,8 @@ TEST(Duration, ToDoubleSecondsCheckRandom) { - int misses = 0; - for (int i = 0; i < 1000000; ++i) { - double d = std::exp(uniform(gen)); -- VerifySameAsMul(d, &misses); -- VerifySameAsMul(-d, &misses); -+ VerifyApproxSameAsMul(d, &misses); -+ VerifyApproxSameAsMul(-d, &misses); - } - } -