Skip to content

Commit

Permalink
fix: Use auditwheel repair to create manylinux wheel. This fixes an i…
Browse files Browse the repository at this point in the history
…ssue with the SHA256 hash of the WHEEL file in the dist info
  • Loading branch information
pacman82 committed Jan 31, 2025
1 parent e5cb570 commit 90daf3c
Showing 1 changed file with 10 additions and 28 deletions.
38 changes: 10 additions & 28 deletions manylinux/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,19 @@ PYBIN="/opt/python/cp310-cp310/bin"
"${PYBIN}/pip" install --upgrade pip
"${PYBIN}/pip" wheel /io/ -w wheelhouse/

# Do not bundle unixODBC with the manylinux wheel
#
# * Won't work well, because ODBC lib has to dynamically load drivers from the
# system anyway.
# * Unclear (to me) if we could redistribute unixODBC that way, since it is
# GPL.
#
# So we won't call auditwheel repair

mkdir /io/dist

for f in /wheelhouse/arrow_odbc-*.whl
do
# We won't do that, see above
# auditwheel repair "${whl}" -w /io/dist/

# Instead we unzip the wheel edit the dist info and rename it ourselfs, so we can upload it to PyPi

# f looks like e.g. /wheelhouse/arrow_odbc-0.1.8-py3-none-linux_x86_64.whl
# trunk e.g. /wheelhouse/arrow_odbc-0.1.8
trunk=${f%-py3-none-linux_x86_64.whl}
# E.g. 0.1.8
ver=${trunk#*-}

mv $f /wheelhouse/arrow_odbc-${ver}.zip
unzip /wheelhouse/arrow_odbc-${ver}.zip -d /wheelhouse/arrow_odbc-${ver}-edit

cp -f /io/manylinux/WHEEL "/wheelhouse/arrow_odbc-${ver}-edit/arrow_odbc-${ver}.dist-info/WHEEL"

cd /wheelhouse/arrow_odbc-${ver}-edit/
zip -rv /io/dist/arrow_odbc-${ver}-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl .
cd -
# Do not bundle unixODBC with the manylinux wheel
#
# * Won't work well, because ODBC lib has to dynamically load drivers from the
# system anyway.
# * Unclear (to me) if we could redistribute unixODBC that way, since it is
# GPL.
#
# Other than that auditwheel will change the tag fro linux_x86_64 to manylinux_2_17_x86_64 and
# manylinux2016_x86_64
auditwheel repair --exclude libodbc.so.* "${f}" -w /io/dist/
done

0 comments on commit 90daf3c

Please sign in to comment.