You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ra...@apache.org on 2024/06/11 09:41:14 UTC
(arrow) branch main updated: GH-40749: [Python][Packaging] Strip unnecessary symbols when building wheels (#42028)
This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new baf4089eaa GH-40749: [Python][Packaging] Strip unnecessary symbols when building wheels (#42028)
baf4089eaa is described below
commit baf4089eaa84b2a5c2cb437f3a249f83577dbc29
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Tue Jun 11 11:41:07 2024 +0200
GH-40749: [Python][Packaging] Strip unnecessary symbols when building wheels (#42028)
### Rationale for this change
Removing unnecessary symbols for wheels will allow us to reduce the size of the wheels considerably.
### What changes are included in this PR?
Running `strip --strip-debug` on Linux wheels for all *.so files.
### Are these changes tested?
Yes, via Archery.
### Are there any user-facing changes?
No
* GitHub Issue: #40749
Lead-authored-by: Raúl Cumplido <ra...@gmail.com>
Co-authored-by: Antoine Pitrou <pi...@free.fr>
Signed-off-by: Raúl Cumplido <ra...@gmail.com>
---
ci/scripts/python_wheel_manylinux_build.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/ci/scripts/python_wheel_manylinux_build.sh b/ci/scripts/python_wheel_manylinux_build.sh
index 6e29ef58d2..aa86494a9d 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 -p 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 -L . dist/pyarrow-*.whl -w repaired_wheels
popd