Apache DataFusion SQL Query Engine
ARROW-4645: [C++/Packaging] Ship Gandiva with OSX and Windows wheels
Krisztián Szűcsbb43b8de5c51
diff --git a/dev/tasks/python-wheels/appveyor.yml b/dev/tasks/python-wheels/appveyor.ymlindex be6ad302e1..817325cf6e 100644--- a/dev/tasks/python-wheels/appveyor.yml+++ b/dev/tasks/python-wheels/appveyor.yml@@ -20,8 +20,8 @@ os: Visual Studio 2015environment:ARCH: "64"GENERATOR: Visual Studio 14 2015 Win64- NUMPY: "1.14.5"- PYTHON: "{{ python_version }}"+ NUMPY_VERSION: "1.14.5"+ PYTHON_VERSION: "{{ python_version }}"MSVC_DEFAULT_OPTIONS: ONARROW_SRC: C:\apache-arrowPYARROW_VERSION: {{ arrow.no_rc_version }}@@ -33,15 +33,17 @@ init:build_script:- mkdir wheels+ - git config core.symlinks true- git clone -b {{ arrow.branch }} {{ arrow.remote }} %ARROW_SRC% || exit /B- git -C %ARROW_SRC% checkout {{ arrow.head }} || exit /B- call %ARROW_SRC%\dev\tasks\python-wheels\win-build.batafter_build:- xcopy %ARROW_SRC%\python\dist\* wheels\+ # the artifacts must be uploaded from a directory relative to the build root+ - xcopy %ARROW_SRC%\python\dist\* wheels\artifacts:- - path: wheels\*.whl+ - path: 'wheels\*.whl'deploy:release: {{ task.tag }}diff --git a/dev/tasks/python-wheels/linux-test.sh b/dev/tasks/python-wheels/linux-test.shindex dcd77eb56f..4abe6f3dd9 100755--- a/dev/tasks/python-wheels/linux-test.sh+++ b/dev/tasks/python-wheels/linux-test.sh@@ -17,8 +17,10 @@# specific language governing permissions and limitations# under the License.+set -e+# Install built wheel-pip install /arrow/python/manylinux1/dist/*.whl+pip install -q /arrow/python/manylinux1/dist/*.whl# Runs tests on installed distribution from an empty directorypython --version@@ -30,12 +32,11 @@ import pyarrowimport pyarrow.orcimport pyarrow.parquetimport pyarrow.plasma-import tensorflowif sys.version_info.major > 2:import pyarrow.gandiva"# Run pyarrow tests-pip install -r /arrow/python/requirements-test.txt-pytest --pyargs pyarrow+pip install -q -r /arrow/python/requirements-test.txt+pytest -v --pyargs pyarrowdiff --git a/dev/tasks/python-wheels/osx-build.sh b/dev/tasks/python-wheels/osx-build.shindex 22c44c1573..9fef5b944a 100755--- a/dev/tasks/python-wheels/osx-build.sh+++ b/dev/tasks/python-wheels/osx-build.sh@@ -35,10 +35,10 @@ function build_wheel {pushd $1- boost_version="1.65.1"+ boost_version="1.66.0"boost_directory_name="boost_${boost_version//\./_}"boost_tarball_name="${boost_directory_name}.tar.gz"- wget --no-check-certificate \+ wget -nv --no-check-certificate \http://downloads.sourceforge.net/project/boost/boost/"${boost_version}"/"${boost_tarball_name}" \-O "${boost_tarball_name}"tar xf "${boost_tarball_name}"@@ -60,7 +60,7 @@ function build_wheel {./b2 tools/bcp > /dev/null 2>&1./dist/bin/bcp --namespace=arrow_boost --namespace-alias \filesystem date_time system regex build algorithm locale format \- "$arrow_boost" > /dev/null 2>&1+ multiprecision/cpp_int "$arrow_boost" > /dev/null 2>&1popd# Now build our custom namespaced Boost version.@@ -102,11 +102,21 @@ function build_wheel {pip install $(pip_opts) -r python/requirements-wheel.txt cython+ if [ ${MB_PYTHON_VERSION} != "2.7" ]; then+ # Gandiva is not supported on Python 2.7+ export PYARROW_WITH_GANDIVA=1+ export BUILD_ARROW_GANDIVA=ON+ else+ export PYARROW_WITH_GANDIVA=0+ export BUILD_ARROW_GANDIVA=OFF+ fi+pushd cppmkdir buildpushd buildcmake -DCMAKE_BUILD_TYPE=Release \-DCMAKE_INSTALL_PREFIX=$ARROW_HOME \+ -DARROW_VERBOSE_THIRDPARTY_BUILD=ON \-DARROW_BUILD_TESTS=OFF \-DARROW_BUILD_SHARED=ON \-DARROW_BOOST_USE_SHARED=ON \@@ -115,6 +125,7 @@ function build_wheel {-DARROW_RPATH_ORIGIN=ON \-DARROW_PYTHON=ON \-DARROW_PARQUET=ON \+ -DARROW_GANDIVA=${BUILD_ARROW_GANDIVA} \-DARROW_ORC=ON \-DBOOST_ROOT="$arrow_boost_dist" \-DBoost_NAMESPACE=arrow_boost \@@ -132,6 +143,7 @@ function build_wheel {unset ARROW_HOMEunset PARQUET_HOME+ export PYARROW_WITH_PLASMA=1export PYARROW_WITH_PARQUET=1export PYARROW_WITH_ORC=1export PYARROW_WITH_JEMALLOC=1@@ -139,13 +151,11 @@ function build_wheel {export PYARROW_BUNDLE_BOOST=1export PYARROW_BUNDLE_ARROW_CPP=1export PYARROW_BUILD_TYPE='release'+ export PYARROW_BOOST_NAMESPACE='arrow_boost'export PYARROW_CMAKE_OPTIONS="-DBOOST_ROOT=$arrow_boost_dist"export SETUPTOOLS_SCM_PRETEND_VERSION=$PYARROW_VERSIONpushd python- python setup.py build_ext \- --with-plasma --with-orc --with-parquet \- --bundle-arrow-cpp --bundle-boost --boost-namespace=arrow_boost \- bdist_wheel+ python setup.py build_ext bdist_wheells -l dist/popd@@ -168,10 +178,16 @@ function install_run {python --version# Test optional dependencies- python -c "import pyarrow"- python -c "import pyarrow.orc"- python -c "import pyarrow.parquet"- python -c "import pyarrow.plasma"+ python -c "+import sys+import pyarrow+import pyarrow.orc+import pyarrow.parquet+import pyarrow.plasma++if sys.version_info.major > 2:+ import pyarrow.gandiva+"# Run pyarrow testspip install $(pip_opts) -r python/requirements-test.txtdiff --git a/dev/tasks/python-wheels/travis.osx.yml b/dev/tasks/python-wheels/travis.osx.ymlindex a98841335e..67ded34344 100644--- a/dev/tasks/python-wheels/travis.osx.yml+++ b/dev/tasks/python-wheels/travis.osx.yml@@ -41,7 +41,7 @@ before_install:- brew uninstall boost cgal postgis sfcgal- brew update- brew upgrade cmake- - brew install bison flex+ - brew install bison flex llvm@7- export CONFIG_PATH=`pwd`/arrow/dev/tasks/python-wheels/osx-build.sh- source multibuild/common_utils.sh@@ -57,6 +57,9 @@ install:# the following functions are defined in osx-build.sh- build_wheel arrow++ # test the built wheels, remove llvm to ensure it links statically+ - brew uninstall llvm@7- install_run arrow# move built wheels to a top level directorydiff --git a/dev/tasks/python-wheels/win-build.bat b/dev/tasks/python-wheels/win-build.batindex 02cd57daeb..d39885580e 100644--- a/dev/tasks/python-wheels/win-build.bat+++ b/dev/tasks/python-wheels/win-build.bat@@ -17,31 +17,23 @@@echo on+@rem create conda environment for compilingconda update --yes --quiet conda-conda create -n arrow -q -y python=%PYTHON% ^- six pytest setuptools numpy=%NUMPY% pandas+conda create -n arrow -q -y python=%PYTHON_VERSION% ^+ six pytest setuptools numpy=%NUMPY_VERSION% pandasconda install -n arrow -q -y -c conda-forge ^git flatbuffers rapidjson ^cmake ^boost-cpp thrift-cpp ^- gflags snappy zlib brotli zstd lz4-c double-conversion+ gflags snappy zlib zstd lz4-c double-conversion ^+ llvmdev libprotobufcall activate arrow-pushd %ARROW_SRC%--@rem fix up symlinks-git config core.symlinks true-git reset --hard || exit /B-git checkout "%PYARROW_REF%" || exit /B--popd-set ARROW_HOME=%CONDA_PREFIX%\Libraryset PARQUET_HOME=%CONDA_PREFIX%\Library-echo %ARROW_HOME%@rem Build and test Arrow C++ libraries@@ -53,41 +45,44 @@ cmake -G "%GENERATOR%" ^-DARROW_BOOST_USE_SHARED=OFF ^-DARROW_BUILD_TESTS=OFF ^-DCMAKE_BUILD_TYPE=Release ^+ -DBrotli_SOURCE=BUNDLED ^+ -DRE2_SOURCE=BUNDLED ^-DARROW_CXXFLAGS="/MP" ^-DARROW_PYTHON=ON ^-DARROW_PARQUET=ON ^+ -DARROW_GANDIVA=ON ^.. || exit /Bcmake --build . --target INSTALL --config Release || exit /B--@rem Needed so python-test.exe works-set PYTHONPATH=%CONDA_PREFIX%\Lib;%CONDA_PREFIX%\Lib\site-packages;%CONDA_PREFIX%\python35.zip;%CONDA_PREFIX%\DLLs;%CONDA_PREFIX%-ctest -VV || exit /Bpopd-@rem Build and import pyarrow-set PYTHONPATH=-pushd %ARROW_SRC%\pythonset PYARROW_BUILD_TYPE=Release+@rem Gandiva is not supported on Python 2.7, but We don't build 2.7 wheel for windows+set PYARROW_WITH_GANDIVA=1+set PYARROW_WITH_PARQUET=1+set PYARROW_WITH_STATIC_BOOST=1+set PYARROW_BUNDLE_ARROW_CPP=1set SETUPTOOLS_SCM_PRETEND_VERSION=%PYARROW_VERSION%@rem Newer Cython versions are not available on conda-forgepip install -U pippip install "Cython>=0.29"-python setup.py build_ext ^- --with-parquet ^- --with-static-boost ^- --bundle-arrow-cpp ^- bdist_wheel || exit /B+python setup.py build_ext bdist_wheel || exit /Bpopd-@rem test the wheelcall deactivate-conda create -n wheel-test -q -y python=%PYTHON% ^- numpy=%NUMPY% pandas pytest hypothesis++@rem test the wheel+conda create -n wheel-test -q -y python=%PYTHON_VERSION% ^+ numpy=%NUMPY_VERSION% pandas pytest hypothesiscall activate wheel-test-pip install --no-index --find-links=%ARROW_SRC%\python\dist\ pyarrow-python -c "import pyarrow; import pyarrow.parquet"-pytest --pyargs pyarrow+@rem install the built wheel+pip install -vv --no-index --find-links=%ARROW_SRC%\python\dist\ pyarrow++@rem test the imports+python -c "import pyarrow; import pyarrow.parquet; import pyarrow.gandiva;" || exit /B++@rem run the python tests+pytest --pyargs pyarrow || exit /B