Skip to content

Commit bfc5821

Browse files
committed
ENH: Re-factor manylinux scripts introducing MANYLINUX_VERSION and IMAGE_TAG
1 parent ebb79a3 commit bfc5821

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

scripts/dockcross-manylinux-build-module-wheels.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
1818
#
1919

20+
MANYLINUX_VERSION=2014
21+
IMAGE_TAG=20211011-a315bdc
22+
2023
# Generate dockcross scripts
21-
docker run --rm dockcross/manylinux2014-x64:20211011-a315bdc > /tmp/dockcross-manylinux-x64
24+
docker run --rm dockcross/manylinux${MANYLINUX_VERSION}-x64:${IMAGE_TAG} > /tmp/dockcross-manylinux-x64
2225
chmod u+x /tmp/dockcross-manylinux-x64
2326

2427
script_dir=$(cd $(dirname $0) || exit 1; pwd)

scripts/dockcross-manylinux-build-wheels.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
#
88
# scripts/dockcross-manylinux-build-wheels.sh cp39
99

10+
MANYLINUX_VERSION=2014
11+
IMAGE_TAG=20211011-a315bdc
12+
1013
# Generate dockcross scripts
11-
docker run --rm dockcross/manylinux2014-x64:20211011-a315bdc > /tmp/dockcross-manylinux-x64
14+
docker run --rm dockcross/manylinux${MANYLINUX_VERSION}-x64:${IMAGE_TAG} > /tmp/dockcross-manylinux-x64
1215
chmod u+x /tmp/dockcross-manylinux-x64
1316

1417
script_dir=$(cd $(dirname $0) || exit 1; pwd)

scripts/internal/manylinux-build-common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,6 @@ if ! type ninja > /dev/null 2>&1; then
8484
popd
8585
fi
8686

87-
echo "Building wheels for $ARCH"
87+
MANYLINUX_VERSION=2014
88+
89+
echo "Building wheels for $ARCH using manylinux${MANYLINUX_VERSION}"

scripts/internal/manylinux-build-module-wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ for PYBIN in "${PYBINARIES[@]}"; do
7878
version=$(basename $(dirname ${PYBIN}))
7979
# Remove "m" -- not present in Python 3.8 and later
8080
version=${version:0:9}
81-
itk_build_dir=/work/$(basename /ITKPythonPackage/ITK-${version}*-manylinux2014_${ARCH})
82-
ln -fs /ITKPythonPackage/ITK-${version}*-manylinux2014_${ARCH} $itk_build_dir
81+
itk_build_dir=/work/$(basename /ITKPythonPackage/ITK-${version}*-manylinux${MANYLINUX_VERSION}_${ARCH})
82+
ln -fs /ITKPythonPackage/ITK-${version}*-manylinux${MANYLINUX_VERSION}_${ARCH} $itk_build_dir
8383
if [[ ! -d ${itk_build_dir} ]]; then
8484
echo 'ITK build tree not available!' 1>&2
8585
exit 1
@@ -117,6 +117,6 @@ if test "${ARCH}" == "x64"; then
117117
fi
118118
if compgen -G "dist/itk*-linux*.whl" > /dev/null; then
119119
for itk_wheel in dist/itk*-linux*.whl; do
120-
mv ${itk_wheel} ${itk_wheel/linux/manylinux2014}
120+
mv ${itk_wheel} ${itk_wheel/linux/manylinux${MANYLINUX_VERSION}}
121121
done
122122
fi

scripts/internal/manylinux-build-wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ for PYBIN in "${PYBINARIES[@]}"; do
5656
build_type="Release"
5757
compile_flags="-O3 -DNDEBUG"
5858
source_path=/work/ITK-source/ITK
59-
build_path=/work/ITK-$(basename $(dirname ${PYBIN}))-manylinux2014_${ARCH}
59+
build_path=/work/ITK-$(basename $(dirname ${PYBIN}))-manylinux${MANYLINUX_VERSION}_${ARCH}
6060
SETUP_PY_CONFIGURE="${script_dir}/../setup_py_configure.py"
6161
SKBUILD_CMAKE_INSTALL_PREFIX=$(${Python3_EXECUTABLE} -c "from skbuild.constants import CMAKE_INSTALL_DIR; print(CMAKE_INSTALL_DIR)")
6262

@@ -167,9 +167,9 @@ done
167167

168168
if test "${ARCH}" == "x64"; then
169169
sudo /opt/python/cp39-cp39/bin/pip3 install auditwheel wheel
170-
# This step will fixup the wheel switching from 'linux' to 'manylinux2014' tag
170+
# This step will fixup the wheel switching from 'linux' to 'manylinux<version>' tag
171171
for whl in dist/itk_*linux_$(uname -p).whl; do
172-
/opt/python/cp39-cp39/bin/auditwheel repair --plat manylinux2014_x86_64 ${whl} -w /work/dist/
172+
/opt/python/cp39-cp39/bin/auditwheel repair --plat manylinux${MANYLINUX_VERSION}_x86_64 ${whl} -w /work/dist/
173173
rm ${whl}
174174
done
175175
else

0 commit comments

Comments
 (0)