Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyarrow #35589

Closed
wants to merge 4 commits into from
Closed

Pyarrow #35589

wants to merge 4 commits into from

Conversation

teh
Copy link
Contributor

@teh teh commented Feb 25, 2018

Motivation for this change

This is probably one for @FRidh. I've been meaning to package pyarrow for a while, but it turned out to be a bit fiddly, mainly because its reliance on static libraries.

This PR is a suggestion for how we could package pyarrow, though I understand that some changes might be a bit controversial (new static flags for snappy, thrift & lz4 e.g.).

I still need to run this through nox-review pr & test the plasma binary

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -1,16 +1,21 @@
{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake }:
{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, fetchpatch }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetchpatch isn't used

Author: Tom Hunger <tehunger@gmail.com>
Date: Sun Feb 25 22:26:38 2018 +0000

bla
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write something meaningful or leave it out.

nativeBuildInputs = [ pkgconfig ];
buildInputs = [
boost zlib libevent openssl python bison flex twisted
boost zlib libevent openssl python bison flex twisted cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake belongs into nativeBuildInputs

};
in buildPythonPackage rec {
# Loosely based on the instructions here: https://arrow.apache.org/docs/python/development.html
name = "${pname}-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no name

@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ cmake ];

cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" ] ++ (if withStatic then ["-DBUILD_SHARED_LIBS=OFF"] else []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if withStatic is a good name since if it's enabled, only static libraries seem to be built. However, I'm not sure what the effect is for other derivations using withStatic.

nativeBuildInputs = [ cmake ];
buildInputs = [
cython
setuptools_scm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably nativeBuildInputs

buildInputs = [
cython
setuptools_scm
pytest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkInputs

meta = with stdenv.lib; {
description = "Apache Arrow is a cross-language development platform for in-memory data.";
homepage = "https://arrow.apache.org/";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license?

checkPhase = ''
# test requires gzip which hasn't been enabled yet:
substituteInPlace pyarrow/tests/test_io.py --replace 'test_compress_decompress' '_test_disabled'
substituteInPlace pyarrow/tests/test_parquet.py --replace 'test_pandas_parquet_configuration_options' '_test_disabled'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prePatch

(pkgs.thrift.override { withStatic = true; })
];
};
in buildPythonPackage rec {
Copy link
Member

@dotlambda dotlambda Feb 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all the above code would be more readable if it was indented by 2 spaces and if a blank line was inserted between different packages.
On a side note, why are these not provided in all-packages.nix?

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any motivation for building static libraries.

mainly because its reliance on static libraries.

Where is that documented? Have you tried without?

@teh
Copy link
Contributor Author

teh commented Feb 26, 2018

Thanks for review @dotlambda - will address and comment here when done.

@FRidh It's not documented explicitly - it's in their build files [1]. It's probably possible to patch it out but I haven't managed to do so.

[1]
https://github.com/apache/arrow/blob/master/cpp/CMakeLists.txt#L530

https://github.com/apache/arrow/blob/master/cpp/cmake_modules/FindLz4.cmake

(when setting e.g

"-DLZ4_HOME=${pkgs.lz4.dev}"
"-DLZ4_SHARED_LIB=${pkgs.lz4}/lib/liblz4.so"

you get errors like -- Could NOT find LZ4 (missing: LZ4_STATIC_LIB))

@FRidh FRidh self-assigned this Feb 26, 2018
@FRidh
Copy link
Member

FRidh commented Feb 26, 2018

@teh have you raised an issue about this?

@veprbl
Copy link
Member

veprbl commented Mar 12, 2018

I've just learned that there is symlinkJoin. I think that it would be much help when building arrow-cpp.

@veprbl
Copy link
Member

veprbl commented Mar 16, 2018

#37196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants