From 4333c3c242c9b83af33a8d1f6403e4efbd291aa3 Mon Sep 17 00:00:00 2001 From: Nickolay Shmyrev Date: Tue, 23 Jun 2020 01:11:07 +0200 Subject: [PATCH] Build dockcross with python 3.8 --- travis/Dockerfile.dockcross | 17 +++++++++++++++++ travis/build-wheels-dockcross.sh | 15 +++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/travis/Dockerfile.dockcross b/travis/Dockerfile.dockcross index 521208e1..10a91a0d 100644 --- a/travis/Dockerfile.dockcross +++ b/travis/Dockerfile.dockcross @@ -66,6 +66,23 @@ RUN cd /opt \ && make install \ && rm -rf /opt/cpython-3.6.10 /opt/cpython-3.6.10-cross /opt/v3.6.10.tar.gz +RUN cd /opt \ + && wget -q https://github.com/python/cpython/archive/v3.8.3.tar.gz \ + && tar xf v3.8.3.tar.gz \ + && cp -r cpython-3.8.3 cpython-3.8.3-cross \ + && cd /opt/cpython-3.8.3 \ + && AR=/usr/bin/ar RANLIB=/usr/bin/ranlib CPP=/usr/bin/cpp CXX=/usr/bin/g++ CC=/usr/bin/gcc ./configure --prefix="/opt/python/cp3.8-cp3.8m" \ + && make -j $(nproc) \ + && make install \ + && /opt/python/cp3.8-cp3.8m/bin/pip3 install -U pip \ + && /opt/python/cp3.8-cp3.8m/bin/pip3 install -U wheel \ + && cd /opt/cpython-3.8.3-cross \ + && export PATH=/opt/python/cp3.8-cp3.8m/bin:$PATH \ + && ./configure --prefix=$CROSS_ROOT --with-openssl=$CROSS_ROOT --host=${CROSS_TRIPLE} --build=x86-linux-gnu --disable-ipv6 ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no ac_cv_have_long_long_format=yes \ + && make -j $(nproc) \ + && make install \ + && rm -rf /opt/cpython-3.8.3 /opt/cpython-3.8.3-cross /opt/v3.8.3.tar.gz + ARG OPENBLAS_ARCH=ARMV7 ARG ARM_HARDWARE_OPTS="-mfloat-abi=hard -mfpu=neon" RUN cd /opt \ diff --git a/travis/build-wheels-dockcross.sh b/travis/build-wheels-dockcross.sh index 0a9c328e..c5e6e6c8 100755 --- a/travis/build-wheels-dockcross.sh +++ b/travis/build-wheels-dockcross.sh @@ -2,23 +2,30 @@ set -e -x ORIG_PATH=$PATH -for pyver in 3.6 3.7; do +for pyver in 3.6 3.7 3.8; do export KALDI_ROOT=/opt/kaldi export PATH=/opt/python/cp${pyver}-cp${pyver}m/bin:$ORIG_PATH export VOSK_SOURCE=/io/src + + # Python 3.8 somehow changed syconfig file name + sysconfig_bit="m" + if [ $pyver == "3.8" ]; then + sysconfig_bit="" + fi + case $CROSS_TRIPLE in *arm-*) export _PYTHON_HOST_PLATFORM=linux-armv6l - export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_arm-linux-gnueabihf + export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_${sysconfig_bit}_linux_arm-linux-gnueabihf ;; *armv7-*) export _PYTHON_HOST_PLATFORM=linux-armv7l - export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_arm-linux-gnueabihf + export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_${sysconfig_bit}_linux_arm-linux-gnueabihf ;; *aarch64-*) export _PYTHON_HOST_PLATFORM=linux-aarch64 - export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_aarch64-linux-gnu + export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_${sysconfig_bit}_linux_aarch64-linux-gnu ;; esac export PYTHONHOME=$CROSS_ROOT