Skip to content

Apache DataFusion SQL Query Engine

ARROW-12139: [Python][Packaging] Use vcpkg to build macOS wheels

Krisztián Szűcs27231a3f31a4
diff --git a/.env b/.env
index 3c146239ef..cd6b57e004 100644
--- a/.env
+++ b/.env
@@ -69,5 +69,6 @@ R_TAG=latest
# -1 does not attempt to install a devtoolset version, any positive integer will install devtoolset-n
DEVTOOLSET_VERSION=-1
-# Used for the manylinux and windows wheels
+# Used for the manylinux and windows wheels, please update the crossbow configuration on update:
+# https://github.com/ursacomputing/crossbow/blob/master/.github/workflows/cache_vcpkg.yml
VCPKG=fced4bef1606260f110d74de1ae1975c2b9ac549
diff --git a/ci/scripts/python_wheel_macos_build.sh b/ci/scripts/python_wheel_macos_build.sh
new file mode 100755
index 0000000000..7a021f70f7
--- /dev/null
+++ b/ci/scripts/python_wheel_macos_build.sh
@@ -0,0 +1,133 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -ex
+
+source_dir=${1}
+build_dir=${2}
+
+echo "=== (${PYTHON_VERSION}) Clear output directories and leftovers ==="
+# Clear output directories and leftovers
+rm -rf ${build_dir}/install
+rm -rf ${source_dir}/python/dist
+rm -rf ${source_dir}/python/build
+rm -rf ${source_dir}/python/repaired_wheels
+rm -rf ${source_dir}/python/pyarrow/*.so
+rm -rf ${source_dir}/python/pyarrow/*.so.*
+
+echo "=== (${PYTHON_VERSION}) Set OSX SDK and C flags ==="
+# Arrow is 64-bit-only at the moment
+export CFLAGS="-fPIC -arch x86_64 ${CFLAGS//-arch i386/}"
+export CXXFLAGS="-fPIC -arch x86_64 ${CXXFLAGS//-arch i386} -std=c++11"
+export SDKROOT="$(xcrun --show-sdk-path)"
+
+echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries ==="
+: ${ARROW_DATASET:=ON}
+: ${ARROW_FLIGHT:=ON}
+: ${ARROW_GANDIVA:=OFF}
+: ${ARROW_HDFS:=ON}
+: ${ARROW_JEMALLOC:=ON}
+: ${ARROW_MIMALLOC:=ON}
+: ${ARROW_ORC:=ON}
+: ${ARROW_PARQUET:=ON}
+: ${ARROW_PLASMA:=ON}
+: ${ARROW_S3:=ON}
+: ${ARROW_TENSORFLOW:=ON}
+: ${ARROW_WITH_BROTLI:=ON}
+: ${ARROW_WITH_BZ2:=ON}
+: ${ARROW_WITH_LZ4:=ON}
+: ${ARROW_WITH_SNAPPY:=ON}
+: ${ARROW_WITH_ZLIB:=ON}
+: ${ARROW_WITH_ZSTD:=ON}
+: ${CMAKE_BUILD_TYPE:=release}
+: ${CMAKE_GENERATOR:=Ninja}
+: ${VCPKG_FEATURE_FLAGS:=-manifests}
+: ${VCPKG_TARGET_TRIPLET:=${VCPKG_DEFAULT_TRIPLET:-x64-osx-static-${CMAKE_BUILD_TYPE}}}
+
+mkdir -p ${build_dir}/build
+pushd ${build_dir}/build
+cmake \
+ -DARROW_BUILD_SHARED=ON \
+ -DARROW_BUILD_STATIC=OFF \
+ -DARROW_BUILD_TESTS=OFF \
+ -DARROW_DATASET=${ARROW_DATASET} \
+ -DARROW_DEPENDENCY_SOURCE="VCPKG" \
+ -DARROW_DEPENDENCY_USE_SHARED=OFF \
+ -DARROW_FLIGHT==${ARROW_FLIGHT} \
+ -DARROW_GANDIVA=${ARROW_GANDIVA} \
+ -DARROW_HDFS=${ARROW_HDFS} \
+ -DARROW_JEMALLOC=${ARROW_JEMALLOC} \
+ -DARROW_MIMALLOC=${ARROW_MIMALLOC} \
+ -DARROW_ORC=${ARROW_ORC} \
+ -DARROW_PACKAGE_KIND="manylinux${MANYLINUX_VERSION}" \
+ -DARROW_PARQUET=${ARROW_PARQUET} \
+ -DARROW_PLASMA=${ARROW_PLASMA} \
+ -DARROW_PYTHON=ON \
+ -DARROW_RPATH_ORIGIN=ON \
+ -DARROW_S3=${ARROW_S3} \
+ -DARROW_TENSORFLOW=${ARROW_TENSORFLOW} \
+ -DARROW_USE_CCACHE=ON \
+ -DARROW_WITH_BROTLI=${ARROW_WITH_BROTLI} \
+ -DARROW_WITH_BZ2=${ARROW_WITH_BZ2} \
+ -DARROW_WITH_LZ4=${ARROW_WITH_LZ4} \
+ -DARROW_WITH_SNAPPY=${ARROW_WITH_SNAPPY} \
+ -DARROW_WITH_ZLIB=${ARROW_WITH_ZLIB} \
+ -DARROW_WITH_ZSTD=${ARROW_WITH_ZSTD} \
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DCMAKE_INSTALL_PREFIX=${build_dir}/install \
+ -DCMAKE_UNITY_BUILD=ON \
+ -DOPENSSL_USE_STATIC_LIBS=ON \
+ -DVCPKG_MANIFEST_MODE=OFF \
+ -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \
+ -G ${CMAKE_GENERATOR} \
+ ${source_dir}/cpp
+cmake --build . --target install
+popd
+
+# Check that we don't expose any unwanted symbols
+# check_arrow_visibility
+
+echo "=== (${PYTHON_VERSION}) Building wheel ==="
+export PYARROW_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+export PYARROW_BUNDLE_ARROW_CPP=1
+export PYARROW_CMAKE_GENERATOR=${CMAKE_GENERATOR}
+export PYARROW_INSTALL_TESTS=1
+export PYARROW_WITH_DATASET=${ARROW_DATASET}
+export PYARROW_WITH_FLIGHT=${ARROW_FLIGHT}
+export PYARROW_WITH_GANDIVA=${ARROW_GANDIVA}
+export PYARROW_WITH_HDFS=${ARROW_HDFS}
+export PYARROW_WITH_ORC=${ARROW_ORC}
+export PYARROW_WITH_PARQUET=${ARROW_PARQUET}
+export PYARROW_WITH_PLASMA=${ARROW_PLASMA}
+export PYARROW_WITH_S3=${ARROW_S3}
+# PyArrow build configuration
+export PKG_CONFIG_PATH=/usr/lib/pkgconfig:${build_dir}/install/lib/pkgconfig
+
+pushd ${source_dir}/python
+python setup.py bdist_wheel
+popd
+
+echo "=== (${PYTHON_VERSION}) Show dynamic libraries the wheel depend on ==="
+deps=$(delocate-listdeps ${source_dir}/python/dist/*.whl)
+
+if echo $deps | grep -v "^@rpath/lib\(arrow\|gandiva\|parquet\|plasma\)"; then
+ echo "There are non-bundled shared library dependencies."
+ exit 1
+fi
diff --git a/ci/scripts/python_wheel_macos_test.sh b/ci/scripts/python_wheel_macos_test.sh
new file mode 100755
index 0000000000..6ac8576d48
--- /dev/null
+++ b/ci/scripts/python_wheel_macos_test.sh
@@ -0,0 +1,66 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -ex
+
+source_dir=${1}
+
+: ${ARROW_S3:=ON}
+
+export PYARROW_TEST_CYTHON=OFF
+export PYARROW_TEST_DATASET=ON
+export PYARROW_TEST_GANDIVA=OFF
+export PYARROW_TEST_HDFS=ON
+export PYARROW_TEST_ORC=ON
+export PYARROW_TEST_PANDAS=ON
+export PYARROW_TEST_PARQUET=ON
+export PYARROW_TEST_PLASMA=ON
+export PYARROW_TEST_S3=${ARROW_S3}
+export PYARROW_TEST_TENSORFLOW=ON
+export PYARROW_TEST_FLIGHT=ON
+
+export ARROW_TEST_DATA=${source_dir}/testing/data
+export PARQUET_TEST_DATA=${source_dir}/submodules/parquet-testing/data
+
+# Install the built wheels
+pip install ${source_dir}/python/dist/*.whl
+
+# Test that the modules are importable
+python -c "
+import pyarrow
+import pyarrow._hdfs
+import pyarrow.csv
+import pyarrow.dataset
+import pyarrow.flight
+import pyarrow.fs
+import pyarrow.json
+import pyarrow.orc
+import pyarrow.parquet
+import pyarrow.plasma
+"
+
+if [ "${PYARROW_TEST_S3}" == "ON" ]; then
+ python -c "import pyarrow._s3fs"
+fi
+
+# Install testing dependencies
+pip install -r ${source_dir}/python/requirements-wheel-test.txt
+
+# Execute unittest
+pytest -r s --pyargs pyarrow
diff --git a/ci/vcpkg/x64-osx-static-debug.cmake b/ci/vcpkg/x64-osx-static-debug.cmake
new file mode 100644
index 0000000000..e8a321ec71
--- /dev/null
+++ b/ci/vcpkg/x64-osx-static-debug.cmake
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set(VCPKG_TARGET_ARCHITECTURE x64)
+set(VCPKG_CRT_LINKAGE dynamic)
+set(VCPKG_LIBRARY_LINKAGE static)
+
+set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
+set(VCPKG_OSX_ARCHITECTURES x86_64)
+
+set(VCPKG_BUILD_TYPE debug)
diff --git a/ci/vcpkg/x64-osx-static-release.cmake b/ci/vcpkg/x64-osx-static-release.cmake
new file mode 100644
index 0000000000..956d5b92e7
--- /dev/null
+++ b/ci/vcpkg/x64-osx-static-release.cmake
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set(VCPKG_TARGET_ARCHITECTURE x64)
+set(VCPKG_CRT_LINKAGE dynamic)
+set(VCPKG_LIBRARY_LINKAGE static)
+
+set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
+set(VCPKG_OSX_ARCHITECTURES x86_64)
+
+set(VCPKG_BUILD_TYPE release)
diff --git a/dev/tasks/crossbow.py b/dev/tasks/crossbow.py
index 60c0c5991d..030864ab6a 100755
--- a/dev/tasks/crossbow.py
+++ b/dev/tasks/crossbow.py
@@ -322,7 +322,11 @@ class Repo:
def create_commit(self, files, parents=None, message='',
reference_name=None):
- parents = parents or []
+ if parents is None:
+ # by default use the main branch as the base of the new branch
+ # required to reuse github actions cache across crossbow tasks
+ commit, _ = self.repo.resolve_refish("master")
+ parents = [commit.id]
tree_id = self.create_tree(files)
author = committer = self.signature
@@ -563,8 +567,8 @@ class Queue(Repo):
if job.target.remote is None:
raise RuntimeError(
'Cannot determine git remote for the Arrow repository to '
- 'clone or push to, try to push the branch first to have a '
- 'remote tracking counterpart.'
+ 'clone or push to, try to push the `{}` branch first to have '
+ 'a remote tracking counterpart.'.format(job.target.branch)
)
if job.target.branch is None:
raise RuntimeError(
diff --git a/dev/tasks/python-wheels/github.osx.yml b/dev/tasks/python-wheels/github.osx.yml
index f0edeb32a9..1df94e4c70 100644
--- a/dev/tasks/python-wheels/github.osx.yml
+++ b/dev/tasks/python-wheels/github.osx.yml
@@ -23,6 +23,18 @@ on:
branches:
- "*-github-*"
+env:
+ ARROW_S3: {{ arrow_s3 }}
+ MACOSX_DEPLOYMENT_TARGET: {{ macos_deployment_target }}
+ MB_PYTHON_VERSION: {{ python_version }}
+ PLAT: x86_64
+ PYARROW_BUILD_VERBOSE: 1
+ PYARROW_VERSION: {{ arrow.no_rc_version }}
+ PYTHON_VERSION: {{ python_version }}
+ VCPKG_DEFAULT_TRIPLET: x64-osx-static-release
+ VCPKG_FEATURE_FLAGS: "-manifests"
+ VCPKG_OVERLAY_TRIPLETS: {{ "${{ github.workspace }}/arrow/ci/vcpkg" }}
+
jobs:
build:
name: Build wheel for OS X
@@ -31,88 +43,108 @@ jobs:
- name: Checkout Arrow
run: |
set -ex
-
git clone --no-checkout {{ arrow.remote }} arrow
git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
git -C arrow checkout FETCH_HEAD
git -C arrow submodule update --init --recursive
- - name: Build wheel
+ - name: Install System Dependencies
+ run: brew install bison ninja
+
+ # Restore from cache the previously built ports.
+ # If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
+ - name: Restore from Cache and Install Vcpkg
+ # Download and build vcpkg, without installing any port.
+ # If content is cached already, it is a no-op.
+ uses: kszucs/run-vcpkg@main
+ with:
+ # Required to prevent cache eviction on crossbow's main branch
+ # where we build pre-build the vcpkg packages
+ setupOnly: true
+ doNotSaveCache: true
+ appendedCacheKey: "-macos-{{ macos_deployment_target }}"
+ vcpkgDirectory: {{ "${{ github.workspace }}/vcpkg" }}
+ vcpkgGitCommitId: fced4bef1606260f110d74de1ae1975c2b9ac549
+
+ - name: Patch Vcpkg Ports
run: |
- set -ex
-
- git clone https://github.com/matthew-brett/multibuild
- git -C multibuild checkout 8882150df6529658700b66bec124dfb77eefca26
-
- # source utilities required for wheel builds
- export CONFIG_PATH=`pwd`/arrow/dev/tasks/python-wheels/osx-build.sh
- source multibuild/common_utils.sh
- source multibuild/travis_osx_steps.sh
-
- # provided by travis_osx_steps
- before_install
-
- brew install \
- automake \
- bison \
- boost \
- ccache \
- cmake \
+ vcpkg_patch_file="../arrow/ci/vcpkg/ports.patch"
+ cd $VCPKG_ROOT
+ if ! git apply --reverse --check --ignore-whitespace ${vcpkg_patch_file}; then
+ git apply --ignore-whitespace ${vcpkg_patch_file}
+ echo "Patch successfully applied!"
+ fi
+
+ # Now that vcpkg is installed, it is being used to run with the desired arguments.
+ - name: Install Vcpkg Dependencies
+ run: |
+ $VCPKG_ROOT/vcpkg install \
+ abseil \
+ boost-filesystem \
+ brotli \
+ bzip2 \
+ c-ares \
+ curl \
flatbuffers \
- flex \
- git \
- openblas \
+ gflags \
+ glog \
+ grpc \
+ lz4 \
+ openssl \
+ orc \
protobuf \
+ rapidjson \
+ re2 \
+ snappy \
thrift \
- wget
-
- # overridden by osx-build.sh
- build_wheel arrow
+ utf8proc \
+ zlib \
+ zstd
- # test the built wheels, move Homebrew directory to ensure things
- # are properly statically-linked
- CELLAR=$(brew --cellar)
- sudo mv $CELLAR{,.bak}
+ {% if arrow_s3 == "ON" %}
+ - name: Install AWS SDK C++
+ run: |
+ $VCPKG_ROOT/vcpkg install \
+ aws-sdk-cpp[config,cognito-identity,core,identity-management,s3,sts,transfer]
+ {% endif %}
- # make a new Cellar, allowing numpy to dynamically link to openblas
- sudo mkdir $CELLAR
- sudo ln -s ../Cellar.bak/openblas $CELLAR/openblas
- # and brew's openblas will need gcc
- sudo ln -s ../Cellar.bak/gcc $CELLAR/gcc
+ - name: Setup Multibuild
+ run: |
+ git clone https://github.com/matthew-brett/multibuild
+ git -C multibuild checkout 03950c9a7feb09d215f82d6563c4ffd91274a1e1
- # install the built wheel and test dependencies (osx-build.sh)
- install_wheel arrow
+ - name: Build Wheel
+ env:
+ CONFIG_PATH: /dev/null
+ run: |
+ # configure environment and install python
+ source multibuild/common_utils.sh
+ source multibuild/travis_osx_steps.sh
+ before_install
- # run unit tests before removing the system libraries (osx-build.sh)
- ulimit -S -n 4096 && run_unit_tests arrow
+ # install python dependencies
+ pip install -r arrow/python/requirements-wheel-build.txt delocate
- # run the import tests (osx-build.sh)
- run_import_tests
+ # build the wheel
+ arrow/ci/scripts/python_wheel_macos_build.sh $(pwd)/arrow $(pwd)/build
- # restore the original Cellar
- sudo rm $CELLAR/{gcc,openblas}
- sudo rmdir $CELLAR
- sudo mv $CELLAR{.bak,}
- env:
- # pyarrow config
- ARROW_S3: {{ arrow_s3 }}
- MACOSX_DEPLOYMENT_TARGET: {{ macos_deployment_target }}
- PYARROW_BUILD_VERBOSE: 1
- PYARROW_VERSION: {{ arrow.no_rc_version }}
+ - name: Setup Python for Testing
+ uses: actions/setup-python@v2
+ with:
+ python-version: "{{ python_version }}"
- # multibuild config
- MB_PYTHON_VERSION: {{ python_version }}
- PLAT: x86_64
+ - name: Test the Wheel
+ run: |
+ # TODO(kszucs): temporarily remove homebrew libs
+ unset MACOSX_DEPLOYMENT_TARGET
+ arrow/ci/scripts/python_wheel_macos_test.sh $(pwd)/arrow
- name: Setup Crossbow
- run: |
- pip3 install --requirement arrow/dev/tasks/requirements-crossbow.txt
+ run: pip install --requirement arrow/dev/tasks/requirements-crossbow.txt
- name: Upload artifacts
run: |
- python3 arrow/dev/tasks/crossbow.py \
+ python arrow/dev/tasks/crossbow.py \
--queue-path $(pwd) \
--queue-remote {{ queue_remote_url }} \
upload-artifacts \
diff --git a/dev/tasks/python-wheels/osx-build.sh b/dev/tasks/python-wheels/osx-build.sh
deleted file mode 100755
index 176b8b3ce5..0000000000
--- a/dev/tasks/python-wheels/osx-build.sh
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/bin/bash
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-set -e
-
-# overrides multibuild's default build_wheel
-function build_wheel {
- pip install -U pip
-
- # ARROW-5670: Python 3.5 can fail with HTTPS error in CMake build
- pip install setuptools_scm requests
-
- # Include brew installed versions of flex and bison.
- # We need them to build Thrift. The ones that come with Xcode are too old.
- export PATH="$(brew --prefix flex)/bin:$(brew --prefix bison)/bin:$PATH"
-
- echo `pwd`
- echo CFLAGS=${CFLAGS}
- echo CXXFLAGS=${CXXFLAGS}
- echo LDFLAGS=${LDFLAGS}
-
- pushd $1
-
- # For bzip_ep to find the osx SDK headers
- export SDKROOT="$(xcrun --show-sdk-path)"
-
- # Arrow is 64-bit-only at the moment
- export CFLAGS="-fPIC -arch x86_64 ${CFLAGS//"-arch i386"/}"
- export CXXFLAGS="-fPIC -arch x86_64 ${CXXFLAGS//"-arch i386"} -std=c++11"
-
- # We pin NumPy to an old version here as the NumPy version one builds
- # with is the oldest supported one. Thanks to NumPy's guarantees our Arrow
- # build will also work with newer NumPy versions.
- export ARROW_HOME=`pwd`/arrow-dist
- export PARQUET_HOME=`pwd`/arrow-dist
-
- # If NumPy builds from the source make sure it is built against OpenBLAS
- # See: https://github.com/numpy/numpy/issues/15947#issuecomment-686159427
- OPENBLAS=$(brew --prefix openblas) pip install \
- $(pip_opts) -r python/requirements-wheel-build.txt
-
- git submodule update --init
- export ARROW_TEST_DATA=`pwd`/testing/data
-
- pushd cpp
- mkdir build
- pushd build
- cmake -DARROW_BUILD_SHARED=ON \
- -DARROW_BUILD_STATIC=OFF \
- -DARROW_BUILD_TESTS=OFF \
- -DARROW_DATASET=ON \
- -DARROW_DEPENDENCY_SOURCE=BUNDLED \
- -DARROW_FLIGHT=ON \
- -DARROW_GANDIVA=OFF \
- -DARROW_GRPC_USE_SHARED=OFF \
- -DARROW_HDFS=ON \
- -DARROW_JEMALLOC=ON \
- -DARROW_MIMALLOC=ON \
- -DARROW_OPENSSL_USE_SHARED=OFF \
- -DARROW_ORC=OFF \
- -DARROW_PARQUET=ON \
- -DARROW_PLASMA=ON \
- -DARROW_PROTOBUF_USE_SHARED=OFF \
- -DARROW_PYTHON=ON \
- -DARROW_RPATH_ORIGIN=ON \
- -DARROW_S3=${ARROW_S3} \
- -DARROW_VERBOSE_THIRDPARTY_BUILD=ON \
- -DARROW_WITH_BROTLI=ON \
- -DARROW_WITH_BZ2=ON \
- -DARROW_WITH_LZ4=ON \
- -DARROW_WITH_SNAPPY=ON \
- -DARROW_WITH_ZLIB=ON \
- -DARROW_WITH_ZSTD=ON \
- -DBOOST_SOURCE=SYSTEM \
- -DCMAKE_BUILD_TYPE=Release \
- -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
- -DMAKE=make \
- -DProtobuf_SOURCE=SYSTEM \
- ..
- make -j$(sysctl -n hw.logicalcpu)
- make install
- popd
- popd
-
- # Unset the HOME variables and use pkg-config to discover the previously
- # built binaries. By using pkg-config, we also are able to discover the
- # ABI and SO versions of the dynamic libraries.
- export PKG_CONFIG_PATH=${ARROW_HOME}/lib/pkgconfig:${PARQUET_HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}
- unset ARROW_HOME
- unset PARQUET_HOME
-
- export PYARROW_BUILD_TYPE='release'
- export PYARROW_BUNDLE_ARROW_CPP=1
- export PYARROW_INSTALL_TESTS=1
- export PYARROW_WITH_DATASET=1
- export PYARROW_WITH_FLIGHT=1
- export PYARROW_WITH_GANDIVA=0
- export PYARROW_WITH_HDFS=1
- export PYARROW_WITH_JEMALLOC=1
- export PYARROW_WITH_ORC=0
- export PYARROW_WITH_PARQUET=1
- export PYARROW_WITH_PLASMA=1
- export PYARROW_WITH_PLASMA=1
- export PYARROW_WITH_S3=${ARROW_S3}
- export SETUPTOOLS_SCM_PRETEND_VERSION=$PYARROW_VERSION
- pushd python
- python setup.py build_ext bdist_wheel
- ls -l dist/
- popd
-
- popd
-}
-
-function install_wheel {
- multibuild_dir=`realpath $MULTIBUILD_DIR`
-
- pushd $1 # enter arrow's directory
- wheelhouse="$PWD/python/dist"
-
- # Install wheel
- pip install $(pip_opts) $wheelhouse/*.whl
-
- popd
-}
-
-function run_unit_tests {
- pushd $1
-
- export PYARROW_TEST_CYTHON=OFF
-
- # Install test dependencies
- pip install $(pip_opts) -r python/requirements-wheel-test.txt
-
- # Run pyarrow tests
- pytest -rs --pyargs pyarrow
-
- popd
-}
-
-function run_import_tests {
- # Test optional dependencies
- python -c "
-import pyarrow
-import pyarrow.parquet
-import pyarrow.plasma
-import pyarrow.fs
-import pyarrow._hdfs
-import pyarrow.dataset
-import pyarrow.flight
-"
- if [ "$ARROW_S3" = "ON" ]; then
- python -c "import pyarrow._s3fs"
- fi
-}