diff --git a/python/release/wheel/Dockerfile-AArch64 b/python/release/wheel/Dockerfile-AArch64 new file mode 100644 index 0000000000000..5744e793b52a1 --- /dev/null +++ b/python/release/wheel/Dockerfile-AArch64 @@ -0,0 +1,6 @@ +FROM quay.io/pypa/manylinux2014_aarch64 + +RUN yum install -y libtool gcc-c++ gcc +RUN /opt/python/cp36-cp36m/bin/pip install twine + +COPY protobuf_optimized_pip.sh / diff --git a/python/release/wheel/Dockerfile b/python/release/wheel/Dockerfile-x86_64 similarity index 66% rename from python/release/wheel/Dockerfile rename to python/release/wheel/Dockerfile-x86_64 index f38ec2f5847a6..af4085951daee 100644 --- a/python/release/wheel/Dockerfile +++ b/python/release/wheel/Dockerfile-x86_64 @@ -1,6 +1,6 @@ FROM quay.io/pypa/manylinux1_x86_64 RUN yum install -y libtool -RUN /opt/python/cp27-cp27mu/bin/pip install twine +RUN /opt/python/cp36-cp36m/bin/pip install twine COPY protobuf_optimized_pip.sh / diff --git a/python/release/wheel/build_wheel_manylinux.sh b/python/release/wheel/build_wheel_manylinux.sh index 39fd8c1273884..ae1cd65e312a2 100755 --- a/python/release/wheel/build_wheel_manylinux.sh +++ b/python/release/wheel/build_wheel_manylinux.sh @@ -20,8 +20,12 @@ fi PROTOBUF_VERSION=$1 PYPI_USERNAME=$2 PYPI_PASSWORD=$3 +PLAT=x86_64 +if [ `uname -m` = 'aarch64' ]; then + PLAT=AArch64 +fi docker rmi protobuf-python-wheel -docker build . -t protobuf-python-wheel +docker build . -f Dockerfile-${PLAT} -t protobuf-python-wheel docker run --rm protobuf-python-wheel ./protobuf_optimized_pip.sh $PROTOBUF_VERSION $PYPI_USERNAME $PYPI_PASSWORD docker rmi protobuf-python-wheel diff --git a/python/release/wheel/protobuf_optimized_pip.sh b/python/release/wheel/protobuf_optimized_pip.sh index 07c2a093bba7c..5dc822e2df956 100755 --- a/python/release/wheel/protobuf_optimized_pip.sh +++ b/python/release/wheel/protobuf_optimized_pip.sh @@ -15,8 +15,13 @@ function build_wheel() { PYTHON_VERSION=$1 PYTHON_BIN=/opt/python/${PYTHON_VERSION}/bin/python + PLAT=x86_64 + if [ `uname -m` = 'aarch64' ]; then + PLAT=aarch64 + fi + $PYTHON_BIN setup.py bdist_wheel --cpp_implementation --compile_static_extension - auditwheel repair dist/protobuf-${PROTOBUF_VERSION}-${PYTHON_VERSION}-linux_x86_64.whl + auditwheel repair dist/protobuf-${PROTOBUF_VERSION}-${PYTHON_VERSION}-linux_${PLAT}.whl } # Validate arguments. @@ -36,6 +41,9 @@ PYPI_PASSWORD=$3 DIR=${PWD}/'protobuf-python-build' PYTHON_VERSIONS=('cp27-cp27mu' 'cp33-cp33m' 'cp34-cp34m' 'cp35-cp35m' 'cp36-cp36m') +if [ `uname -m` = 'aarch64' ]; then + PYTHON_VERSIONS=('cp36-cp36m' 'cp37-cp37m' 'cp38-cp38') +fi mkdir -p ${DIR} cd ${DIR} @@ -63,4 +71,4 @@ do build_wheel $PYTHON_VERSION done -/opt/python/cp27-cp27mu/bin/twine upload wheelhouse/* +/opt/python/cp36-cp36m/bin/twine upload wheelhouse/*