diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh index 44a11d015b6f8..4c302ad4736a0 100755 --- a/ci/scripts/python_wheel_manylinux_build.sh +++ b/ci/scripts/python_wheel_manylinux_build.sh @@ -160,6 +160,26 @@ export CMAKE_PREFIX_PATH=/tmp/arrow-dist pushd /arrow/python python setup.py bdist_wheel +echo "=== Strip symbols from wheel ===" +mkdir dist/temp-fix-wheel +mv dist/pyarrow-*.whl dist/temp-fix-wheel + +pushd dist/temp-fix-wheel +wheel_name=$(ls pyarrow-*.whl) +# Unzip and remove old wheel +unzip $wheel_name +rm $wheel_name +for filename in $(ls pyarrow/*.so pyarrow/*.so.*); do + echo "Stripping debug symbols from: $filename"; + strip --strip-debug $filename +done +# Zip wheel again after stripping symbols +zip -r $wheel_name . +mv $wheel_name .. +popd + +rm -rf dist/temp-fix-wheel + echo "=== (${PYTHON_VERSION}) Tag the wheel with manylinux${MANYLINUX_VERSION} ===" -auditwheel repair --strip -L . dist/pyarrow-*.whl -w repaired_wheels +auditwheel repair -L . dist/pyarrow-*.whl -w repaired_wheels popd