From c93a12f36027df8d41d8d8f712d9606b257db1fb Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 15 Mar 2022 12:32:22 -0400 Subject: [PATCH 1/7] Disable LTO on s390x to work around test failure Symbolize.SymbolizeWithMultipleMaps fails in absl_symbolize_test on s390x with LTO https://github.com/abseil/abseil-cpp/issues/1133 --- abseil-cpp.spec | 56 ++++++++++--------------------------------------- 1 file changed, 11 insertions(+), 45 deletions(-) diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 3569a65..d1a563a 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -3,7 +3,7 @@ Name: abseil-cpp Version: 20211102.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: C++ Common Libraries License: ASL 2.0 @@ -23,6 +23,13 @@ BuildRequires: gcc-c++ BuildRequires: gmock-devel BuildRequires: gtest-devel +%ifarch s390x +# Symbolize.SymbolizeWithMultipleMaps fails in absl_symbolize_test on s390x +# with LTO +# https://github.com/abseil/abseil-cpp/issues/1133 +%global _lto_cflags %{nil} +%endif + %description Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from @@ -58,50 +65,6 @@ find . -type f -name '*.cc' \ -exec gawk '/GTEST_FLAG_GET/ { print FILENAME ; nextfile }' '{}' '+' | xargs -r -t sed -r -i 's/GTEST_FLAG_GET/::testing::GTEST_FLAG/g' -# It’s extremely difficult to pass gtest options through to the test -# executables from ctest. We could probably skip an entire executable (e.g. -# absl_symbolize_test) by symlinking it to /bin/true, but the easiest way to -# skip a *single test* is to patch the test source. - -%ifarch s390x -# TODO: why does this test fail? -# -# 48/167 Test #49: absl_symbolize_test ................................***Failed 0.02 sec -# TestWithReturnAddress passed -# [==========] Running 7 tests from 1 test suite. -# [----------] Global test environment set-up. -# [----------] 7 tests from Symbolize -# [ RUN ] Symbolize.Cached -# [ OK ] Symbolize.Cached (0 ms) -# [ RUN ] Symbolize.Truncation -# [ OK ] Symbolize.Truncation (0 ms) -# [ RUN ] Symbolize.SymbolizeWithDemangling -# [ OK ] Symbolize.SymbolizeWithDemangling (0 ms) -# [ RUN ] Symbolize.SymbolizeSplitTextSections -# [ OK ] Symbolize.SymbolizeSplitTextSections (0 ms) -# [ RUN ] Symbolize.SymbolizeWithMultipleMaps -# /builddir/build/BUILD/abseil-cpp-20210324.2/absl/debugging/symbolize_test.cc:315: Failure -# Expected equality of these values: -# "kPadding1" -# buf -# Which is: "" -# /builddir/build/BUILD/abseil-cpp-20210324.2/absl/debugging/symbolize_test.cc:349: Failure -# Expected equality of these values: -# expected[i] -# Which is: "kPadding1" -# buf -# Which is: "" -# /builddir/build/BUILD/abseil-cpp-20210324.2/absl/debugging/symbolize_test.cc:349: Failure -# Expected equality of these values: -# expected[i] -# Which is: "kPadding1" -# buf -# Which is: "" -# [ FAILED ] Symbolize.SymbolizeWithMultipleMaps (1 ms) -sed -r -i 's/\bSymbolizeWithMultipleMaps\b/DISABLED_&/' \ - absl/debugging/symbolize_test.cc -%endif - %build %cmake \ @@ -133,6 +96,9 @@ sed -r -i 's/\bSymbolizeWithMultipleMaps\b/DISABLED_&/' \ %{_libdir}/pkgconfig/*.pc %changelog +* Tue Mar 15 2022 Benjamin A. Beasley - 20211102.0-2 +- Disable LTO on s390x to work around test failure + * Fri Feb 18 2022 Benjamin A. Beasley - 20211102.0-1 - Update to 20211102.0 (close RHBZ#2019691) - Drop --output-on-failure, already in %%ctest expansion From 597be65ab2e6857ddda009c2cba42e93760abf4e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 15 Mar 2022 14:49:41 -0400 Subject: [PATCH 2/7] Disable SysinfoTest.NominalCPUFrequency in absl_sysinfo_test This fails occasionally on aarch64, and upstream reports that it is not meaningful except for Google internal users. See: NominalCPUFrequency Test from SysInfoTest Suite Fails on M1 Mac https://github.com/abseil/abseil-cpp/issues/1053#issuecomment-961432444 --- ...211102.0-disable-nominalcpufrequency.patch | 44 +++++++++++++++++++ abseil-cpp.spec | 22 ++++++++++ 2 files changed, 66 insertions(+) create mode 100644 abseil-cpp-20211102.0-disable-nominalcpufrequency.patch diff --git a/abseil-cpp-20211102.0-disable-nominalcpufrequency.patch b/abseil-cpp-20211102.0-disable-nominalcpufrequency.patch new file mode 100644 index 0000000..e1351d8 --- /dev/null +++ b/abseil-cpp-20211102.0-disable-nominalcpufrequency.patch @@ -0,0 +1,44 @@ +From d984ddf1a64ce9fae36395b423cf6e52afc9a07a Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Wed, 16 Mar 2022 14:33:41 -0400 +Subject: [PATCH] Disable SysinfoTest.NominalCPUFrequency + +SysinfoTest.NominalCPUFrequency in absl_sysinfo_test fails occasionally +on aarch64, but see: + +NominalCPUFrequency Test from SysInfoTest Suite Fails on M1 Mac +https://github.com/abseil/abseil-cpp/issues/1053#issuecomment-961432444 + +in which an upstream author opines: + + If the only problem you are trying to solve is a failing test, this is safe + to ignore since this code is never called. I should consider stripping this + test out of the open source release. NominalCPUFrequency is only called in + code private to Google and we do have tests on the platforms we use it on. + +We therefore disable it on all architectures, since any future failures +will also not be meaningful. + +Note also that this test is removed upstream in commit +732b5580f089101ce4b8cdff55bb6461c59a6720 (internal commit +7e8da4f14afd25d11713eee6b743ba31605332bf). +--- + absl/base/internal/sysinfo_test.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/absl/base/internal/sysinfo_test.cc b/absl/base/internal/sysinfo_test.cc +index 5f9e45f..1a944f0 100644 +--- a/absl/base/internal/sysinfo_test.cc ++++ b/absl/base/internal/sysinfo_test.cc +@@ -44,7 +44,7 @@ TEST(SysinfoTest, NumCPUs) { + // 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) { ++TEST(SysinfoTest, DISABLED_NominalCPUFrequency) { + // Linux only exposes the CPU frequency on certain architectures, and + // Emscripten doesn't expose it at all. + #if defined(__linux__) && \ +-- +2.35.1 + diff --git a/abseil-cpp.spec b/abseil-cpp.spec index d1a563a..fadc022 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -14,6 +14,26 @@ Source0: https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}- # released version of GTest. Not submitted upstream, as this is a workaround # rather than a fix. https://github.com/abseil/abseil-cpp/issues/1063 Patch0: abseil-cpp-20211102.0-gtest-unreleased-features.patch +# SysinfoTest.NominalCPUFrequency in absl_sysinfo_test fails occasionally +# on aarch64, but see: +# +# NominalCPUFrequency Test from SysInfoTest Suite Fails on M1 Mac +# https://github.com/abseil/abseil-cpp/issues/1053#issuecomment-961432444 +# +# in which an upstream author opines: +# +# If the only problem you are trying to solve is a failing test, this is safe +# to ignore since this code is never called. I should consider stripping this +# test out of the open source release. NominalCPUFrequency is only called in +# code private to Google and we do have tests on the platforms we use it on. +# +# We therefore disable it on all architectures, since any future failures +# will also not be meaningful. +# +# Note also that this test is removed upstream in commit +# 732b5580f089101ce4b8cdff55bb6461c59a6720 (internal commit +# 7e8da4f14afd25d11713eee6b743ba31605332bf). +Patch1: abseil-cpp-20211102.0-disable-nominalcpufrequency.patch BuildRequires: cmake # The default make backend would work just as well; ninja is observably faster @@ -98,6 +118,8 @@ find . -type f -name '*.cc' \ %changelog * Tue Mar 15 2022 Benjamin A. Beasley - 20211102.0-2 - Disable LTO on s390x to work around test failure +- Skip SysinfoTest.NominalCPUFrequency on all architectures; it fails + occasionally on aarch64, and upstream says we should not care * Fri Feb 18 2022 Benjamin A. Beasley - 20211102.0-1 - Update to 20211102.0 (close RHBZ#2019691) From 77f3f2338021787fca5c4da730fd0211027cc23c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 29 Jul 2022 08:06:33 -0400 Subject: [PATCH 3/7] Do not leak -maes -msse4.1 into pkgconfig (fix RHBZ#2108658) --- ...6049995584c3489e4bd1467313e3e85af99c.patch | 22 +++++++++++++++++++ abseil-cpp.spec | 17 +++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 09e96049995584c3489e4bd1467313e3e85af99c.patch diff --git a/09e96049995584c3489e4bd1467313e3e85af99c.patch b/09e96049995584c3489e4bd1467313e3e85af99c.patch new file mode 100644 index 0000000..d6b1325 --- /dev/null +++ b/09e96049995584c3489e4bd1467313e3e85af99c.patch @@ -0,0 +1,22 @@ +From 09e96049995584c3489e4bd1467313e3e85af99c Mon Sep 17 00:00:00 2001 +From: Bruno Pitrus +Date: Mon, 11 Jul 2022 18:27:39 +0200 +Subject: [PATCH] Do not leak -maes -msse4.1 into pkgconfig + +--- + CMake/AbseilHelpers.cmake | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake +index ebe9ddc87..9cd87c513 100644 +--- a/CMake/AbseilHelpers.cmake ++++ b/CMake/AbseilHelpers.cmake +@@ -166,6 +166,8 @@ function(absl_cc_library) + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") + elseif(${cflag} MATCHES "^(-W|/w[1234eo])") + # Don't impose our warnings on others. ++ elseif(${cflag} MATCHES "^-m") ++ # Don't impose CPU instruction requirements on others, as the code performs feature detection on runtime. + else() + set(PC_CFLAGS "${PC_CFLAGS} ${cflag}") + endif() diff --git a/abseil-cpp.spec b/abseil-cpp.spec index fadc022..158d1a9 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -3,7 +3,7 @@ Name: abseil-cpp Version: 20211102.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: C++ Common Libraries License: ASL 2.0 @@ -13,7 +13,7 @@ Source0: https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}- # Remove test assertions that use ::testing::Conditional, which is not in a # released version of GTest. Not submitted upstream, as this is a workaround # rather than a fix. https://github.com/abseil/abseil-cpp/issues/1063 -Patch0: abseil-cpp-20211102.0-gtest-unreleased-features.patch +Patch: abseil-cpp-20211102.0-gtest-unreleased-features.patch # SysinfoTest.NominalCPUFrequency in absl_sysinfo_test fails occasionally # on aarch64, but see: # @@ -33,7 +33,15 @@ Patch0: abseil-cpp-20211102.0-gtest-unreleased-features.patch # Note also that this test is removed upstream in commit # 732b5580f089101ce4b8cdff55bb6461c59a6720 (internal commit # 7e8da4f14afd25d11713eee6b743ba31605332bf). -Patch1: abseil-cpp-20211102.0-disable-nominalcpufrequency.patch +Patch: abseil-cpp-20211102.0-disable-nominalcpufrequency.patch +# Backport upstream commit 09e96049995584c3489e4bd1467313e3e85af99c, which +# corresponds to: +# +# Do not leak -maes -msse4.1 into pkgconfig +# https://github.com/abseil/abseil-cpp/pull/1216 +# +# Fixes RHBZ#2108658. +Patch: https://github.com/abseil/abseil-cpp/commit/09e96049995584c3489e4bd1467313e3e85af99c.patch BuildRequires: cmake # The default make backend would work just as well; ninja is observably faster @@ -116,6 +124,9 @@ find . -type f -name '*.cc' \ %{_libdir}/pkgconfig/*.pc %changelog +* Fri Jul 29 2022 Benjamin A. Beasley - 20211102.0-3 +- Do not leak -maes -msse4.1 into pkgconfig (fix RHBZ#2108658) + * Tue Mar 15 2022 Benjamin A. Beasley - 20211102.0-2 - Disable LTO on s390x to work around test failure - Skip SysinfoTest.NominalCPUFrequency on all architectures; it fails From c825cd247b4c0d71f4c9bad45d1eeae7e649fd97 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 13 Aug 2022 09:44:55 -0400 Subject: [PATCH 4/7] Update License to SPDX --- abseil-cpp.spec | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 158d1a9..3c0534e 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -3,10 +3,20 @@ Name: abseil-cpp Version: 20211102.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: C++ Common Libraries -License: ASL 2.0 +# The entire source is Apache-2.0, except: +# - The following files are LicenseRef-Fedora-Public-Domain: +# absl/time/internal/cctz/src/tzfile.h +# ** This file is in the public domain, so clarified as of +# ** 1996-06-05 by Arthur David Olson. +# absl/time/internal/cctz/testdata/zoneinfo/iso3166.tab +# # This file is in the public domain, so clarified as of +# # 2009-05-17 by Arthur David Olson. +# absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab +# # This file is in the public domain. +License: Apache-2.0 AND LicenseRef-Fedora-Public-Domain URL: https://abseil.io Source0: https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}-%{version}.tar.gz @@ -124,6 +134,9 @@ find . -type f -name '*.cc' \ %{_libdir}/pkgconfig/*.pc %changelog +* Sat Jan 25 2025 Benjamin A. Beasley - 20211102.0-4 +- Update License to SPDX + * Fri Jul 29 2022 Benjamin A. Beasley - 20211102.0-3 - Do not leak -maes -msse4.1 into pkgconfig (fix RHBZ#2108658) From 1db674ec9c201b81d05d2d8214ee622678fc8109 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 24 Jan 2025 19:53:41 -0500 Subject: [PATCH 5/7] Add a spec-file note about public-domain license text Partial backport of e2ad089b322257efbc4719c60b51fa0b6bedc6dd --- abseil-cpp.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 3c0534e..1914e86 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -16,6 +16,10 @@ Summary: C++ Common Libraries # # 2009-05-17 by Arthur David Olson. # absl/time/internal/cctz/testdata/zoneinfo/zone1970.tab # # This file is in the public domain. +# Public-domain license text for these files was added to the +# public-domain-text.txt file in fedora-license-data in commit +# 538bc87d5e3c1cb08e81d690ce4122e1273dc9cd +# (https://gitlab.com/fedora/legal/fedora-license-data/-/merge_requests/205). License: Apache-2.0 AND LicenseRef-Fedora-Public-Domain URL: https://abseil.io Source0: https://github.com/abseil/abseil-cpp/archive/%{version}/%{name}-%{version}.tar.gz From dfa9e68631429f5d8a4b756c737dbeeb61640f87 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 24 Jan 2025 19:57:52 -0500 Subject: [PATCH 6/7] Indicate CCTZ bundling Partial backport of e2ad089b322257efbc4719c60b51fa0b6bedc6dd --- abseil-cpp.spec | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 1914e86..73c8f05 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -65,6 +65,18 @@ BuildRequires: gcc-c++ BuildRequires: gmock-devel BuildRequires: gtest-devel +# The contents of absl/time/internal/cctz are derived from +# https://github.com/google/cctz (https://src.fedoraproject.org/rpms/cctz), but +# have been forked with Abseil-specific changes. It is not obvious from which +# particular version of CCTZ these sources are derived. Upstream was asked +# about a path to supporting a system copy as required by bundling guidelines: +# Please comment on CCTZ bundling +# https://github.com/abseil/abseil-cpp/discussions/1415 +# They refused, for the time being, as follows: +# “[…] we have no plans to change this decision, but we reserve the right to +# change our minds.” +Provides: bundled(cctz) + %ifarch s390x # Symbolize.SymbolizeWithMultipleMaps fails in absl_symbolize_test on s390x # with LTO @@ -91,6 +103,10 @@ and we now want to provide those resources to the C++ community as a whole. Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} +# Some of the headers from CCTZ are part of the -devel subpackage. See the +# corresponding virtual Provides in the base package for full details. +Provides: bundled(cctz) + %description devel Development headers for %{name} @@ -140,6 +156,7 @@ find . -type f -name '*.cc' \ %changelog * Sat Jan 25 2025 Benjamin A. Beasley - 20211102.0-4 - Update License to SPDX +- Indicate CCTZ bundling * Fri Jul 29 2022 Benjamin A. Beasley - 20211102.0-3 - Do not leak -maes -msse4.1 into pkgconfig (fix RHBZ#2108658) From a28815cce96836ddf11ed19f72298a93acb70855 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Jan 2025 11:11:07 -0500 Subject: [PATCH 7/7] Report and skip a test regression on ppc64le --- abseil-cpp.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 73c8f05..9befa51 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -140,7 +140,16 @@ find . -type f -name '*.cc' \ %cmake_install %check -%ctest +skips='^($.' +%ifarch ppc64le +# [Bug]: Flaky test failures in absl_failure_signal_handler_test on ppc64le in +# Fedora +# https://github.com/abseil/abseil-cpp/issues/1804 +skips="${skips}|absl_failure_signal_handler_test" +%endif +skips="${skips})$" + +%ctest --exclude-regex "${skips}" %files %license LICENSE @@ -157,6 +166,7 @@ find . -type f -name '*.cc' \ * Sat Jan 25 2025 Benjamin A. Beasley - 20211102.0-4 - Update License to SPDX - Indicate CCTZ bundling +- Report and skip a test regression on ppc64le * Fri Jul 29 2022 Benjamin A. Beasley - 20211102.0-3 - Do not leak -maes -msse4.1 into pkgconfig (fix RHBZ#2108658)