Source: protobuf Version: 3.0.0-6 Severity: important Tags: upstream patch Control: block 835435 by -1 Control: block 835170 by -1
Dear Maintainer, To fix the ostinato build failure with protobuf 3.0.0 (#835435), the attached patch is required to restore the New*Callback into the google::protobuf namespace. The patch was taken from the PR by Srivats P (ostinato upstream) which should be merged into protobuf upstream soon. [0] [0] https://github.com/google/protobuf/pull/2024 Kind Regards, Bas
diff -Nru protobuf-3.0.0/debian/changelog protobuf-3.0.0/debian/changelog --- protobuf-3.0.0/debian/changelog 2016-08-27 01:02:16.000000000 +0200 +++ protobuf-3.0.0/debian/changelog 2016-08-31 15:15:24.000000000 +0200 @@ -1,3 +1,11 @@ +protobuf (3.0.0-6.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Add patch by Srivats P to restore New*Callback into google::protobuf + namespace. Required for ostinato (#835435). + + -- Bas Couwenberg <[email protected]> Wed, 31 Aug 2016 15:13:00 +0200 + protobuf (3.0.0-6) unstable; urgency=medium * New "java-test-scope.patch" to set scope of "junit" and "easymock" to diff -Nru protobuf-3.0.0/debian/patches/Restore-New-Callback-into-google-protobuf-namespace.patch protobuf-3.0.0/debian/patches/Restore-New-Callback-into-google-protobuf-namespace.patch --- protobuf-3.0.0/debian/patches/Restore-New-Callback-into-google-protobuf-namespace.patch 1970-01-01 01:00:00.000000000 +0100 +++ protobuf-3.0.0/debian/patches/Restore-New-Callback-into-google-protobuf-namespace.patch 2016-08-31 15:12:55.000000000 +0200 @@ -0,0 +1,106 @@ +Description: Restore New*Callback into google::protobuf namespace + since these are used by the service stubs code +Author: Srivats P <[email protected]> +Origin: https://github.com/pstavirs/protobuf/commit/eedc7be6803924e158e6a08471bbdf1908c7a93e +Bug: https://github.com/google/protobuf/issues/1966 + +--- a/src/google/protobuf/compiler/cpp/cpp_message.cc ++++ b/src/google/protobuf/compiler/cpp/cpp_message.cc +@@ -2956,7 +2956,7 @@ GenerateMergeFromCodedStream(io::Printer + // on the CodedOutputStream. + printer->Print( + " ::google::protobuf::io::LazyStringOutputStream unknown_fields_string(\n" +- " ::google::protobuf::internal::NewPermanentCallback(\n" ++ " ::google::protobuf::NewPermanentCallback(\n" + " &MutableUnknownFieldsFor$classname$, this));\n" + " ::google::protobuf::io::CodedOutputStream unknown_fields_stream(\n" + " &unknown_fields_string, false);\n", +--- a/src/google/protobuf/compiler/cpp/cpp_unittest.cc ++++ b/src/google/protobuf/compiler/cpp/cpp_unittest.cc +@@ -1252,7 +1252,7 @@ class GeneratedServiceTest : public test + foo_(descriptor_->FindMethodByName("Foo")), + bar_(descriptor_->FindMethodByName("Bar")), + stub_(&mock_channel_), +- done_(::google::protobuf::internal::NewPermanentCallback(&DoNothing)) {} ++ done_(NewPermanentCallback(&DoNothing)) {} + + virtual void SetUp() { + ASSERT_TRUE(foo_ != NULL); +--- a/src/google/protobuf/stubs/callback.h ++++ b/src/google/protobuf/stubs/callback.h +@@ -381,6 +381,8 @@ class MethodResultCallback_5_2 : public + typename remove_reference<P5>::type p5_; + }; + ++} // namespace internal ++ + // See Closure. + inline Closure* NewCallback(void (*function)()) { + return new internal::FunctionClosure0(function, true); +@@ -533,8 +535,6 @@ inline ResultCallback2<R, A1, A2>* NewPe + p2, p3, p4, p5); + } + +-} // namespace internal +- + // A function which does nothing. Useful for creating no-op callbacks, e.g.: + // Closure* nothing = NewCallback(&DoNothing); + void LIBPROTOBUF_EXPORT DoNothing(); +--- a/src/google/protobuf/stubs/common_unittest.cc ++++ b/src/google/protobuf/stubs/common_unittest.cc +@@ -41,8 +41,6 @@ + + namespace google { + namespace protobuf { +-using internal::NewCallback; +-using internal::NewPermanentCallback; + namespace { + + // TODO(kenton): More tests. +--- a/src/google/protobuf/stubs/once_unittest.cc ++++ b/src/google/protobuf/stubs/once_unittest.cc +@@ -43,7 +43,6 @@ + + namespace google { + namespace protobuf { +-using internal::NewCallback; + namespace { + + class OnceInitTest : public testing::Test { +@@ -128,11 +127,11 @@ class OnceInitTest : public testing::Tes + }; + + TestThread* RunInitOnceInNewThread() { +- return new TestThread(internal::NewCallback(this, &OnceInitTest::InitOnce)); ++ return new TestThread(NewCallback(this, &OnceInitTest::InitOnce)); + } + TestThread* RunInitRecursiveOnceInNewThread() { + return new TestThread( +- internal::NewCallback(this, &OnceInitTest::InitRecursiveOnce)); ++ NewCallback(this, &OnceInitTest::InitRecursiveOnce)); + } + + enum State { +--- a/src/google/protobuf/util/internal/protostream_objectwriter.cc ++++ b/src/google/protobuf/util/internal/protostream_objectwriter.cc +@@ -907,7 +907,7 @@ Status ProtoStreamObjectWriter::RenderFi + // conversions as much as possible. Because ToSnakeCase sometimes returns the + // wrong value. + google::protobuf::scoped_ptr<ResultCallback1<util::Status, StringPiece> > callback( +- ::google::protobuf::internal::NewPermanentCallback(&RenderOneFieldPath, ow)); ++ NewPermanentCallback(&RenderOneFieldPath, ow)); + return DecodeCompactFieldMaskPaths(data.str(), callback.get()); + } + +--- a/src/google/protobuf/util/message_differencer.cc ++++ b/src/google/protobuf/util/message_differencer.cc +@@ -1389,8 +1389,7 @@ bool MessageDifferencer::MatchRepeatedFi + // doesn't necessarily imply Compare(b, c). Therefore a naive greedy + // algorithm will fail to find a maximum matching. + // Here we use the argumenting path algorithm. +- MaximumMatcher::NodeMatchCallback* callback = +- ::google::protobuf::internal::NewPermanentCallback( ++ MaximumMatcher::NodeMatchCallback* callback = NewPermanentCallback( + this, &MessageDifferencer::IsMatch, + repeated_field, key_comparator, + &message1, &message2, parent_fields); diff -Nru protobuf-3.0.0/debian/patches/series protobuf-3.0.0/debian/patches/series --- protobuf-3.0.0/debian/patches/series 2016-08-27 00:58:15.000000000 +0200 +++ protobuf-3.0.0/debian/patches/series 2016-08-31 15:12:49.000000000 +0200 @@ -4,3 +4,4 @@ misleading-indentation.patch s390x.patch sparc64.patch +Restore-New-Callback-into-google-protobuf-namespace.patch

