2021-11-05 13:35:03 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fixDarwinDylibNames
|
2021-11-07 17:34:24 +00:00
|
|
|
, abseil-cpp
|
2021-11-05 13:35:03 +00:00
|
|
|
, autoconf
|
2021-11-04 13:05:51 +00:00
|
|
|
, aws-sdk-cpp
|
2021-11-05 13:35:03 +00:00
|
|
|
, boost
|
|
|
|
, brotli
|
|
|
|
, c-ares
|
|
|
|
, cmake
|
2021-11-07 17:34:24 +00:00
|
|
|
, crc32c
|
|
|
|
, curl
|
2021-11-05 13:35:03 +00:00
|
|
|
, flatbuffers
|
|
|
|
, gflags
|
|
|
|
, glog
|
2021-11-07 17:34:24 +00:00
|
|
|
, google-cloud-cpp
|
2021-11-05 13:35:03 +00:00
|
|
|
, grpc
|
|
|
|
, gtest
|
|
|
|
, jemalloc
|
2022-05-06 22:48:22 +00:00
|
|
|
, libbacktrace
|
2021-11-05 13:35:03 +00:00
|
|
|
, lz4
|
2021-11-04 13:05:51 +00:00
|
|
|
, minio
|
2022-02-04 20:18:59 +00:00
|
|
|
, ninja
|
2021-11-07 17:34:24 +00:00
|
|
|
, nlohmann_json
|
2021-11-05 13:35:03 +00:00
|
|
|
, openssl
|
|
|
|
, perl
|
|
|
|
, protobuf
|
|
|
|
, python3
|
|
|
|
, rapidjson
|
|
|
|
, re2
|
|
|
|
, snappy
|
2022-02-04 20:18:59 +00:00
|
|
|
, sqlite
|
2021-11-05 13:35:03 +00:00
|
|
|
, thrift
|
|
|
|
, tzdata
|
|
|
|
, utf8proc
|
|
|
|
, which
|
|
|
|
, zlib
|
|
|
|
, zstd
|
2020-12-20 06:11:26 +00:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2022-03-04 16:01:20 +00:00
|
|
|
, enableFlight ? true
|
2021-11-22 01:54:50 +00:00
|
|
|
, enableJemalloc ? !(stdenv.isAarch64 && stdenv.isDarwin)
|
2021-11-07 17:34:24 +00:00
|
|
|
# boost/process is broken in 1.69 on darwin, but fixed in 1.70 and
|
|
|
|
# non-existent in older versions
|
|
|
|
# see https://github.com/boostorg/process/issues/55
|
|
|
|
, enableS3 ? (!stdenv.isDarwin) || (lib.versionOlder boost.version "1.69" || lib.versionAtLeast boost.version "1.70")
|
|
|
|
, enableGcs ? !stdenv.isDarwin # google-cloud-cpp is not supported on darwin
|
2020-12-20 06:11:26 +00:00
|
|
|
}:
|
2018-10-13 08:12:26 +00:00
|
|
|
|
2021-11-07 17:34:24 +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";
|
|
|
|
|
2018-10-13 08:12:26 +00:00
|
|
|
let
|
2020-08-19 20:13:48 +00:00
|
|
|
arrow-testing = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "arrow-testing";
|
2022-02-04 20:18:59 +00:00
|
|
|
rev = "634739c664433cec366b4b9a81d1e1044a8c5eda";
|
|
|
|
hash = "sha256-r1WVgJJsI7v485L6Qb+5i7kFO4Tvxyk1T0JBb4og6pg=";
|
2020-08-19 20:13:48 +00:00
|
|
|
};
|
|
|
|
|
2018-10-13 08:12:26 +00:00
|
|
|
parquet-testing = fetchFromGitHub {
|
|
|
|
owner = "apache";
|
|
|
|
repo = "parquet-testing";
|
2022-02-04 20:18:59 +00:00
|
|
|
rev = "acd375eb86a81cd856476fca0f52ba6036a067ff";
|
|
|
|
hash = "sha256-z/kmi+4dBO/dsVkJA4NgUoxl0pXi8RWIGvI8MGu/gcc=";
|
2018-10-13 08:12:26 +00:00
|
|
|
};
|
2018-03-16 20:19:24 +00:00
|
|
|
|
2021-11-05 13:35:03 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "arrow-cpp";
|
2022-05-06 22:48:22 +00:00
|
|
|
version = "8.0.0";
|
2018-03-16 20:19:24 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-05-06 22:48:22 +00:00
|
|
|
url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
|
|
|
|
hash = "sha256-rZoFcFEXyYnBFrrprHBJL+AVBQ4bgPsOOP3ktdhjqqM=";
|
2018-03-16 20:19:24 +00:00
|
|
|
};
|
|
|
|
sourceRoot = "apache-arrow-${version}/cpp";
|
|
|
|
|
2021-11-22 01:54:50 +00:00
|
|
|
${if enableJemalloc then "ARROW_JEMALLOC_URL" else null} = jemalloc.src;
|
2021-10-31 22:59:57 +00:00
|
|
|
|
2022-05-06 22:48:22 +00:00
|
|
|
# versions are all taken from
|
|
|
|
# https://github.com/apache/arrow/blob/apache-arrow-8.0.0/cpp/thirdparty/versions.txt
|
|
|
|
|
2021-10-31 22:59:57 +00:00
|
|
|
ARROW_MIMALLOC_URL = fetchFromGitHub {
|
|
|
|
owner = "microsoft";
|
|
|
|
repo = "mimalloc";
|
2022-02-04 20:18:59 +00:00
|
|
|
rev = "v1.7.3";
|
|
|
|
hash = "sha256-Ca877VitpWyKmZNHavqgewk/P+tyd2xHDNVqveKh87M=";
|
2019-08-07 03:48:20 +00:00
|
|
|
};
|
|
|
|
|
2021-10-31 22:59:57 +00:00
|
|
|
ARROW_XSIMD_URL = fetchFromGitHub {
|
|
|
|
owner = "xtensor-stack";
|
|
|
|
repo = "xsimd";
|
2022-05-06 22:48:22 +00:00
|
|
|
rev = "7d1778c3b38d63db7cec7145d939f40bc5d859d1";
|
|
|
|
hash = "sha256-89AysBUVnTdWyMPazeJegnQ6WEH90Ns7qQInZLMSXY4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
ARROW_SUBSTRAIT_URL = fetchFromGitHub {
|
|
|
|
owner = "substrait-io";
|
|
|
|
repo = "substrait";
|
|
|
|
rev = "e1b4c04a1b518912f4c4065b16a1b2c0ac8e14cf";
|
|
|
|
hash = "sha256-56FSjDngsROSHLjMv+OYAIYqphEu3GzgIMHbgh/ZQw0=";
|
2020-08-19 20:13:48 +00:00
|
|
|
};
|
|
|
|
|
2018-10-13 08:12:26 +00:00
|
|
|
patches = [
|
|
|
|
# patch to fix python-test
|
|
|
|
./darwin.patch
|
2019-10-07 06:48:25 +00:00
|
|
|
];
|
2018-10-03 22:37:12 +00:00
|
|
|
|
2019-10-07 06:48:25 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-02-04 20:18:59 +00:00
|
|
|
ninja
|
2019-10-07 06:48:25 +00:00
|
|
|
autoconf # for vendored jemalloc
|
|
|
|
flatbuffers
|
2019-07-20 19:24:12 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2019-04-05 23:08:22 +00:00
|
|
|
buildInputs = [
|
2019-10-07 06:48:25 +00:00
|
|
|
boost
|
|
|
|
brotli
|
|
|
|
flatbuffers
|
|
|
|
gflags
|
|
|
|
glog
|
|
|
|
gtest
|
2022-05-06 22:48:22 +00:00
|
|
|
libbacktrace
|
2019-10-07 06:48:25 +00:00
|
|
|
lz4
|
2022-05-06 22:48:22 +00:00
|
|
|
nlohmann_json # alternative JSON parser to rapidjson
|
|
|
|
protobuf # substrait requires protobuf
|
2019-10-07 06:48:25 +00:00
|
|
|
rapidjson
|
2021-01-26 16:35:44 +00:00
|
|
|
re2
|
2019-10-07 06:48:25 +00:00
|
|
|
snappy
|
|
|
|
thrift
|
2020-08-19 20:13:48 +00:00
|
|
|
utf8proc
|
2019-10-07 06:48:25 +00:00
|
|
|
zlib
|
|
|
|
zstd
|
2020-05-12 00:34:33 +00:00
|
|
|
] ++ lib.optionals enableShared [
|
|
|
|
python3.pkgs.python
|
|
|
|
python3.pkgs.numpy
|
2021-11-05 13:35:03 +00:00
|
|
|
] ++ lib.optionals enableFlight [
|
|
|
|
grpc
|
|
|
|
openssl
|
|
|
|
protobuf
|
2021-11-07 17:34:24 +00:00
|
|
|
] ++ lib.optionals enableS3 [ aws-sdk-cpp openssl ]
|
|
|
|
++ lib.optionals enableGcs [
|
|
|
|
abseil-cpp
|
|
|
|
crc32c
|
|
|
|
curl
|
|
|
|
google-cloud-cpp
|
|
|
|
nlohmann_json
|
|
|
|
];
|
2018-03-16 20:19:24 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2018-10-13 08:12:26 +00:00
|
|
|
patchShebangs build-support/
|
2021-10-31 02:08:19 +00:00
|
|
|
substituteInPlace "src/arrow/vendored/datetime/tz.cpp" \
|
2021-11-21 20:07:37 +00:00
|
|
|
--replace 'discover_tz_dir();' '"${tzdata}/share/zoneinfo";'
|
2018-03-16 20:19:24 +00:00
|
|
|
'';
|
|
|
|
|
2018-03-19 00:13:16 +00:00
|
|
|
cmakeFlags = [
|
2020-02-11 10:57:42 +00:00
|
|
|
"-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON"
|
2020-08-19 20:13:48 +00:00
|
|
|
"-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}"
|
|
|
|
"-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}"
|
2019-01-21 02:14:30 +00:00
|
|
|
"-DARROW_BUILD_TESTS=ON"
|
2022-05-06 22:48:22 +00:00
|
|
|
"-DARROW_BUILD_INTEGRATION=ON"
|
|
|
|
"-DARROW_BUILD_UTILITIES=ON"
|
|
|
|
"-DARROW_EXTRA_ERROR_CONTEXT=ON"
|
2020-08-19 20:13:48 +00:00
|
|
|
"-DARROW_VERBOSE_THIRDPARTY_BUILD=ON"
|
2019-04-05 23:08:22 +00:00
|
|
|
"-DARROW_DEPENDENCY_SOURCE=SYSTEM"
|
2021-10-29 06:01:01 +00:00
|
|
|
"-DThrift_SOURCE=AUTO" # search for Thrift using pkg-config (ThriftConfig.cmake requires OpenSSL and libevent)
|
2020-08-19 20:13:48 +00:00
|
|
|
"-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}"
|
2021-04-27 07:51:50 +00:00
|
|
|
"-DARROW_COMPUTE=ON"
|
|
|
|
"-DARROW_CSV=ON"
|
|
|
|
"-DARROW_DATASET=ON"
|
2022-02-04 20:18:59 +00:00
|
|
|
"-DARROW_ENGINE=ON"
|
|
|
|
"-DARROW_FILESYSTEM=ON"
|
2022-02-05 14:02:52 +00:00
|
|
|
"-DARROW_FLIGHT_SQL=${if enableFlight then "ON" else "OFF"}"
|
2022-02-17 12:11:42 +00:00
|
|
|
"-DARROW_HDFS=ON"
|
2022-02-04 20:18:59 +00:00
|
|
|
"-DARROW_IPC=ON"
|
2021-11-22 01:54:50 +00:00
|
|
|
"-DARROW_JEMALLOC=${if enableJemalloc then "ON" else "OFF"}"
|
2021-04-27 07:51:50 +00:00
|
|
|
"-DARROW_JSON=ON"
|
2019-09-26 20:51:28 +00:00
|
|
|
"-DARROW_PLASMA=ON"
|
2019-12-16 12:22:20 +00:00
|
|
|
# Disable Python for static mode because openblas is currently broken there.
|
|
|
|
"-DARROW_PYTHON=${if enableShared then "ON" else "OFF"}"
|
2020-02-11 10:57:42 +00:00
|
|
|
"-DARROW_USE_GLOG=ON"
|
2022-05-06 22:48:22 +00:00
|
|
|
"-DARROW_WITH_BACKTRACE=ON"
|
2020-02-11 10:57:42 +00:00
|
|
|
"-DARROW_WITH_BROTLI=ON"
|
|
|
|
"-DARROW_WITH_LZ4=ON"
|
2022-05-06 22:48:22 +00:00
|
|
|
"-DARROW_WITH_NLOHMANN_JSON=ON"
|
2020-02-11 10:57:42 +00:00
|
|
|
"-DARROW_WITH_SNAPPY=ON"
|
2020-08-19 20:13:48 +00:00
|
|
|
"-DARROW_WITH_UTF8PROC=ON"
|
2020-02-11 10:57:42 +00:00
|
|
|
"-DARROW_WITH_ZLIB=ON"
|
|
|
|
"-DARROW_WITH_ZSTD=ON"
|
2020-08-19 20:13:48 +00:00
|
|
|
"-DARROW_MIMALLOC=ON"
|
2020-02-11 10:57:42 +00:00
|
|
|
# Parquet options:
|
|
|
|
"-DARROW_PARQUET=ON"
|
2022-05-06 22:48:22 +00:00
|
|
|
"-DARROW_SUBSTRAIT=ON"
|
2020-02-11 10:57:42 +00:00
|
|
|
"-DPARQUET_BUILD_EXECUTABLES=ON"
|
2021-11-05 13:35:03 +00:00
|
|
|
"-DARROW_FLIGHT=${if enableFlight then "ON" else "OFF"}"
|
2022-05-06 22:48:22 +00:00
|
|
|
"-DARROW_FLIGHT_TESTING=${if enableFlight then "ON" else "OFF"}"
|
2021-11-04 13:05:51 +00:00
|
|
|
"-DARROW_S3=${if enableS3 then "ON" else "OFF"}"
|
2021-11-07 17:34:24 +00:00
|
|
|
"-DARROW_GCS=${if enableGcs then "ON" else "OFF"}"
|
2019-07-20 19:24:12 +00:00
|
|
|
] ++ lib.optionals (!enableShared) [
|
2019-12-16 12:22:20 +00:00
|
|
|
"-DARROW_TEST_LINKAGE=static"
|
2020-02-27 17:50:23 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # needed for tests
|
|
|
|
"-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
|
2021-11-04 13:05:51 +00:00
|
|
|
] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF"
|
|
|
|
++ lib.optional enableS3 "-DAWSSDK_CORE_HEADER_FILE=${aws-sdk-cpp}/include/aws/core/Aws.h";
|
2018-03-19 00:13:16 +00:00
|
|
|
|
2018-10-13 08:12:26 +00:00
|
|
|
doInstallCheck = true;
|
2021-11-05 13:35:03 +00:00
|
|
|
ARROW_TEST_DATA = lib.optionalString doInstallCheck "${arrow-testing}/data";
|
|
|
|
PARQUET_TEST_DATA = lib.optionalString doInstallCheck "${parquet-testing}/data";
|
2021-01-26 16:35:44 +00:00
|
|
|
GTEST_FILTER =
|
2021-11-05 13:35:03 +00:00
|
|
|
let
|
2021-01-26 16:35:44 +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-11-04 13:05:51 +00:00
|
|
|
] ++ lib.optionals enableS3 [
|
2021-11-05 21:25:58 +00:00
|
|
|
"S3OptionsTest.FromUri"
|
|
|
|
"S3RegionResolutionTest.NonExistentBucket"
|
2021-11-04 13:05:51 +00:00
|
|
|
"S3RegionResolutionTest.PublicBucket"
|
|
|
|
"S3RegionResolutionTest.RestrictedBucket"
|
|
|
|
"TestMinioServer.Connect"
|
2022-01-05 04:20:16 +00:00
|
|
|
"TestS3FS.*"
|
2021-11-06 11:03:13 +00:00
|
|
|
"TestS3FSGeneric.*"
|
2021-01-26 16:35:44 +00:00
|
|
|
];
|
2021-11-05 13:35:03 +00:00
|
|
|
in
|
|
|
|
lib.optionalString doInstallCheck "-${builtins.concatStringsSep ":" filteredTests}";
|
2022-02-04 20:18:59 +00:00
|
|
|
installCheckInputs = [ perl which sqlite ] ++ lib.optional enableS3 minio;
|
2020-02-27 17:50:23 +00:00
|
|
|
installCheckPhase =
|
2021-11-05 13:35:03 +00:00
|
|
|
let
|
|
|
|
excludedTests = lib.optionals stdenv.isDarwin [
|
|
|
|
# Some plasma tests need to be patched to use a shorter AF_UNIX socket
|
|
|
|
# path on Darwin. See https://github.com/NixOS/nix/pull/1085
|
|
|
|
"plasma-external-store-tests"
|
|
|
|
"plasma-client-tests"
|
2022-02-04 20:18:59 +00:00
|
|
|
] ++ [ "arrow-gcsfs-test" ];
|
2021-11-05 13:35:03 +00:00
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
2021-11-07 17:34:24 +00:00
|
|
|
ctest -L unittest \
|
2021-11-05 13:35:03 +00:00
|
|
|
--exclude-regex '^(${builtins.concatStringsSep "|" excludedTests})$'
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2018-10-13 08:12:26 +00:00
|
|
|
|
2021-05-29 07:30:51 +00:00
|
|
|
meta = with lib; {
|
2021-10-31 02:08:19 +00:00
|
|
|
description = "A cross-language development platform for in-memory data";
|
2019-10-07 06:48:25 +00:00
|
|
|
homepage = "https://arrow.apache.org/";
|
2021-05-29 07:30:51 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
2021-10-31 02:08:19 +00:00
|
|
|
maintainers = with maintainers; [ tobim veprbl cpcloud ];
|
2018-03-16 20:19:24 +00:00
|
|
|
};
|
2021-11-28 14:30:24 +00:00
|
|
|
passthru = {
|
|
|
|
inherit enableFlight enableJemalloc enableS3 enableGcs;
|
|
|
|
};
|
2018-03-16 20:19:24 +00:00
|
|
|
}
|