diff --git a/protobuf-3.14-disable-IoTest.LargeOutput.patch b/protobuf-3.14-disable-IoTest.LargeOutput.patch new file mode 100644 index 0000000..eea2849 --- /dev/null +++ b/protobuf-3.14-disable-IoTest.LargeOutput.patch @@ -0,0 +1,25 @@ +--- a/src/google/protobuf/io/zero_copy_stream_unittest.cc.orig 2021-01-12 12:25:18.471517830 +0100 ++++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc 2021-01-12 12:25:42.022696126 +0100 +@@ -712,22 +712,6 @@ + } + } + +-// Verifies that outputs up to kint32max can be created. +-TEST_F(IoTest, LargeOutput) { +- std::string str; +- StringOutputStream output(&str); +- void* unused_data; +- int size; +- // Repeatedly calling Next should eventually grow the buffer to kint32max. +- do { +- EXPECT_TRUE(output.Next(&unused_data, &size)); +- } while (str.size() < std::numeric_limits::max()); +- // Further increases should be possible. +- output.Next(&unused_data, &size); +- EXPECT_GT(size, 0); +-} +- +- + // To test files, we create a temporary file, write, read, truncate, repeat. + TEST_F(IoTest, FileIo) { + std::string filename = TestTempDir() + "/zero_copy_stream_test_file"; diff --git a/protobuf.spec b/protobuf.spec index c47fb40..5ec464b 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -17,6 +17,9 @@ Source2: protobuf-init.el # For tests (using exactly the same version as the release) Source3: https://github.com/google/googletest/archive/5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081.zip +# https://github.com/protocolbuffers/protobuf/issues/8082 +Patch1: protobuf-3.14-disable-IoTest.LargeOutput.patch + BuildRequires: make BuildRequires: autoconf BuildRequires: automake @@ -190,7 +193,11 @@ Protocol Buffer BOM POM. %prep %setup -q -n %{name}-%{version}%{?rcver} -a 3 -%autopatch -p1 +%ifarch %{ix86} armv7hl +# IoTest.LargeOutput fails on 32bit arches +# https://github.com/protocolbuffers/protobuf/issues/8082 +%patch1 -p1 +%endif mv googletest-5ec7f0c4a113e2f18ac2c6cc7df51ad6afc24081/* third_party/googletest/ find -name \*.cc -o -name \*.h | xargs chmod -x chmod 644 examples/*