diff options
author | Orvar Segerström <orvarsegerstrom@gmail.com> | 2014-11-05 13:37:12 +0100 |
---|---|---|
committer | Orvar Segerström <orvarsegerstrom@gmail.com> | 2014-11-05 22:31:57 +0100 |
commit | 1641568b057d93cee5cfb693e4c20ac7a0ea6d60 (patch) | |
tree | 46ced93a2a45098b1aaab097d93a2c6a9f35f152 /python/servo/bootstrap_commands.py | |
parent | ffae1104989c0177b483d591a482e5cd877183c2 (diff) | |
download | servo-1641568b057d93cee5cfb693e4c20ac7a0ea6d60.tar.gz servo-1641568b057d93cee5cfb693e4c20ac7a0ea6d60.zip |
Panic when bootstrap downloads fail
Also hints that 32bit snapshots are unavailable on failure
Resolves #3739
fixup! Panic when bootstrap downloads fail
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r-- | python/servo/bootstrap_commands.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 536e6234497..b92198aae3c 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -16,6 +16,17 @@ from mach.decorators import ( from servo.command_base import CommandBase, cd, host_triple +class PanickyUrlOpener(urllib.FancyURLopener): + def http_error_default(self, url, fp, errcode, errmsg, headers): + print("Download failed (%d): %s - %s" % (errcode, errmsg, url)) + + cpu_type = subprocess.check_output(["uname", "-m"]).strip().lower() + if errcode == 404 and cpu_type in ["i386", "i486", "i686", "i768", "x86"]: + # i686 + print("Note: Servo does not currently bootstrap 32bit snapshots of Rust") + print("See https://github.com/servo/servo/issues/3899") + + sys.exit(1) def download(desc, src, dst): recved = [0] @@ -28,7 +39,7 @@ def download(desc, src, dst): print("Downloading %s..." % desc) dumb = os.environ.get("TERM") == "dumb" - urllib.urlretrieve(src, dst, None if dumb else report) + PanickyUrlOpener().retrieve(src, dst, None if dumb else report) if not dumb: print() |