Apache DataFusion SQL Query Engine
ARROW-5886: [Python][Packaging] Manylinux1/2010 compliance issue with libz
Krisztián Szűcs8c6a689f80a0
diff --git a/dev/tasks/python-wheels/manylinux-test.sh b/dev/tasks/python-wheels/manylinux-test.shindex f5056fb84a..8ed2efef5d 100755--- a/dev/tasks/python-wheels/manylinux-test.sh+++ b/dev/tasks/python-wheels/manylinux-test.sh@@ -19,13 +19,23 @@set -e+export ARROW_TEST_DATA=/arrow/testing/data++python --version# Install built wheelpip install -q /arrow/python/$WHEEL_TAG/dist/*.whl+# Install test dependencies (pip won't work after removing system zlib)+pip install -q -r /arrow/python/requirements-test.txt+# Run pyarrow tests+pytest -v --pyargs pyarrow-# Runs tests on installed distribution from an empty directory-python --version+if [[ "$1" == "--remove-system-libs" ]]; then+ # Run import tests after removing the bundled dependencies from the system+ echo "Removing the following libraries to fail loudly if they are bundled incorrectly:"+ ldconfig -p | grep "lib\(lz4\|z\|boost\)" | awk -F'> ' '{print $2}' | xargs rm -v -f+fi-# Test optional dependencies+# Test import and optional dependenciespython -c "import sysimport pyarrow@@ -37,9 +47,3 @@ if sys.version_info.major > 2:import pyarrow.flightimport pyarrow.gandiva"--export ARROW_TEST_DATA=/arrow/testing/data--# Run pyarrow tests-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 517a63a7c5..415f08d0ca 100755--- a/dev/tasks/python-wheels/osx-build.sh+++ b/dev/tasks/python-wheels/osx-build.sh@@ -173,21 +173,27 @@ function build_wheel {popd}-# overrides multibuild's default install_run-function install_run {+function install_wheel {multibuild_dir=`realpath $MULTIBUILD_DIR`pushd $1 # enter arrow's directory-wheelhouse="$PWD/python/dist"# Install compatible wheelpip install $(pip_opts) \$(python $multibuild_dir/supported_wheels.py $wheelhouse/*.whl)- # Runs tests on installed distribution from an empty directory- python --version+ # Install test dependencies+ pip install $(pip_opts) -r python/requirements-test.txt+ popd+}++function run_unit_tests {+ # Run pyarrow tests+ py.test --pyargs pyarrow+}+function run_import_tests {# Test optional dependenciespython -c "import sys@@ -200,11 +206,4 @@ if sys.version_info.major > 2:import pyarrow.flightimport pyarrow.gandiva"-- # Run pyarrow tests- pip install $(pip_opts) -r python/requirements-test.txt-- py.test --pyargs pyarrow-- popd}diff --git a/dev/tasks/python-wheels/travis.manylinux.yml b/dev/tasks/python-wheels/travis.linux.ymlsimilarity index 79%rename from dev/tasks/python-wheels/travis.manylinux.ymlrename to dev/tasks/python-wheels/travis.linux.ymlindex e3670e4319..858d24ec8d 100644--- a/dev/tasks/python-wheels/travis.manylinux.yml+++ b/dev/tasks/python-wheels/travis.linux.yml@@ -58,16 +58,24 @@ script:-e PYTHON_VERSION="{{ python_version }}"-e UNICODE_WIDTH="{{ unicode_width }}"$BUILD_IMAGE- - popd++ # run auditwheel, it does always exit with 0 so it is mostly for debugging+ # purposes+ - docker run -v `pwd`:/arrow quay.io/pypa/manylinux1_x86_64 /bin/bash -c+ "auditwheel show /arrow/python/{{ wheel_tag }}/dist/*.whl"# test on multiple distributions{%- for image in test_docker_images %}- - docker run -it --shm-size 2G --volume $(pwd)/arrow:/arrow- --env WHEEL_TAG="{{ wheel_tag }}"- {{ image }}- /arrow/dev/tasks/python-wheels/manylinux-test.sh+ - docker run -it --shm-size 2G -v `pwd`:/arrow -e WHEEL_TAG="{{ wheel_tag }}"+ {%- if test_remove_system_libs %}+ {{ image }} /arrow/dev/tasks/python-wheels/manylinux-test.sh --remove-system-libs+ {%- else %}+ {{ image }} /arrow/dev/tasks/python-wheels/manylinux-test.sh+ {%- endif %}{%- endfor %}+ - popd+# prepare for deployment- sudo mv arrow/python/{{ wheel_tag }}/dist/* dist/diff --git a/dev/tasks/python-wheels/travis.osx.yml b/dev/tasks/python-wheels/travis.osx.ymlindex 8bea257205..6c6b177ee3 100644--- a/dev/tasks/python-wheels/travis.osx.yml+++ b/dev/tasks/python-wheels/travis.osx.yml@@ -47,7 +47,7 @@ before_install:- brew uninstall boost cgal postgis sfcgal- brew update- brew upgrade cmake- - brew install bison flex grpc openssl llvm@7+ - brew install bison flex grpc openssl llvm@7 zlib# Remove shared grpc libraries installed by brew to make sure# we are linked against the static ones.- rm -f /usr/local/opt/grpc/lib/*.dylib@@ -68,8 +68,15 @@ install:# test the built wheels, remove llvm and grpc dependencies to ensure# things are properly statically-linked- - brew uninstall --ignore-dependencies llvm@7 grpc c-ares openssl- - install_run arrow+ - brew uninstall --ignore-dependencies llvm@7 grpc c-ares openssl zlib+ # install the built wheel and test dependencies+ - install_wheel arrow+ # run unit tests before removing the system libraries+ - run_unit_tests+ # remove libz to ensure that it is properly bundled+ - sudo find /usr -name libz.* -delete+ # run the import tests+ - run_import_tests# move built wheels to a top level directory- mv -v arrow/python/dist/* dist/diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.ymlindex 75036652bc..370560bf99 100644--- a/dev/tasks/tasks.yml+++ b/dev/tasks/tasks.yml@@ -161,128 +161,138 @@ tasks:wheel-manylinux1-cp27m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 2.7unicode_width: 16wheel_tag: manylinux1test_docker_images: []+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp27-cp27m-manylinux1_x86_64.whlwheel-manylinux1-cp27mu:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 2.7unicode_width: 32wheel_tag: manylinux1test_docker_images:- python:2.7-slim # debian ucs4+ test_remove_system_libs: falseartifacts:- pyarrow-{no_rc_version}-cp27-cp27mu-manylinux1_x86_64.whlwheel-manylinux1-cp35m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 3.5unicode_width: 16wheel_tag: manylinux1test_docker_images:- python:3.5-slim+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp35-cp35m-manylinux1_x86_64.whlwheel-manylinux1-cp36m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 3.6unicode_width: 16wheel_tag: manylinux1test_docker_images:- python:3.6-slim+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp36-cp36m-manylinux1_x86_64.whlwheel-manylinux1-cp37m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 3.7unicode_width: 16wheel_tag: manylinux1test_docker_images:- python:3.7-slim+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp37-cp37m-manylinux1_x86_64.whlwheel-manylinux2010-cp27m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 2.7unicode_width: 16wheel_tag: manylinux2010test_docker_images: []+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp27-cp27m-manylinux2010_x86_64.whlwheel-manylinux2010-cp27mu:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 2.7unicode_width: 32wheel_tag: manylinux2010test_docker_images:- python:2.7-slim # debian ucs4+ test_remove_system_libs: falseartifacts:- pyarrow-{no_rc_version}-cp27-cp27mu-manylinux2010_x86_64.whlwheel-manylinux2010-cp35m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 3.5unicode_width: 16wheel_tag: manylinux2010test_docker_images:- python:3.5-slim+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp35-cp35m-manylinux2010_x86_64.whlwheel-manylinux2010-cp36m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 3.6unicode_width: 16wheel_tag: manylinux2010test_docker_images:- python:3.6-slim+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp36-cp36m-manylinux2010_x86_64.whlwheel-manylinux2010-cp37m:ci: travisplatform: linux- template: python-wheels/travis.manylinux.yml+ template: python-wheels/travis.linux.ymlparams:python_version: 3.7unicode_width: 16wheel_tag: manylinux2010test_docker_images:- python:3.7-slim+ test_remove_system_libs: trueartifacts:- pyarrow-{no_rc_version}-cp37-cp37m-manylinux2010_x86_64.whl