Skip to content

Commit c843661

Browse files
committed
travis: Make a few curl invocations more resilient
Use the `-f` flag to indicate that, for example, a 500 response code is to be considered a failure, triggering the normal retry logic. Also ignore errors where we check the date from google.com, as a failure there shouldn't fail the build.
1 parent 5803f99 commit c843661

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

.travis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ matrix:
6464
os: osx
6565
osx_image: xcode8.2
6666
install: &osx_install_sccache >
67-
travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
67+
travis_retry curl -fo /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
6868
chmod +x /usr/local/bin/sccache &&
69-
travis_retry curl -o /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
69+
travis_retry curl -fo /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
7070
chmod +x /usr/local/bin/stamp
7171
- env: >
7272
RUST_CHECK_TARGET=check
@@ -144,7 +144,7 @@ env:
144144

145145
# Note that this is overridden on OSX builders
146146
install: >
147-
travis_retry curl -o $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
147+
travis_retry curl -fo $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
148148
chmod +x $HOME/stamp &&
149149
export PATH=$PATH:$HOME
150150
@@ -183,10 +183,10 @@ before_script:
183183
# clock drift. Timezones don't matter since relative deltas give all the necessary info.
184184
script:
185185
- >
186-
date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
186+
date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
187187
- stamp sh -x -c "$RUN_SCRIPT"
188188
- >
189-
date && curl -s --head https://google.com | grep ^Date: | sed 's/Date: //g'
189+
date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
190190
191191
after_success:
192192
- >

src/ci/docker/scripts/android-ndk.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ URL=https://dl.google.com/android/repository
1515
download_ndk() {
1616
mkdir -p /android/ndk
1717
cd /android/ndk
18-
curl -O $URL/$1
18+
curl -sO $URL/$1
1919
unzip -q $1
2020
rm $1
2121
mv android-ndk-* ndk

src/ci/docker/scripts/android-sdk.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ URL=https://dl.google.com/android/repository
1515
download_sdk() {
1616
mkdir -p /android/sdk
1717
cd /android/sdk
18-
curl -O $URL/$1
18+
curl -sO $URL/$1
1919
unzip -q $1
2020
rm -rf $1
2121
}

src/ci/docker/scripts/crosstool-ng.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
set -ex
1212

1313
url="http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2"
14-
curl $url | tar xjf -
14+
curl -s $url | tar xjf -
1515
cd crosstool-ng
1616
./configure --prefix=/usr/local
1717
make -j$(nproc)

src/ci/docker/scripts/dumb-init.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
set -ex
1212

13-
curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb
13+
curl -sOL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb
1414
dpkg -i dumb-init_*.deb
1515
rm dumb-init_*.deb

src/ci/docker/scripts/emscripten-wasm.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ exit 1
2828
}
2929

3030
# Download last known good emscripten from WebAssembly waterfall
31-
BUILD=$(curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
31+
BUILD=$(curl -sL https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
3232
jq '.build | tonumber')
33-
curl -L https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
33+
curl -sL https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
3434
hide_output tar xvkj
3535

3636
# node 8 is required to run wasm
3737
cd /
38-
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
38+
curl -sL https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
3939
tar -xJ
4040

4141
# Make emscripten use wasm-ready node and LLVM tools

src/ci/docker/scripts/emscripten.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ exit 1
2828
}
2929

3030
cd /
31-
curl -L https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
31+
curl -sL https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
3232
tar -xz
3333

3434
cd /emsdk-portable
@@ -49,5 +49,5 @@ chmod a+rxw -R /emsdk-portable
4949

5050
# node 8 is required to run wasm
5151
cd /
52-
curl -L https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
52+
curl -sL https://nodejs.org/dist/v8.0.0/node-v8.0.0-linux-x64.tar.xz | \
5353
tar -xJ

src/ci/docker/scripts/make3.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
set -ex
1212

13-
curl https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
13+
curl -s https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
1414
cd make-3.81
1515
./configure --prefix=/usr
1616
make

src/ci/docker/scripts/sccache.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
set -ex
1212

13-
curl -o /usr/local/bin/sccache \
13+
curl -so /usr/local/bin/sccache \
1414
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl
1515

1616
chmod +x /usr/local/bin/sccache

0 commit comments

Comments
 (0)