public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/files/, dev-libs/protobuf/
Date: Wed,  4 Jan 2023 06:04:32 +0000 (UTC)	[thread overview]
Message-ID: <1672812261.7778f9cadb610c8d9cdc057fe1781009d776511f.sam@gentoo> (raw)

commit:     7778f9cadb610c8d9cdc057fe1781009d776511f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  4 05:58:56 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <sam <AT> 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 <mkruskal@google.com>
+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<cpptype, sizeof(void*)>()));       \
++    EXPECT_GE(                                                                 \
++        old_capacity,                                                          \
++        (RepeatedFieldLowerClampLimit<cpptype, std::max(sizeof(cpptype),       \
++                                                        sizeof(void*))>()));   \
+     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 <mkruskal@google.com>
+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<bool, sizeof(void*)>(0, 1);
+-  EXPECT_GE(clamped_value, 8 / sizeof(bool));
++  EXPECT_GE(clamped_value, sizeof(void*) / sizeof(bool));
+   EXPECT_EQ((internal::RepeatedFieldLowerClampLimit<bool, sizeof(void*)>()),
+             clamped_value);
+   // EXPECT_EQ(clamped_value, (internal::CalculateReserveSize<bool,
+   // sizeof(void*)>( clamped_value, 2)));
+ 
+   clamped_value = internal::CalculateReserveSize<int, sizeof(void*)>(0, 1);
+-  EXPECT_GE(clamped_value, 8 / sizeof(int));
++  EXPECT_GE(clamped_value, sizeof(void*) / sizeof(int));
+   EXPECT_EQ((internal::RepeatedFieldLowerClampLimit<int, sizeof(void*)>()),
+             clamped_value);
+   // EXPECT_EQ(clamped_value, (internal::CalculateReserveSize<int,
+--- a/src/google/protobuf/util/time_util_test.cc
++++ b/src/google/protobuf/util/time_util_test.cc
+@@ -48,15 +48,18 @@ using google::protobuf::Timestamp;
+ namespace {
+ 
+ TEST(TimeUtilTest, TimestampStringFormat) {
+-  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));
++  // These these are out of bounds for 32-bit architectures.
++  if(sizeof(time_t) >= 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)


             reply	other threads:[~2023-01-04  6:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04  6:04 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-08-21 17:31 [gentoo-commits] repo/gentoo:master commit in: dev-libs/protobuf/files/, dev-libs/protobuf/ Sam James
2023-06-27 20:14 Andreas Sturmlechner
2022-10-25 21:55 Sam James
2022-09-02 15:18 Arthur Zamarin
2022-08-18  2:53 Matt Turner
2022-01-29 15:20 Yixun Lan
2021-06-04 19:51 Mike Gilbert
2021-05-31 23:04 Mike Gilbert
2021-04-09 22:32 Mike Gilbert
2021-04-09 22:32 Mike Gilbert
2020-12-27 18:39 Mike Gilbert
2020-09-24 14:26 Mike Gilbert
2020-09-15 18:34 Mike Gilbert
2019-12-06 20:25 Mike Gilbert
2019-06-18 15:59 Mike Gilbert
2019-04-19 16:39 Mike Gilbert
2018-10-19 17:39 Mike Gilbert
2018-10-02 20:08 Mike Gilbert
2017-09-21 21:06 Mike Gilbert
2017-05-09 17:18 Michał Górny
2016-04-21  9:52 Ian Delaney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1672812261.7778f9cadb610c8d9cdc057fe1781009d776511f.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox