diff --git a/pkgs/by-name/ap/apache-orc/cmake-link-abseil.patch b/pkgs/by-name/ap/apache-orc/cmake-link-abseil.patch new file mode 100644 index 0000000000000..4c1416901f024 --- /dev/null +++ b/pkgs/by-name/ap/apache-orc/cmake-link-abseil.patch @@ -0,0 +1,12 @@ +diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt +index 81e2da6f19..cdb809aed9 100644 +--- a/tools/src/CMakeLists.txt ++++ b/tools/src/CMakeLists.txt +@@ -64,6 +64,7 @@ + target_link_libraries (orc-metadata + orc-tools-common + orc::protobuf ++ absl::raw_hash_set + ) + + add_executable (orc-statistics diff --git a/pkgs/by-name/ap/apache-orc/package.nix b/pkgs/by-name/ap/apache-orc/package.nix index 577eb5013e7e6..57d13a92797eb 100644 --- a/pkgs/by-name/ap/apache-orc/package.nix +++ b/pkgs/by-name/ap/apache-orc/package.nix @@ -27,15 +27,29 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "apache-orc"; - version = "2.2.1"; + version = "2.3.0"; src = fetchFromGitHub { owner = "apache"; repo = "orc"; tag = "v${finalAttrs.version}"; - hash = "sha256-H7nowl2pq31RIAmTUz15x48Wc99MljFJboc4F7Ln/zk="; + hash = "sha256-QQdRzwmUF1Qwxg53kJv1Q6yFuHqSrLYwUxKt+6wK9Hs="; }; + patches = [ + # Orc's CMake declarations do not correctly attempt to link in abseil, + # so we add the relevant library they need. Without these, we get errors + # like: + # /bin/ld: /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 = [ cmake ]; @@ -65,12 +79,12 @@ stdenv.mkDerivation (finalAttrs: { env = { GTEST_HOME = gtest.dev; - LZ4_ROOT = lz4; + LZ4_HOME = lz4; ORC_FORMAT_URL = orc-format; PROTOBUF_HOME = protobuf; - SNAPPY_ROOT = snappy.dev; - ZLIB_ROOT = zlib.dev; - ZSTD_ROOT = zstd.dev; + SNAPPY_HOME = snappy.dev; + ZLIB_HOME = zlib.dev; + ZSTD_HOME = zstd.dev; }; meta = { diff --git a/pkgs/by-name/ap/apache-orc/protobuf34-nodiscard.patch b/pkgs/by-name/ap/apache-orc/protobuf34-nodiscard.patch new file mode 100644 index 0000000000000..643b7da2aeca2 --- /dev/null +++ b/pkgs/by-name/ap/apache-orc/protobuf34-nodiscard.patch @@ -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; diff --git a/pkgs/by-name/ar/arrow-cpp/package.nix b/pkgs/by-name/ar/arrow-cpp/package.nix index 9d1a29b09cc67..ad816e4ff8cc9 100644 --- a/pkgs/by-name/ar/arrow-cpp/package.nix +++ b/pkgs/by-name/ar/arrow-cpp/package.nix @@ -131,8 +131,10 @@ stdenv.mkDerivation (finalAttrs: { }; # apache-orc looks for things in caps - LZ4_ROOT = lz4; - ZSTD_ROOT = zstd.dev; + LZ4_HOME = lz4; + PROTOBUF_HOME = protobuf; + SNAPPY_HOME = snappy.dev; + ZSTD_HOME = zstd.dev; ARROW_TEST_DATA = "${arrow-testing}/data"; PARQUET_TEST_DATA = "${parquet-testing}/data"; GTEST_FILTER =