Bug 1462273 - Use more reliable mirrors for gcc dependencies. r?build draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 17 May 2018 17:52:37 +0900
changeset 796229 08ac31ebb1ed2f09833099a34e1a34bdeb813df3
parent 796227 29cbfa037517654a34ac44fc957dde2a9c5ea996
push id110184
push userbmo:mh+mozilla@glandium.org
push dateThu, 17 May 2018 09:00:28 +0000
reviewersbuild
bugs1462273
milestone62.0a1
Bug 1462273 - Use more reliable mirrors for gcc dependencies. r?build In the same week span, both gmplib.org and multiprecision.org, respective home of gmp and mpc have gone down. The latter is still down. It turns out that all versions of gmp and mpfr we need are mirrored on ftp.gnu.org, so we can just use that instead. For mpc, versions > 1.0 are on ftp.gnu.org, but not earlier versions. The one mpc version <= 1.0 we do need is 0.8.2, and a copy of the exact same archive, as per its sha256, which we're already checking per the gcc build scripts, can be found on snapshot.debian.org. We lose gpg validation on the way, but since we're already checking the sha256, that's a fine tradeoff. At least this unblocks changes to toolchains until multiprecision.org comes back online.
build/unix/build-gcc/build-gcc.sh
--- a/build/unix/build-gcc/build-gcc.sh
+++ b/build/unix/build-gcc/build-gcc.sh
@@ -38,35 +38,46 @@ prepare() {
     set -- --no-verify
     . ./contrib/download_prerequisites
   ) 3>&1 > /dev/null | while read url; do
     file=$(basename $url)
     case "$file" in
     gmp-*.tar.*)
       # If download_prerequisites wants 4.3.2, use 5.1.3 instead.
       file=${file/4.3.2/5.1.3}
-      download_and_check https://gmplib.org/download/gmp $file.sig
+      download_and_check https://ftp.gnu.org/gnu/gmp/ $file.sig
       ;;
     mpfr-*.tar.*)
       # If download_prerequisites wants 2.4.2, use 3.1.5 instead.
       file=${file/2.4.2/3.1.5}
-      download_and_check http://www.mpfr.org/${file%.tar.*} $file.asc
+      download_and_check https://ftp.gnu.org/gnu/mpfr/ $file.sig
       ;;
     mpc-*.tar.*)
       # If download_prerequisites wants 0.8.1, use 0.8.2 instead.
       file=${file/0.8.1/0.8.2}
       case "$file" in
       *-0.8.2.tar*|*-0.9.tar*|*-1.0.tar*)
         ext=asc
         ;;
       *)
         ext=sig
         ;;
       esac
-      download_and_check http://www.multiprecision.org/downloads $file.$ext
+      case "$file" in
+      *-0.8.2.tar*)
+          # The file has a different name on the debian mirror, so
+          # we can't use `download`. Manually do what it does, but
+          # handling the difference in file name.
+          wget -c --progress=dot:mega -O $TMPDIR/$file http://snapshot.debian.org/archive/debian/20100527T162226Z/pool/main/m/mpclib/mpclib_0.8.2.orig.tar.gz
+          (cd $TMPDIR; sha256sum $file) >> $root_dir/downloads
+          ;;
+      *)
+          download_and_check https://ftp.gnu.org/gnu/mpc $file.$ext
+          ;;
+      esac
       ;;
     *)
       download $(dirname $url) $file
       ;;
     esac
     tar xaf $TMPDIR/$file
     ln -sf ${file%.tar.*} ${file%-*}
   done