Skip to content

Commit

Permalink
feature: add musllinux_1_2_armv7l (#1455)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut authored Sep 21, 2024
1 parent ab73a4b commit 3bf05d4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ jobs:
virt: vm
group: edge
env: POLICY="musllinux_1_2" PLATFORM="aarch64"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="musllinux_1_2" PLATFORM="armv7l"
- arch: s390x
env: POLICY="musllinux_1_2" PLATFORM="s390x"
- arch: ppc64le
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ Toolchain: GCC 13
- aarch64 image: ``quay.io/pypa/musllinux_1_2_aarch64``
- ppc64le image: ``quay.io/pypa/musllinux_1_2_ppc64le``
- s390x image: ``quay.io/pypa/musllinux_1_2_s390x``
- armv7l image: ``quay.io/pypa/musllinux_1_2_armv7l``


musllinux_1_1 (Alpine Linux 2.12 based)
Expand Down
3 changes: 3 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ elif [ "${PLATFORM}" == "ppc64le" ]; then
elif [ "${PLATFORM}" == "s390x" ]; then
GOARCH="s390x"
MULTIARCH_PREFIX="s390x/"
elif [ "${PLATFORM}" == "armv7l" ]; then
GOARCH="arm/v7"
MULTIARCH_PREFIX="arm32v7/"
else
echo "Unsupported platform: '${PLATFORM}'"
exit 1
Expand Down
6 changes: 5 additions & 1 deletion docker/build_scripts/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ if [ "${CPYTHON_VERSION}" == "3.6.15" ]; then
CFLAGS_EXTRA="${CFLAGS_EXTRA} -fno-tree-loop-vectorize -fno-tree-slp-vectorize"
fi
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] ; then
# Python 3.11+
# Python 3.11+
export TCLTK_LIBS="-ltk8.6 -ltcl8.6"
fi

if [ "${BASE_POLICY}_${AUDITWHEEL_ARCH}" == "musllinux_armv7l" ]; then
CONFIGURE_ARGS="${CONFIGURE_ARGS} --build=arm-linux-musleabihf"
fi

OPENSSL_PREFIX=$(find /opt/_internal -maxdepth 1 -name 'openssl*')
if [ "${OPENSSL_PREFIX}" != "" ]; then
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-openssl=${OPENSSL_PREFIX}"
Expand Down
10 changes: 6 additions & 4 deletions docker/build_scripts/finalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ pipx upgrade-shared --pip-args="--no-index --find-links=/tmp/pinned-wheels"
# install other tools with pipx
for TOOL_PATH in $(find ${MY_DIR}/requirements-tools -type f); do
TOOL=$(basename ${TOOL_PATH})
# uv doesn't provide musl s390x wheels due to Rust issues
if [[ "${TOOL}" != "uv" || "${BASE_POLICY}-${AUDITWHEEL_ARCH}" != "musllinux-s390x" ]]; then
pipx install --pip-args="--require-hashes -r ${TOOL_PATH} --only-binary" ${TOOL}
fi
case ${AUDITWHEEL_PLAT}-${TOOL} in
musllinux*_armv7l-swig) apk add --no-cache swig;;
musllinux*_armv7l-cmake) apk add --no-cache cmake;;
musllinux*_s390x-uv) continue;; # uv doesn't provide musl s390x wheels due to Rust issues
*) pipx install --pip-args="--require-hashes -r ${TOOL_PATH} --only-binary" ${TOOL};;
esac
done

# We do not need the precompiled .pyc and .pyo files.
Expand Down
5 changes: 5 additions & 0 deletions docker/manylinux-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -eu

if [ "${AUDITWHEEL_ARCH}" == "i686" ] && [ "$(uname -m)" == "x86_64" ]; then
linux32 "$@"
elif [ "${AUDITWHEEL_ARCH}" == "armv7l" ] && [ "$(uname -m)" != "armv7l" ]; then
if [ "$(linux32 uname -m)" == "armv8l" ]; then
export _PYTHON_HOST_PLATFORM="linux_armv7l"
fi
linux32 "$@"
else
exec "$@"
fi
3 changes: 2 additions & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ for PYTHON in /opt/python/*/bin/python; do
echo "invalid answer, expecting 42"
exit 1
fi
if [ "${PYVERS}" != "3.6" ] && [ "${PYVERS}" != "3.7" ] && [ "${IMPLEMENTATION}" != "graalpy" ] && [ "${AUDITWHEEL_POLICY:0:9}_${AUDITWHEEL_ARCH}" != "musllinux_s390x" ] && [ "${AUDITWHEEL_ARCH}" != "ppc64le" ]; then
if [ "${PYVERS}" != "3.6" ] && [ "${PYVERS}" != "3.7" ] && [ "${IMPLEMENTATION}" != "graalpy" ] && [ "${AUDITWHEEL_POLICY:0:9}_${AUDITWHEEL_ARCH}" != "musllinux_s390x" ] && [ "${AUDITWHEEL_ARCH}" != "ppc64le" ] && [ "${AUDITWHEEL_ARCH}" != "armv7l" ]; then
# no uv on musllinux s390x
# FIXME, armv7l test fails on Travis CI but works with qemu (maybe armv8l vs armv7l ?)
# FIXME, ppc64le test fails on Travis CI but works with qemu
UV_PYTHON=/tmp/uv-test-${IMPLEMENTATION}${PYVERS}/bin/python
uv venv --python ${PYTHON} /tmp/uv-test-${IMPLEMENTATION}${PYVERS}
Expand Down

0 comments on commit 3bf05d4

Please sign in to comment.