From cedf46f81545d5fa61cdd6edab7b4d2e750a2bf3 Mon Sep 17 00:00:00 2001 From: whispers Date: Fri, 24 Jul 2026 15:02:23 -0400 Subject: [PATCH] apache-orc: explicitly specify C++17 for abseil-cpp abseil exposes different interfaces depending on what is available in `std` in a given C++ standard. gcc 16 defaults to C++20, thus causing the default abseil-cpp to expose a different interface than the one apache-orc (built with C++17) expects. this leads to a great deal of "error: 'partial_ordering' has not been declared in 'std'" and similar originating from abseil's types/compare.h. thus, we explicitly override abseil to specify the desired C++ standard. this happens through protobuf as abseil-cpp is in its propagatedBuildInputs. --- pkgs/by-name/ap/apache-orc/package.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ap/apache-orc/package.nix b/pkgs/by-name/ap/apache-orc/package.nix index 42d546715507..53391c6a1545 100644 --- a/pkgs/by-name/ap/apache-orc/package.nix +++ b/pkgs/by-name/ap/apache-orc/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, fetchurl, cmake, + abseil-cpp_202601, gtest, lz4, protobuf, @@ -13,6 +14,11 @@ }: let + # This standard needs to match the version that orc uses, or compilation + # fails if the C++ standard version is different from the compiler's default. + # https://github.com/apache/orc/blob/3738b82366ba64cacae450e7e0e1702c66148afe/CMakeLists.txt#L108 + protobuf' = protobuf.override { abseil-cpp = abseil-cpp_202601.override { cxxStandard = "17"; }; }; + orc-format = let version = "1.1.1"; @@ -57,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ gtest lz4 - protobuf + protobuf' snappy zlib zstd @@ -81,7 +87,7 @@ stdenv.mkDerivation (finalAttrs: { GTEST_HOME = gtest.dev; LZ4_HOME = lz4; ORC_FORMAT_URL = orc-format; - PROTOBUF_HOME = protobuf; + PROTOBUF_HOME = protobuf'; SNAPPY_HOME = snappy.dev; ZLIB_HOME = zlib.dev; ZSTD_HOME = zstd.dev;