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 - VALGRIND=0 ARCH=arm64v8 DEVELOPER=1 TARGET_HOST=aarch64-linux-gnu
cache: cache:
directories: directories:
- dependencies - external/x86_64-linux-gnu
- external/aarch64-linux-gnu
- external/arm-linux-gnueabihf
script: script:
.travis/build.sh .travis/build.sh

View File

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

12
external/.gitignore vendored
View File

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

5
external/Makefile vendored
View File

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