Skip to content
1 change: 1 addition & 0 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ else # Linux
if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
patchelf \
pocl-opencl-icd
elif [[ $(uname -m) == "x86_64" ]]; then
sudo yum update -y
Expand Down
41 changes: 28 additions & 13 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,37 @@ elif [[ $TASK == "bdist" ]]; then
cp "$(echo "dist/lightgbm-${LGB_VER}-py3-none-macosx"*.whl)" "${BUILD_ARTIFACTSTAGINGDIRECTORY}" || exit 1
fi
else
if [[ $ARCH == "x86_64" ]]; then
PLATFORM="manylinux_2_28_x86_64"
else
PLATFORM="manylinux2014_$ARCH"
fi
sh ./build-python.sh bdist_wheel --integrated-opencl || exit 1
# rename wheel, to fix scikit-build-core choosing the platform 'linux_aarch64' instead of
# a manylinux tag
mv \
./dist/*.whl \
./dist/tmp.whl || exit 1
mv \
./dist/tmp.whl \
"./dist/lightgbm-${LGB_VER}-py3-none-${PLATFORM}.whl" || exit 1

# print some debugging logs about the wheel's GLIBC version and dependencies on shared libraries
pip install 'auditwheel>=6.5.1'
auditwheel show ./dist/lightgbm*.whl

# pass through 'auditwheel repair' to set the appropriate wheel tags.
#
# intentionally avoid vendoring libgomp, to reduce the risk of multiple OpenMP libraries
# being loaded in the same process.
auditwheel repair \
--exclude 'libgomp.so*' \
--lib-sdir '' \
--wheel-dir dist-fixed/ \
./dist/lightgbm*.whl

# overwrite the original wheel with the new one
rm ./dist/lightgbm*.whl
mv ./dist-fixed/lightgbm*.whl ./dist

# check wheel properties
sh .ci/check-python-dists.sh ./dist || exit 1

if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
# hard-code expected tag so CI will fail if 'auditwheel repair' has a surprising result (e.g. newer
# manylinux tag than we intended)
if [[ $ARCH == "x86_64" ]]; then
PLATFORM="manylinux_2_27_x86_64.manylinux_2_28_x86_64"
else
PLATFORM="manylinux2014_aarch64.manylinux_2_17_aarch64"
fi
Comment on lines +169 to +173
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice these tags are different... auditwheel found that we could cover more platforms than the tags we'd been using!!

INFO:auditwheel.main_repair:Repairing lightgbm-4.6.0.99-py3-none-linux_aarch64.whl
INFO:auditwheel.lddtree:Excluding libgomp.so.1
INFO:auditwheel.wheeltools:Previous filename tags: linux_aarch64
INFO:auditwheel.wheeltools:New filename tags: manylinux_2_17_aarch64, manylinux2014_aarch64
INFO:auditwheel.wheeltools:Previous WHEEL info tags: py3-none-linux_aarch64
INFO:auditwheel.wheeltools:New WHEEL info tags: py3-none-manylinux_2_17_aarch64, py3-none-manylinux2014_aarch64
INFO:auditwheel.main_repair:
Fixed-up wheel written to /LightGBM/dist-fixed/lightgbm-4.6.0.99-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

(aarch64 logs)

The x86_64 logs could support GLIBC 2.27 (Ubuntu 18.04, for example) and the aarch64 wheels could support GLIBC 2.17!

cp "dist/lightgbm-${LGB_VER}-py3-none-${PLATFORM}.whl" "${BUILD_ARTIFACTSTAGINGDIRECTORY}" || exit 1
fi
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
Expand Down
Loading