travis: Actually build for arm

Before this we cached the whole `external` directory, but that lead to
stale files since the cache is checked out after the repository is
cloned.
This commit is contained in:
Niklas Claesson 2020-01-29 21:13:09 +01:00 committed by Christian Decker
parent e0aef66ce2
commit 601464416b
4 changed files with 22 additions and 23 deletions

View File

@ -37,7 +37,9 @@ env:
- VALGRIND=0 ARCH=arm64v8 DEVELOPER=1 TARGET_HOST=aarch64-linux-gnu
cache:
directories:
- dependencies
- external/x86_64-linux-gnu
- external/aarch64-linux-gnu
- external/arm-linux-gnueabihf
script:
.travis/build.sh

View File

@ -51,39 +51,42 @@ cat > pytest.ini << EOF
addopts=-p no:logging --color=no --force-flaky
EOF
if [ "$TARGET_HOST" == "arm-linux-gnueabihf" ] || [ "$TARGET_HOST" == "arm-linux-gnueabihf" ]
if [ "$TARGET_HOST" == "arm-linux-gnueabihf" ] || [ "$TARGET_HOST" == "aarch64-linux-gnu" ]
then
export QEMU_LD_PREFIX=/usr/"$TARGET_HOST"/
export MAKE_HOST="$TARGET_HOST"
export BUILD=x86_64-pc-linux-gnu
export AR="$TARGET_HOST"-ar
export AS="$TARGET_HOST"-as
export CC="$TARGET_HOST"-gcc
export CXX="$TARGET_HOST"-g++
export LD="$TARGET_HOST"-ld
export STRIP="$TARGET_HOST"-strip
export CONFIGURATION_WRAPPER=qemu-"${TARGET_HOST%%-*}"-static
wget -q https://zlib.net/zlib-1.2.11.tar.gz \
&& tar xvf zlib-1.2.11.tar.gz \
&& tar xf zlib-1.2.11.tar.gz \
&& cd zlib-1.2.11 \
&& ./configure --prefix="$QEMU_LD_PREFIX" \
&& make \
&& sudo make install
&& sudo make install
cd .. && rm zlib-1.2.11.tar.gz && rm -rf zlib-1.2.11
wget -q https://www.sqlite.org/2018/sqlite-src-3260000.zip \
&& unzip sqlite-src-3260000.zip \
&& unzip -q sqlite-src-3260000.zip \
&& cd sqlite-src-3260000 \
&& automake --add-missing --force-missing --copy || true \
&& ./configure --disable-tcl --enable-static --disable-readline --disable-threadsafe --disable-load-extension --host="$TARGET_HOST" --prefix="$QEMU_LD_PREFIX" \
&& make \
&& sudo make install
&& sudo make install
cd .. && rm sqlite-src-3260000.zip && rm -rf sqlite-src-3260000
wget -q https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz \
&& tar xvf gmp-6.1.2.tar.xz \
&& tar xf gmp-6.1.2.tar.xz \
&& cd gmp-6.1.2 \
&& ./configure --disable-assembly --prefix="$QEMU_LD_PREFIX" --host="$TARGET_HOST" \
&& make \
&& sudo make install
&& sudo make install
cd .. && rm gmp-6.1.2.tar.xz && rm -rf gmp-6.1.2
./configure --enable-static
@ -92,9 +95,10 @@ then
make -j3 > /dev/null
echo -en 'travis_fold:end:script.2\\r'
echo -en 'travis_fold:start:script.3\\r'
make -j$PYTEST_PAR check-units
echo -en 'travis_fold:end:script.3\\r'
# Tests would need to be wrapped with qemu-<arch>-static
#echo -en 'travis_fold:start:script.3\\r'
#make -j$PYTEST_PAR check-units
#echo -en 'travis_fold:end:script.3\\r'
elif [ "$SOURCE_CHECK_ONLY" == "false" ]; then
echo -en 'travis_fold:start:script.2\\r'
make -j3 > /dev/null

12
external/.gitignore vendored
View File

@ -1,9 +1,3 @@
libjsmn.a
libsecp256k1.a
libsecp256k1.la
libsodium.a
libsodium.la
libwallycore.a
libwallycore.la
libwally-core-build
libsodium-build
x86_64-linux-gnu
aarch64-linux-gnu
arm-linux-gnueabihf

5
external/Makefile vendored
View File

@ -4,13 +4,12 @@ SUBMODULES = \
external/jsmn \
external/libbacktrace
TOP := ../..
ifdef BUILD
CROSSCOMPILE_OPTS := --host="$(MAKE_HOST)" --build="$(BUILD)"
TARGET_DIR := external/"$(MAKE_HOST)"
TOP := ../..
else
TARGET_DIR := external
TOP := ..
TARGET_DIR := external/"$(shell gcc -dumpmachine)"
endif
LIBSODIUM_HEADERS := external/libsodium/src/libsodium/include/sodium.h