Migrate linux-aarch64 tests away from autotools (#10015)

Autotools support is being deprecated, so this moves some of our kokoro tests to cmake
pull/10059/head
mkruskal-google 3 years ago committed by GitHub
parent 0e42bf9f58
commit f2e06fe042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      kokoro/linux/aarch64/cpp_crosscompile_and_run_tests_with_qemu_aarch64.sh
  2. 6
      kokoro/linux/aarch64/dockcross_helpers/run_dockcross_manylinux2014_aarch64.sh
  3. 3
      kokoro/linux/aarch64/protoc_crosscompile_aarch64.sh
  4. 13
      kokoro/linux/aarch64/python_crosscompile_aarch64.sh
  5. 2
      kokoro/linux/aarch64/python_run_tests_with_qemu_aarch64.sh

@ -5,12 +5,9 @@
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,7 +13,11 @@ else
fi
# Pin the dockcross image since newer versions of the image break the build
PINNED_DOCKCROSS_IMAGE_VERSION=dockcross/manylinux2014-aarch64:20210803-41e5c69
# 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
# running dockcross image without any arguments generates a wrapper
# scripts that can be used to run commands under the dockcross image

@ -4,6 +4,5 @@
set -ex
./autogen.sh
CXXFLAGS="-fPIC -g -O2" ./configure --host=aarch64
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 .
make -j8

@ -8,13 +8,20 @@ set -ex
PYTHON="/opt/python/cp38-cp38/bin/python"
./autogen.sh
CXXFLAGS="-fPIC -g -O2" ./configure --host=aarch64
# Initialize any submodules.
git submodule update --init --recursive
# Build protoc and libprotobuf
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_WITH_ZLIB=0 .
make -j8
# Copy lib files to the expected location.
mkdir -p src/.libs
ln -f *.a src/.libs/
# create a simple shell wrapper that runs crosscompiled protoc under qemu
echo '#!/bin/bash' >protoc_qemu_wrapper.sh
echo 'exec qemu-aarch64 "../src/protoc" "$@"' >>protoc_qemu_wrapper.sh
echo 'exec qemu-aarch64 "../protoc" "$@"' >>protoc_qemu_wrapper.sh
chmod ugo+x protoc_qemu_wrapper.sh
# PROTOC variable is by build_py step that runs under ./python directory

@ -16,7 +16,7 @@ ${PYTHON} -m pip install --user pytest auditwheel
# 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=../src/.libs PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp ${PYTHON} -m pytest google/protobuf
LD_LIBRARY_PATH=. 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)

Loading…
Cancel
Save