ADD: added new version of protobuf
This commit is contained in:
@@ -5,9 +5,12 @@
|
||||
|
||||
set -ex
|
||||
|
||||
mkdir -p cmake/crossbuild_aarch64
|
||||
cd cmake/crossbuild_aarch64
|
||||
|
||||
# the build commands are expected to run under dockcross docker image
|
||||
# where the CC, CXX and other toolchain variables already point to the crosscompiler
|
||||
cmake .
|
||||
cmake ..
|
||||
make -j8
|
||||
|
||||
# check that the resulting test binary is indeed an aarch64 ELF
|
||||
|
||||
@@ -13,11 +13,7 @@ else
|
||||
fi
|
||||
|
||||
# Pin the dockcross image since newer versions of the image break the build
|
||||
# We use an older version of dockcross image that has gcc4.9.4 because it was built
|
||||
# before https://github.com/dockcross/dockcross/pull/449
|
||||
# Thanks to that, wheel build with this image aren't actually
|
||||
# compliant with manylinux2014, but only with manylinux_2_24
|
||||
PINNED_DOCKCROSS_IMAGE_VERSION=dockcross/manylinux2014-aarch64:20200929-608e6ac
|
||||
PINNED_DOCKCROSS_IMAGE_VERSION=dockcross/manylinux2014-aarch64:20210803-41e5c69
|
||||
|
||||
# running dockcross image without any arguments generates a wrapper
|
||||
# scripts that can be used to run commands under the dockcross image
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
|
||||
set -ex
|
||||
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 -Dprotobuf_BUILD_TESTS=OFF .
|
||||
./autogen.sh
|
||||
CXXFLAGS="-fPIC -g -O2" ./configure --host=aarch64
|
||||
make -j8
|
||||
|
||||
@@ -8,16 +8,13 @@ set -ex
|
||||
|
||||
PYTHON="/opt/python/cp38-cp38/bin/python"
|
||||
|
||||
# Initialize any submodules.
|
||||
git submodule update --init --recursive
|
||||
|
||||
# Build protoc and libprotobuf
|
||||
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 -Dprotobuf_BUILD_TESTS=OFF .
|
||||
./autogen.sh
|
||||
CXXFLAGS="-fPIC -g -O2" ./configure --host=aarch64
|
||||
make -j8
|
||||
|
||||
# create a simple shell wrapper that runs crosscompiled protoc under qemu
|
||||
echo '#!/bin/bash' >protoc_qemu_wrapper.sh
|
||||
echo 'exec qemu-aarch64 "../protoc" "$@"' >>protoc_qemu_wrapper.sh
|
||||
echo 'exec qemu-aarch64 "../src/protoc" "$@"' >>protoc_qemu_wrapper.sh
|
||||
chmod ugo+x protoc_qemu_wrapper.sh
|
||||
|
||||
# PROTOC variable is by build_py step that runs under ./python directory
|
||||
|
||||
@@ -7,7 +7,7 @@ cd $(dirname $0)/../../..
|
||||
cd python
|
||||
|
||||
PYTHON="/opt/python/cp38-cp38/bin/python"
|
||||
${PYTHON} -m pip install --user pytest auditwheel numpy
|
||||
${PYTHON} -m pip install --user pytest auditwheel
|
||||
|
||||
# check that we are really using aarch64 python
|
||||
(${PYTHON} -c 'import sysconfig; print(sysconfig.get_platform())' | grep -q "linux-aarch64") || (echo "Wrong python platform, needs to be aarch64 python."; exit 1)
|
||||
@@ -16,7 +16,7 @@ ${PYTHON} -m pip install --user pytest auditwheel numpy
|
||||
# we've built the python extension previously with --inplace option
|
||||
# so we can just discover all the unittests and run them directly under
|
||||
# the python/ directory.
|
||||
LD_LIBRARY_PATH=. PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp ${PYTHON} -m pytest google/protobuf
|
||||
LD_LIBRARY_PATH=../src/.libs PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp ${PYTHON} -m pytest google/protobuf
|
||||
|
||||
# step 2: run auditwheel show to check that the wheel is manylinux2014 compatible.
|
||||
# auditwheel needs to run on wheel's target platform (or under an emulator)
|
||||
|
||||
@@ -24,4 +24,4 @@ kokoro/linux/aarch64/dockcross_helpers/run_dockcross_manylinux2014_aarch64.sh ko
|
||||
# otherwise the UID would be homeless under the docker container and pip install wouldn't work. For simplicity,
|
||||
# we just run map the user's home to a throwaway temporary directory
|
||||
|
||||
docker run $DOCKER_TTY_ARGS --rm --user "$(id -u):$(id -g)" -e "HOME=/home/fake-user" -e "PROTOC=/work/protoc" -v "$(mktemp -d):/home/fake-user" -v "$(pwd)":/work -w /work arm64v8/ruby:2.7.3-buster kokoro/linux/aarch64/ruby_build_and_run_tests_with_qemu_aarch64.sh
|
||||
docker run $DOCKER_TTY_ARGS --rm --user "$(id -u):$(id -g)" -e "HOME=/home/fake-user" -v "$(mktemp -d):/home/fake-user" -v "$(pwd)":/work -w /work arm64v8/ruby:2.7.3-buster kokoro/linux/aarch64/ruby_build_and_run_tests_with_qemu_aarch64.sh
|
||||
Reference in New Issue
Block a user