From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id ABB2415800F for ; Wed, 4 Jan 2023 06:04:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CF132E07C7; Wed, 4 Jan 2023 06:04:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B54A9E07C7 for ; Wed, 4 Jan 2023 06:04:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E5F56340E23 for ; Wed, 4 Jan 2023 06:04:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5261A7F0 for ; Wed, 4 Jan 2023 06:04:32 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1672812261.7778f9cadb610c8d9cdc057fe1781009d776511f.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/files/, dev-libs/protobuf/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/protobuf/files/protobuf-21.9-disable-32-bit-tests.patch dev-libs/protobuf/protobuf-21.9.ebuild X-VCS-Directories: dev-libs/protobuf/files/ dev-libs/protobuf/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7778f9cadb610c8d9cdc057fe1781009d776511f X-VCS-Branch: master Date: Wed, 4 Jan 2023 06:04:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 499342c8-fe79-4960-b061-5536526b54d5 X-Archives-Hash: e89bfcf7343e1208c3148ca203f1038a commit: 7778f9cadb610c8d9cdc057fe1781009d776511f Author: Sam James gentoo org> AuthorDate: Wed Jan 4 05:58:56 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jan 4 06:04:21 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7778f9ca dev-libs/protobuf: backport 32-bit test fixes Closes: https://bugs.gentoo.org/875584 Signed-off-by: Sam James gentoo.org> .../files/protobuf-21.9-disable-32-bit-tests.patch | 118 +++++++++++++++++++++ dev-libs/protobuf/protobuf-21.9.ebuild | 3 +- 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/dev-libs/protobuf/files/protobuf-21.9-disable-32-bit-tests.patch b/dev-libs/protobuf/files/protobuf-21.9-disable-32-bit-tests.patch new file mode 100644 index 000000000000..cd6b5aa2db6d --- /dev/null +++ b/dev-libs/protobuf/files/protobuf-21.9-disable-32-bit-tests.patch @@ -0,0 +1,118 @@ +https://bugs.gentoo.org/875584 +https://github.com/protocolbuffers/protobuf/pull/10589 + +From 5f4a52d9bff7595ec47fb6727662a1cada3cd404 Mon Sep 17 00:00:00 2001 +From: Mike Kruskal +Date: Thu, 15 Sep 2022 10:23:23 -0700 +Subject: [PATCH 3/7] Patching static assert test failure + +--- a/src/google/protobuf/extension_set_unittest.cc ++++ b/src/google/protobuf/extension_set_unittest.cc +@@ -855,8 +855,10 @@ TEST(ExtensionSetTest, SpaceUsedExcludingSelf) { + const size_t old_capacity = \ + message->GetRepeatedExtension(unittest::repeated_##type##_extension) \ + .Capacity(); \ +- EXPECT_GE(old_capacity, \ +- (RepeatedFieldLowerClampLimit())); \ ++ EXPECT_GE( \ ++ old_capacity, \ ++ (RepeatedFieldLowerClampLimit())); \ + for (int i = 0; i < 16; ++i) { \ + message->AddExtension(unittest::repeated_##type##_extension, value); \ + } \ + +From c94b66706bec17d918495f4715183a5eaf0f8044 Mon Sep 17 00:00:00 2001 +From: Mike Kruskal +Date: Thu, 15 Sep 2022 11:31:31 -0700 +Subject: [PATCH 4/7] Test fixes for 32-bit architectures + +--- a/src/google/protobuf/compiler/cpp/message_size_unittest.cc ++++ b/src/google/protobuf/compiler/cpp/message_size_unittest.cc +@@ -139,9 +139,9 @@ TEST(GeneratedMessageTest, OneStringSize) { + + TEST(GeneratedMessageTest, MoreStringSize) { + struct MockGenerated : public MockMessageBase { // 16 bytes +- int has_bits[1]; // 4 bytes + int cached_size; // 4 bytes + MockRepeatedPtrField data; // 24 bytes ++ // + 4 bytes padding + }; + GOOGLE_CHECK_MESSAGE_SIZE(MockGenerated, 48); + EXPECT_EQ(sizeof(protobuf_unittest::MoreString), sizeof(MockGenerated)); +--- a/src/google/protobuf/io/zero_copy_stream_unittest.cc ++++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc +@@ -720,6 +720,9 @@ TEST_F(IoTest, StringIo) { + + // Verifies that outputs up to kint32max can be created. + TEST_F(IoTest, LargeOutput) { ++ // Filter out this test on 32-bit architectures. ++ if(sizeof(void*) < 8) return; ++ + std::string str; + StringOutputStream output(&str); + void* unused_data; +--- a/src/google/protobuf/repeated_field_unittest.cc ++++ b/src/google/protobuf/repeated_field_unittest.cc +@@ -429,14 +429,14 @@ TEST(RepeatedField, ReserveNothing) { + + TEST(RepeatedField, ReserveLowerClamp) { + int clamped_value = internal::CalculateReserveSize(0, 1); +- EXPECT_GE(clamped_value, 8 / sizeof(bool)); ++ EXPECT_GE(clamped_value, sizeof(void*) / sizeof(bool)); + EXPECT_EQ((internal::RepeatedFieldLowerClampLimit()), + clamped_value); + // EXPECT_EQ(clamped_value, (internal::CalculateReserveSize( clamped_value, 2))); + + clamped_value = internal::CalculateReserveSize(0, 1); +- EXPECT_GE(clamped_value, 8 / sizeof(int)); ++ EXPECT_GE(clamped_value, sizeof(void*) / sizeof(int)); + EXPECT_EQ((internal::RepeatedFieldLowerClampLimit()), + clamped_value); + // EXPECT_EQ(clamped_value, (internal::CalculateReserveSize= sizeof(uint64_t)) { ++ Timestamp begin, end; ++ EXPECT_TRUE(TimeUtil::FromString("0001-01-01T00:00:00Z", &begin)); ++ EXPECT_EQ(TimeUtil::kTimestampMinSeconds, begin.seconds()); ++ EXPECT_EQ(0, begin.nanos()); ++ EXPECT_TRUE(TimeUtil::FromString("9999-12-31T23:59:59.999999999Z", &end)); ++ EXPECT_EQ(TimeUtil::kTimestampMaxSeconds, end.seconds()); ++ EXPECT_EQ(999999999, end.nanos()); ++ EXPECT_EQ("0001-01-01T00:00:00Z", TimeUtil::ToString(begin)); ++ EXPECT_EQ("9999-12-31T23:59:59.999999999Z", TimeUtil::ToString(end)); ++ } + + // Test negative timestamps. + Timestamp time = TimeUtil::NanosecondsToTimestamp(-1); +@@ -94,9 +97,12 @@ TEST(TimeUtilTest, DurationStringFormat) { + EXPECT_TRUE(TimeUtil::FromString("0001-01-01T00:00:00Z", &begin)); + EXPECT_TRUE(TimeUtil::FromString("9999-12-31T23:59:59.999999999Z", &end)); + +- EXPECT_EQ("315537897599.999999999s", TimeUtil::ToString(end - begin)); ++ // These these are out of bounds for 32-bit architectures. ++ if(sizeof(time_t) >= sizeof(uint64_t)) { ++ EXPECT_EQ("315537897599.999999999s", TimeUtil::ToString(end - begin)); ++ EXPECT_EQ("-315537897599.999999999s", TimeUtil::ToString(begin - end)); ++ } + EXPECT_EQ(999999999, (end - begin).nanos()); +- EXPECT_EQ("-315537897599.999999999s", TimeUtil::ToString(begin - end)); + EXPECT_EQ(-999999999, (begin - end).nanos()); + + // Generated output should contain 3, 6, or 9 fractional digits. diff --git a/dev-libs/protobuf/protobuf-21.9.ebuild b/dev-libs/protobuf/protobuf-21.9.ebuild index c282450ef22d..7960f6d252ce 100644 --- a/dev-libs/protobuf/protobuf-21.9.ebuild +++ b/dev-libs/protobuf/protobuf-21.9.ebuild @@ -1,4 +1,4 @@ -# Copyright 2008-2022 Gentoo Authors +# Copyright 2008-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -35,6 +35,7 @@ PATCHES=( "${FILESDIR}/${PN}-3.19.0-disable_no-warning-test.patch" "${FILESDIR}/${PN}-3.19.0-system_libraries.patch" "${FILESDIR}/${PN}-3.20.2-protoc_input_output_files.patch" + "${FILESDIR}/${PN}-21.9-disable-32-bit-tests.patch" ) DOCS=(CHANGES.txt CONTRIBUTORS.txt README.md)