auto merge of #3894 : awestroke/servo/feauture-warn-32bit-bootstrap, r=jdm

Also hints that 32bit snapshots are unavailable on failure

Resolves #3739 

![screenshot from 2014-11-05 13 42 39](https://cloud.githubusercontent.com/assets/1098408/4917781/6edc0dd2-64e9-11e4-98bd-dbd1829ee913.png)
This commit is contained in:
bors-servo 2014-11-05 15:42:51 -07:00
commit 10072c73fd

View file

@ -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()