From 78bcbb0f96e3c65742fe3f6c5fb4c68f28dcf99c Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 22 Mar 2018 02:29:01 +0800 Subject: [PATCH 1/3] Download the GCC artifacts from the HTTP server instead of FTP server. The former seems much more stable, in case the cache becomes invalidated. --- src/ci/docker/dist-i686-linux/build-gcc.sh | 17 +++++++++++++++++ src/ci/docker/dist-x86_64-linux/build-gcc.sh | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/ci/docker/dist-i686-linux/build-gcc.sh b/src/ci/docker/dist-i686-linux/build-gcc.sh index 6b991bb59e4b0..08020e533ff19 100755 --- a/src/ci/docker/dist-i686-linux/build-gcc.sh +++ b/src/ci/docker/dist-i686-linux/build-gcc.sh @@ -17,6 +17,23 @@ GCC=4.8.5 curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.bz2 | tar xjf - cd gcc-$GCC + +# FIXME(#49246): Remove the `sed` below. +# +# On 2018 March 21st, two Travis builders' cache for Docker are suddenly invalidated. Normally this +# is fine, because we just need to rebuild the Docker image. However, it reveals a network issue: +# downloading from `ftp://gcc.gnu.org/` from Travis (using passive mode) often leads to "Connection +# timed out" error, and even when the download completed, the file is usually corrupted. This causes +# nothing to be landed that day. +# +# We observed that the `gcc-4.8.5.tar.bz2` above can be downloaded successfully, so as a stability +# improvement we try to download from the HTTPS mirror instead. Turns out this uncovered the third +# bug: the host `gcc.gnu.org` and `cygwin.com` share the same IP, and the TLS certificate of the +# latter host is presented to `wget`! Therefore, we choose to download from the insecure HTTP server +# instead here. +# +sed -i'' 's|ftp://gcc\.gnu\.org/|http://gcc.gnu.org/|g' ./contrib/download_prerequisites + ./contrib/download_prerequisites mkdir ../gcc-build cd ../gcc-build diff --git a/src/ci/docker/dist-x86_64-linux/build-gcc.sh b/src/ci/docker/dist-x86_64-linux/build-gcc.sh index 6b991bb59e4b0..08020e533ff19 100755 --- a/src/ci/docker/dist-x86_64-linux/build-gcc.sh +++ b/src/ci/docker/dist-x86_64-linux/build-gcc.sh @@ -17,6 +17,23 @@ GCC=4.8.5 curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.bz2 | tar xjf - cd gcc-$GCC + +# FIXME(#49246): Remove the `sed` below. +# +# On 2018 March 21st, two Travis builders' cache for Docker are suddenly invalidated. Normally this +# is fine, because we just need to rebuild the Docker image. However, it reveals a network issue: +# downloading from `ftp://gcc.gnu.org/` from Travis (using passive mode) often leads to "Connection +# timed out" error, and even when the download completed, the file is usually corrupted. This causes +# nothing to be landed that day. +# +# We observed that the `gcc-4.8.5.tar.bz2` above can be downloaded successfully, so as a stability +# improvement we try to download from the HTTPS mirror instead. Turns out this uncovered the third +# bug: the host `gcc.gnu.org` and `cygwin.com` share the same IP, and the TLS certificate of the +# latter host is presented to `wget`! Therefore, we choose to download from the insecure HTTP server +# instead here. +# +sed -i'' 's|ftp://gcc\.gnu\.org/|http://gcc.gnu.org/|g' ./contrib/download_prerequisites + ./contrib/download_prerequisites mkdir ../gcc-build cd ../gcc-build From 56a19a9eec0ae2cd1b1914cfe9854e1c1028f329 Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 22 Mar 2018 04:07:29 +0800 Subject: [PATCH 2/3] Handle redirects correctly. --- src/ci/docker/dist-i686-linux/build-git.sh | 2 +- src/ci/docker/dist-x86_64-linux/build-git.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/dist-i686-linux/build-git.sh b/src/ci/docker/dist-i686-linux/build-git.sh index ff62a68629a8b..aa31f50ba0343 100755 --- a/src/ci/docker/dist-i686-linux/build-git.sh +++ b/src/ci/docker/dist-i686-linux/build-git.sh @@ -12,7 +12,7 @@ set -ex source shared.sh -curl https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz | tar xzf - +curl -L https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz | tar xzf - cd git-2.10.0 make configure diff --git a/src/ci/docker/dist-x86_64-linux/build-git.sh b/src/ci/docker/dist-x86_64-linux/build-git.sh index ff62a68629a8b..aa31f50ba0343 100755 --- a/src/ci/docker/dist-x86_64-linux/build-git.sh +++ b/src/ci/docker/dist-x86_64-linux/build-git.sh @@ -12,7 +12,7 @@ set -ex source shared.sh -curl https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz | tar xzf - +curl -L https://www.kernel.org/pub/software/scm/git/git-2.10.0.tar.gz | tar xzf - cd git-2.10.0 make configure From 9f792e199bc53a75afdad72547a151a0bc86ec5d Mon Sep 17 00:00:00 2001 From: kennytm Date: Thu, 22 Mar 2018 09:02:51 +0800 Subject: [PATCH 3/3] Temporarily disable dist-ing RLS, Rustfmt and Clippy. Unfortunately we don't have sufficient time to rebuild the cache *and* distribute everything in `dist-x86_64-linux alt`, the debug assertions are really slow. We will re-enable them after the PR has been successfully merged, thus successfully updating the cache (freeing up 40 minutes), giving us enough time to build these tools. --- src/ci/run.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ci/run.sh b/src/ci/run.sh index e3f38e4834a92..afa6d1fa0aea5 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -105,7 +105,15 @@ fi travis_fold end log-system-info if [ ! -z "$SCRIPT" ]; then - sh -x -c "$SCRIPT" + # FIXME(#49246): Re-enable these tools after #49246 has been merged and thus fixing the cache. + if [ "$DEPLOY_ALT" = 1 ]; then + sh -x -c "$SCRIPT \ + --exclude src/tools/rls \ + --exclude src/tools/rustfmt \ + --exclude src/tools/clippy" + else + sh -x -c "$SCRIPT" + fi else do_make() { travis_fold start "make-$1"