2021-12-06 16:07:01 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, autoconf
|
|
|
|
, aws-sdk-cpp
|
|
|
|
, boost
|
|
|
|
, brotli
|
|
|
|
, c-ares
|
|
|
|
, cmake
|
|
|
|
, crc32c
|
|
|
|
, curl
|
|
|
|
, flatbuffers
|
|
|
|
, gflags
|
|
|
|
, glog
|
|
|
|
, google-cloud-cpp
|
|
|
|
, grpc
|
|
|
|
, gtest
|
2022-05-18 14:49:53 +00:00
|
|
|
, libbacktrace
|
2021-12-06 16:07:01 +00:00
|
|
|
, lz4
|
|
|
|
, minio
|
2022-02-10 20:34:41 +00:00
|
|
|
, ninja
|
2021-12-06 16:07:01 +00:00
|
|
|
, nlohmann_json
|
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, protobuf
|
|
|
|
, python3
|
|
|
|
, rapidjson
|
|
|
|
, re2
|
|
|
|
, snappy
|
2022-02-10 20:34:41 +00:00
|
|
|
, sqlite
|
2021-12-06 16:07:01 +00:00
|
|
|
, thrift
|
|
|
|
, tzdata
|
|
|
|
, utf8proc
|
|
|
|
, which
|
|
|
|
, zlib
|
|
|
|
, zstd
|
2021-01-05 17:05:55 +00:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2022-03-05 16:20:37 +00:00
|
|
|
, enableFlight ? true
|
2022-09-30 11:47:45 +00:00
|
|
|
, enableJemalloc ? !stdenv.isDarwin
|
2023-08-22 20:05:09 +00:00
|
|
|
, enableS3 ? true
|
|
|
|
, enableGcs ? !stdenv.isDarwin
|
2021-01-05 17:05:55 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
assert lib.asserts.assertMsg
|
|
|
|
((enableS3 && stdenv.isDarwin) -> (lib.versionOlder boost.version "1.69" || lib.versionAtLeast boost.version "1.70"))
|
|
|
|
"S3 on Darwin requires Boost != 1.69";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2020-09-25 04:45:31 +00:00
|
|
|
arrow-testing = fetchFromGitHub {
|
2023-02-16 17:41:37 +00:00
|
|
|
name = "arrow-testing";
|
2020-09-25 04:45:31 +00:00
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-testing";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "47f7b56b25683202c1fd957668e13f2abafc0f12";
|
|
|
|
hash = "sha256-ZDznR+yi0hm5O1s9as8zq5nh1QxJ8kXCRwbNQlzXpnI=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
parquet-testing = fetchFromGitHub {
|
2023-02-16 17:41:37 +00:00
|
|
|
name = "parquet-testing";
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "apache";
|
|
|
|
repo = "parquet-testing";
|
2023-05-24 13:37:59 +00:00
|
|
|
rev = "b2e7cc755159196e3a068c8594f7acbaecfdaaac";
|
|
|
|
hash = "sha256-IFvGTOkaRSNgZOj8DziRj88yH5JRF+wgSDZ5N0GNvjk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
aws-sdk-cpp-arrow = aws-sdk-cpp.override {
|
|
|
|
apis = [
|
|
|
|
"cognito-identity"
|
|
|
|
"config"
|
|
|
|
"identity-management"
|
|
|
|
"s3"
|
|
|
|
"sts"
|
|
|
|
"transfer"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "arrow-cpp";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "14.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-05-18 14:49:53 +00:00
|
|
|
url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-XHDq+xAR+dEkuvsyiv5U9izFuSgLcIDh49Zo94wOQH4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
sourceRoot = "apache-arrow-${version}/cpp";
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# versions are all taken from
|
2022-08-12 12:06:08 +00:00
|
|
|
# https://github.com/apache/arrow/blob/apache-arrow-${version}/cpp/thirdparty/versions.txt
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# jemalloc: arrow uses a custom prefix to prevent default allocator symbol
|
|
|
|
# collisions as well as custom build flags
|
2022-06-16 17:23:12 +00:00
|
|
|
${if enableJemalloc then "ARROW_JEMALLOC_URL" else null} = fetchurl {
|
2022-08-12 12:06:08 +00:00
|
|
|
url = "https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2";
|
|
|
|
hash = "sha256-LbgtHnEZ3z5xt2QCGbbf6EeJvAU3mDw7esT3GJrs/qo=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# mimalloc: arrow uses custom build flags for mimalloc
|
2021-12-06 16:07:01 +00:00
|
|
|
ARROW_MIMALLOC_URL = fetchFromGitHub {
|
|
|
|
owner = "microsoft";
|
|
|
|
repo = "mimalloc";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "v2.0.6";
|
|
|
|
hash = "sha256-u2ITXABBN/dwU+mCIbL3tN1f4c17aBuSdNTV+Adtohc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
ARROW_XSIMD_URL = fetchFromGitHub {
|
|
|
|
owner = "xtensor-stack";
|
|
|
|
repo = "xsimd";
|
2023-02-16 17:41:37 +00:00
|
|
|
rev = "9.0.1";
|
|
|
|
hash = "sha256-onALN6agtrHWigtFlCeefD9CiRZI4Y690XTzy2UDnrk=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ARROW_SUBSTRAIT_URL = fetchFromGitHub {
|
|
|
|
owner = "substrait-io";
|
|
|
|
repo = "substrait";
|
2024-01-02 11:29:13 +00:00
|
|
|
rev = "v0.27.0";
|
|
|
|
hash = "sha256-wptEAXembah04pzqAz6UHeUxp+jMf6Lh/IdyuIhy/a8=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-02-10 20:34:41 +00:00
|
|
|
ninja
|
2020-04-24 23:36:52 +00:00
|
|
|
autoconf # for vendored jemalloc
|
|
|
|
flatbuffers
|
|
|
|
] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
brotli
|
|
|
|
flatbuffers
|
|
|
|
gflags
|
|
|
|
glog
|
|
|
|
gtest
|
2022-05-18 14:49:53 +00:00
|
|
|
libbacktrace
|
2020-04-24 23:36:52 +00:00
|
|
|
lz4
|
2022-05-18 14:49:53 +00:00
|
|
|
nlohmann_json # alternative JSON parser to rapidjson
|
|
|
|
protobuf # substrait requires protobuf
|
2020-04-24 23:36:52 +00:00
|
|
|
rapidjson
|
2021-02-05 17:12:51 +00:00
|
|
|
re2
|
2020-04-24 23:36:52 +00:00
|
|
|
snappy
|
|
|
|
thrift
|
2020-09-25 04:45:31 +00:00
|
|
|
utf8proc
|
2020-04-24 23:36:52 +00:00
|
|
|
zlib
|
|
|
|
zstd
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals enableFlight [
|
|
|
|
grpc
|
|
|
|
openssl
|
|
|
|
protobuf
|
2023-02-16 17:41:37 +00:00
|
|
|
sqlite
|
2023-02-02 18:25:31 +00:00
|
|
|
] ++ lib.optionals enableS3 [ aws-sdk-cpp-arrow openssl ]
|
2021-12-06 16:07:01 +00:00
|
|
|
++ lib.optionals enableGcs [
|
|
|
|
crc32c
|
|
|
|
curl
|
2023-02-16 17:41:37 +00:00
|
|
|
google-cloud-cpp
|
|
|
|
grpc
|
2021-12-06 16:07:01 +00:00
|
|
|
nlohmann_json
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs build-support/
|
2021-12-06 16:07:01 +00:00
|
|
|
substituteInPlace "src/arrow/vendored/datetime/tz.cpp" \
|
|
|
|
--replace 'discover_tz_dir();' '"${tzdata}/share/zoneinfo";'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2023-08-22 20:05:09 +00:00
|
|
|
"-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}"
|
|
|
|
"-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_BUILD_TESTS=ON"
|
2022-05-18 14:49:53 +00:00
|
|
|
"-DARROW_BUILD_INTEGRATION=ON"
|
|
|
|
"-DARROW_BUILD_UTILITIES=ON"
|
|
|
|
"-DARROW_EXTRA_ERROR_CONTEXT=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_VERBOSE_THIRDPARTY_BUILD=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_DEPENDENCY_SOURCE=SYSTEM"
|
2022-08-12 12:06:08 +00:00
|
|
|
"-Dxsimd_SOURCE=AUTO"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}"
|
2021-05-03 20:48:10 +00:00
|
|
|
"-DARROW_COMPUTE=ON"
|
|
|
|
"-DARROW_CSV=ON"
|
|
|
|
"-DARROW_DATASET=ON"
|
2022-02-10 20:34:41 +00:00
|
|
|
"-DARROW_FILESYSTEM=ON"
|
|
|
|
"-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}"
|
2022-02-20 05:27:41 +00:00
|
|
|
"-DARROW_HDFS=ON"
|
2022-02-10 20:34:41 +00:00
|
|
|
"-DARROW_IPC=ON"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}"
|
2021-05-03 20:48:10 +00:00
|
|
|
"-DARROW_JSON=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_USE_GLOG=ON"
|
2022-05-18 14:49:53 +00:00
|
|
|
"-DARROW_WITH_BACKTRACE=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_WITH_BROTLI=ON"
|
|
|
|
"-DARROW_WITH_LZ4=ON"
|
2022-05-18 14:49:53 +00:00
|
|
|
"-DARROW_WITH_NLOHMANN_JSON=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_WITH_SNAPPY=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_WITH_UTF8PROC=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DARROW_WITH_ZLIB=ON"
|
|
|
|
"-DARROW_WITH_ZSTD=ON"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DARROW_MIMALLOC=ON"
|
2022-05-18 14:49:53 +00:00
|
|
|
"-DARROW_SUBSTRAIT=ON"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}"
|
2022-05-18 14:49:53 +00:00
|
|
|
"-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}"
|
2021-12-06 16:07:01 +00:00
|
|
|
"-DARROW_S3=${if enableS3 then "ON" else "OFF"}"
|
|
|
|
"-DARROW_GCS=${if enableGcs then "ON" else "OFF"}"
|
2023-02-16 17:41:37 +00:00
|
|
|
# Parquet options:
|
|
|
|
"-DARROW_PARQUET=ON"
|
|
|
|
"-DPARQUET_BUILD_EXECUTABLES=ON"
|
|
|
|
"-DPARQUET_REQUIRE_ENCRYPTION=ON"
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optionals (!enableShared) [
|
|
|
|
"-DARROW_TEST_LINKAGE=static"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
|
2023-02-16 17:41:37 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isx86_64) [ "-DARROW_USE_SIMD=OFF" ]
|
|
|
|
++ lib.optionals enableS3 [ "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp-arrow}/include/aws/core/Aws.h" ];
|
2021-05-03 20:48:10 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doInstallCheck = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
ARROW_TEST_DATA = lib.optionalString doInstallCheck "${arrow-testing}/data";
|
|
|
|
PARQUET_TEST_DATA = lib.optionalString doInstallCheck "${parquet-testing}/data";
|
2021-02-05 17:12:51 +00:00
|
|
|
GTEST_FILTER =
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
# Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398
|
|
|
|
filteredTests = lib.optionals stdenv.hostPlatform.isAarch64 [
|
|
|
|
"TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric"
|
|
|
|
"TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric"
|
|
|
|
"TestCompareKernel.PrimitiveRandomTests"
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals enableS3 [
|
|
|
|
"S3OptionsTest.FromUri"
|
|
|
|
"S3RegionResolutionTest.NonExistentBucket"
|
|
|
|
"S3RegionResolutionTest.PublicBucket"
|
|
|
|
"S3RegionResolutionTest.RestrictedBucket"
|
|
|
|
"TestMinioServer.Connect"
|
2022-01-07 04:07:37 +00:00
|
|
|
"TestS3FS.*"
|
2021-12-06 16:07:01 +00:00
|
|
|
"TestS3FSGeneric.*"
|
2023-03-04 12:14:45 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# TODO: revisit at 12.0.0 or when
|
|
|
|
# https://github.com/apache/arrow/commit/295c6644ca6b67c95a662410b2c7faea0920c989
|
|
|
|
# is available, see
|
|
|
|
# https://github.com/apache/arrow/pull/15288#discussion_r1071244661
|
|
|
|
"ExecPlanExecution.StressSourceSinkStopped"
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
2023-02-16 17:41:37 +00:00
|
|
|
lib.optionalString doInstallCheck "-${lib.concatStringsSep ":" filteredTests}";
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
nativeInstallCheckInputs = [ perl which sqlite ]
|
|
|
|
++ lib.optionals enableS3 [ minio ]
|
|
|
|
++ lib.optionals enableFlight [ python3 ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# requires networking
|
|
|
|
"arrow-gcsfs-test"
|
|
|
|
"arrow-flight-integration-test"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
ctest -L unittest --exclude-regex '^(${lib.concatStringsSep "|" disabledTests})$'
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-01 10:57:12 +00:00
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "A cross-language development platform for in-memory data";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://arrow.apache.org/docs/cpp/";
|
2021-06-01 10:57:12 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ tobim veprbl cpcloud ];
|
|
|
|
};
|
|
|
|
passthru = {
|
|
|
|
inherit enableFlight enableJemalloc enableS3 enableGcs;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|