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 796602 e6cbd005399f75e80bda46c54539a432bc80e81a
parent 796227 29cbfa037517654a34ac44fc957dde2a9c5ea996
child 796611 b9ab568028d3c6b70e1b7f5e2a1621472f2f7fbf
child 796614 7bb84b0749e7efc5d66eb6b78c4bccd20b65f637
child 796632 6f00eafb7406019bca1aebda45abe107ec7c129e
child 796633 38cb5e7727f4089e8d4ab4a73ef9a6a3e228d2fc
child 796669 1be306a4dc53e55b7d6f7f7817e7e5ac39cea8c6
child 796891 cc79230c68112268487b4e785006b47df5dbfd96
push id110305
push userbmo:mh+mozilla@glandium.org
push dateThu, 17 May 2018 22:01:02 +0000
reviewersbuild
bugs1462273
milestone62.0a1
Bug 1462273 - Use more reliable mirrors for gcc dependencies. r?build In the span of one week, 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,47 @@ 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 ftp.gnu.org mirror doesn't have 0.8.2, so we use
+          # a debian source tarball instead. It has a different name,
+          # 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