apache-orc: fix build with protobuf 34

Protobuf 34 adds `[[nodiscard]]` to several serialization functions. In
order to avoid these warnings causing build failures, we add handling
for this failure case
This commit is contained in:
whispers
2026-03-12 20:56:43 -04:00
parent 180b262407
commit fc00bcd2f5
2 changed files with 20 additions and 0 deletions
+5
View File
@@ -43,6 +43,11 @@ stdenv.mkDerivation (finalAttrs: {
# <store path>/bin/ld: <store path>/lib/libabsl_raw_hash-set.so.2601.0.0:
# error adding symbols: DSO missing from command line
./cmake-link-abseil.patch
# Protobuf 34 adds `[[nodiscard]]` to several serialization functions. In
# order to avoid these warnings causing build failures, we add handling for
# this failure case.
./protobuf34-nodiscard.patch
];
nativeBuildInputs = [
@@ -0,0 +1,15 @@
diff --git a/c++/src/ColumnWriter.cc b/c++/src/ColumnWriter.cc
index 9cdbae0709..d049e91bb1 100644
--- a/c++/src/ColumnWriter.cc
+++ b/c++/src/ColumnWriter.cc
@@ -212,7 +212,9 @@
}
}
// write row index to output stream
- rowIndex->SerializeToZeroCopyStream(indexStream.get());
+ if (!rowIndex->SerializeToZeroCopyStream(indexStream.get())) {
+ throw std::logic_error("Failed to write index stream.");
+ }
// construct row index stream
proto::Stream stream;