Skip to content

Commit 8df1099

Browse files
authored
Try a named GNU mirror before the redirector (#183)
Two hosts turned out to be too few, for a different reason from one being too few. ftpmirror.gnu.org is a redirector to whichever mirror is near, and the one it picked answered with an HTTP error: -- Using src='https://ftpmirror.gnu.org/gnu/gdb/gdb-15.2.tar.xz' error: downloading ... failed status_code: 22 status_string: "HTTP response code said error" after which the fallback to ftp.gnu.org timed out the way it has all week. mirrors.kernel.org goes first: it is the same host every time, so it can be seen to work rather than hoped about. The redirector stays behind it as the thing that keeps working when that host does not, and ftp.gnu.org stays last. Checked: kernel.org returns gdb-15.2.tar.xz with the sha256 pinned here. The test now asks for three hosts, refuses ftp.gnu.org as the first one, and requires it as the last.
1 parent 24e2ce9 commit 8df1099

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

cmake/Components.cmake

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@ include_guard(GLOBAL)
44
# hashes together so version updates cannot accidentally mix artifacts.
55
set(GCC_VERSION 15.2.0)
66
set(GCC_HASH SHA256=438fd996826b0c82485a29da03a72d71d6e3541a83ec702df4271f6fe025d24e)
7-
# Everything below that GNU hosts is named twice: ftpmirror.gnu.org first,
8-
# which is GNU's own redirector to a nearby mirror, and ftp.gnu.org after it.
9-
# ExternalProject tries them in order and URL_HASH decides whether what came
10-
# back is the right bytes, so a mirror serving something else fails the same
11-
# way a corrupt download does.
7+
# Everything below that GNU hosts is named three times, tried in order:
8+
# mirrors.kernel.org, then ftpmirror.gnu.org, then ftp.gnu.org. URL_HASH
9+
# decides whether what came back is the right bytes, so a mirror serving
10+
# something else fails the way a corrupt download does.
1211
#
1312
# One host was one host too few. ftp.gnu.org refused connections for over two
1413
# minutes at a time through 26 and 27 August, and each time it took a whole
1514
# build with it -- six components come from there, and gdb is downloaded by
1615
# every host.
16+
#
17+
# Two was also too few, for a different reason: ftpmirror.gnu.org is a
18+
# redirector to whichever mirror is near, and the one it picked answered with
19+
# an HTTP error. A named mirror goes first because it is the same host every
20+
# time and can be seen to work; the redirector stays behind it as the thing
21+
# that keeps working when that host does not.
1722

1823
set(GCC_URL
24+
https://mirrors.kernel.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
1925
https://ftpmirror.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
2026
https://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz)
2127

@@ -34,18 +40,21 @@ set(LIBYAML_URL https://pyyaml.org/download/libyaml/yaml-${LIBYAML_VERSION}.tar.
3440
set(GMP_VERSION 6.3.0)
3541
set(GMP_HASH SHA256=ac28211a7cfb609bae2e2c8d6058d66c8fe96434f740cf6fe2e47b000d1c20cb)
3642
set(GMP_URL
43+
https://mirrors.kernel.org/gnu/gmp/gmp-${GMP_VERSION}.tar.bz2
3744
https://ftpmirror.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.bz2
3845
https://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.bz2)
3946

4047
set(MPFR_VERSION 4.2.2)
4148
set(MPFR_HASH SHA256=9ad62c7dc910303cd384ff8f1f4767a655124980bb6d8650fe62c815a231bb7b)
4249
set(MPFR_URL
50+
https://mirrors.kernel.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.bz2
4351
https://ftpmirror.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.bz2
4452
https://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.bz2)
4553

4654
set(MPC_VERSION 1.3.1)
4755
set(MPC_HASH SHA256=ab642492f5cf882b74aa0cb730cd410a81edcdbec895183ce930e706c1c759b8)
4856
set(MPC_URL
57+
https://mirrors.kernel.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
4958
https://ftpmirror.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
5059
https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz)
5160

@@ -61,12 +70,14 @@ set(EXPAT_URL https://github.com/libexpat/libexpat/releases/download/R_2_3_0/exp
6170
set(BINUTILS_VERSION 2.46.1)
6271
set(BINUTILS_HASH SHA256=e127a709cba24c76de8936cb7083dd768f28cd37eb010492e2f19b71eb1294e4)
6372
set(BINUTILS_URL
73+
https://mirrors.kernel.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.xz
6474
https://ftpmirror.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.xz
6575
https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.xz)
6676

6777
set(GDB_VERSION 15.2)
6878
set(GDB_HASH SHA256=83350ccd35b5b5a0cba6b334c41294ea968158c573940904f00b92f76345314d)
6979
set(GDB_URL
80+
https://mirrors.kernel.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz
7081
https://ftpmirror.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz
7182
https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz)
7283

tests/cmake/gnu-download-mirror.cmake

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@ include("${repository_root}/cmake/Components.cmake")
1616
foreach(component GCC GMP MPFR MPC BINUTILS GDB)
1717
set(urls "${${component}_URL}")
1818
list(LENGTH urls count)
19-
if(count LESS 2)
19+
if(count LESS 3)
2020
message(SEND_ERROR
21-
"FAIL: ${component}_URL names one host; an outage there is a failed build")
21+
"FAIL: ${component}_URL names ${count} host(s); two outages in a row is a "
22+
"failed build, and both happened on 27 August")
2223
endif()
24+
# ftp.gnu.org is the one that went down, so it is the last resort and not
25+
# the first thing tried.
2326
list(GET urls 0 first)
24-
if(NOT first MATCHES "^https://ftpmirror\\.gnu\\.org/")
27+
if(first MATCHES "^https://ftp\\.gnu\\.org/")
2528
message(SEND_ERROR
26-
"FAIL: ${component}_URL does not try GNU's mirror redirector first: ${first}")
29+
"FAIL: ${component}_URL tries ftp.gnu.org first")
30+
endif()
31+
list(GET urls -1 last)
32+
if(NOT last MATCHES "^https://ftp\\.gnu\\.org/")
33+
message(SEND_ERROR
34+
"FAIL: ${component}_URL does not keep ftp.gnu.org as the last resort: ${last}")
2735
endif()
2836
# And the hash, without which a mirror is somebody else's word for it.
2937
if(NOT DEFINED ${component}_HASH)

0 commit comments

Comments
 (0)