Skip to content

Commit 63424fb

Browse files
codablockUdjinM6
authored andcommitted
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.
1 parent 09b017f commit 63424fb

File tree

6 files changed

+9
-12
lines changed

6 files changed

+9
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ libconftest.dylib*
8383
Makefile
8484
dash-qt
8585
Dash-Qt.app
86+
!/depends/Makefile
8687

8788
# Unit-tests
8889
Makefile.test

.travis.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,10 @@ dist: trusty
88
os: linux
99
language: generic
1010

11-
addons:
12-
apt:
13-
packages:
14-
# Use more recent docker version
15-
- docker-ce
16-
# Can be removed if Travis ever upgrades to Bionic
17-
- realpath
18-
1911
services:
2012
- docker
2113

2214
cache:
23-
apt: true
2415
ccache: true
2516
directories:
2617
- $HOME/cache
@@ -122,6 +113,10 @@ before_cache:
122113
# Save builder image
123114
- 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
124115

116+
before_install:
117+
- travis_retry travis_apt_get_update
118+
- travis_retry sudo apt-get -yq --no-install-suggests --no-install-recommends install docker-ce realpath
119+
125120
install:
126121
# Our scripts try to be Travis agnostic
127122
- export PULL_REQUEST="$TRAVIS_PULL_REQUEST"

depends/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ PATCHES_PATH = $(BASEDIR)/patches
1414
BASEDIR = $(CURDIR)
1515
HASH_LENGTH:=11
1616
DOWNLOAD_CONNECT_TIMEOUT:=10
17-
DOWNLOAD_RETRIES:=3
1817
HOST_ID_SALT ?= salt
1918
BUILD_ID_SALT ?= salt
2019

depends/builders/darwin.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build_darwin_OTOOL: = $(shell xcrun -f otool)
77
build_darwin_NM: = $(shell xcrun -f nm)
88
build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)
99
build_darwin_SHA256SUM = shasum -a 256
10-
build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
10+
build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) -o
1111

1212
#darwin host on darwin builder. overrides darwin host preferences.
1313
darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)

depends/builders/linux.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
build_linux_SHA256SUM = sha256sum
2-
build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o
2+
build_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) -o

depends/funcs.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ endef
3131
define fetch_file
3232
( test -f $$($(1)_source_dir)/$(4) || \
3333
( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \
34+
(sleep 5 && $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5))) || \
35+
(sleep 10 && $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5))) || \
3436
$(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5))))
3537
endef
3638

0 commit comments

Comments
 (0)