Fix 2 common Travis failures which happen when Travis has network issues (#3003)

* Retry downloading of depends sources 3 times

* Manually invoke apt-get update and install instead of using addon

This allows us to use travis_retry on these operations.

* Add exception for depends/Makefile in .gitignore

* Remove --retry from curl call

This avoids future confusion as we don't rely on curl anymore to properly
retry downloads. curls does only retry on transient errors, while Travis
might cause all kinds of errors which circumvent the retry logic of curl.
This commit is contained in:
Alexander Block 2019-06-27 22:25:30 +02:00
parent 8d763c1440
commit 0410259dd5
6 changed files with 9 additions and 12 deletions

1
.gitignore vendored
View File

@ -83,6 +83,7 @@ libconftest.dylib*
Makefile Makefile
dash-qt dash-qt
Dash-Qt.app Dash-Qt.app
!/depends/Makefile
# Unit-tests # Unit-tests
Makefile.test Makefile.test

View File

@ -8,19 +8,10 @@ dist: trusty
os: linux os: linux
language: generic language: generic
addons:
apt:
packages:
# Use more recent docker version
- docker-ce
# Can be removed if Travis ever upgrades to Bionic
- realpath
services: services:
- docker - docker
cache: cache:
apt: true
ccache: true ccache: true
directories: directories:
- $HOME/cache - $HOME/cache
@ -121,6 +112,10 @@ before_cache:
# Save builder image # Save builder image
- docker save dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/dash-builder-$BUILD_TARGET.tar.gz - docker save dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/dash-builder-$BUILD_TARGET.tar.gz
before_install:
- travis_retry travis_apt_get_update
- travis_retry sudo apt-get -yq --no-install-suggests --no-install-recommends install docker-ce realpath
install: install:
# Our scripts try to be Travis agnostic # Our scripts try to be Travis agnostic
- export PULL_REQUEST="$TRAVIS_PULL_REQUEST" - export PULL_REQUEST="$TRAVIS_PULL_REQUEST"

View File

@ -14,7 +14,6 @@ PATCHES_PATH = $(BASEDIR)/patches
BASEDIR = $(CURDIR) BASEDIR = $(CURDIR)
HASH_LENGTH:=11 HASH_LENGTH:=11
DOWNLOAD_CONNECT_TIMEOUT:=10 DOWNLOAD_CONNECT_TIMEOUT:=10
DOWNLOAD_RETRIES:=3
HOST_ID_SALT ?= salt HOST_ID_SALT ?= salt
BUILD_ID_SALT ?= salt BUILD_ID_SALT ?= salt

View File

@ -7,7 +7,7 @@ build_darwin_OTOOL: = $(shell xcrun -f otool)
build_darwin_NM: = $(shell xcrun -f nm) build_darwin_NM: = $(shell xcrun -f nm)
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
build_darwin_SHA256SUM = shasum -a 256 build_darwin_SHA256SUM = shasum -a 256
build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) -o
#darwin host on darwin builder. overrides darwin host preferences. #darwin host on darwin builder. overrides darwin host preferences.
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)

View File

@ -1,2 +1,2 @@
build_linux_SHA256SUM = sha256sum build_linux_SHA256SUM = sha256sum
build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) -o

View File

@ -31,6 +31,8 @@ endef
define fetch_file define fetch_file
( test -f $$($(1)_source_dir)/$(4) || \ ( test -f $$($(1)_source_dir)/$(4) || \
( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \ ( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \
(sleep 5 && $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5))) || \
(sleep 10 && $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5))) || \
$(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5)))) $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5))))
endef endef