Upgrade to rustc 1.6.0-nightly (d5fde83ae 2015-11-12)

… and libc 0.2 and many other dependencies
This commit is contained in:
Manish Goregaokar 2015-11-07 22:40:18 +05:30 committed by Josh Matthews
parent bc618b0d53
commit dc0e467945
59 changed files with 1092 additions and 978 deletions

View file

@ -117,7 +117,7 @@ class MachCommands(CommandBase):
help='Force download even if a snapshot already exists')
def bootstrap_rustc(self, force=False):
rust_dir = path.join(
self.context.sharedir, "rust", *self.rust_snapshot_path().split("/"))
self.context.sharedir, "rust", self.rust_snapshot_path())
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc")):
print("Snapshot Rust compiler already downloaded.", end=" ")
print("Use |bootstrap-rust --force| to download again.")
@ -127,16 +127,43 @@ class MachCommands(CommandBase):
shutil.rmtree(rust_dir)
os.makedirs(rust_dir)
snapshot_url = ("https://servo-rust.s3.amazonaws.com/%s.tar.gz"
date = self.rust_snapshot_path().split("/")[0]
install_dir = path.join(self.context.sharedir, "rust", date)
# The Rust compiler is hosted on the nightly server under the date with a name
# rustc-nightly-HOST-TRIPLE.tar.gz. We just need to pull down and extract it,
# giving a directory name that will be the same as the tarball name (rustc is
# in that directory).
snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s.tar.gz"
% self.rust_snapshot_path())
tgz_file = rust_dir + '.tar.gz'
tgz_file = rust_dir + '-rustc.tar.gz'
download_file("Rust snapshot", snapshot_url, tgz_file)
download_file("Rust compiler", snapshot_url, tgz_file)
print("Extracting Rust compiler...")
extract(tgz_file, install_dir)
# Each Rust stdlib has a name of the form `rust-std-nightly-TRIPLE.tar.gz`, with
# a directory of the name `rust-std-TRIPLE` inside and then a `lib` directory.
# This `lib` directory needs to be extracted and merged with the `rustc/lib`
# directory from the host compiler above.
# TODO: make it possible to request an additional cross-target to add to this
# list.
stdlibs = [host_triple(), "arm-linux-androideabi"]
for target in stdlibs:
snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/%s/rust-std-nightly-%s.tar.gz"
% (date, target))
tgz_file = install_dir + ('rust-std-nightly-%s.tar.gz' % target)
download_file("Host rust library for target %s" % target, snapshot_url, tgz_file)
print("Extracting Rust stdlib for target %s..." % target)
extract(tgz_file, install_dir)
shutil.copytree(path.join(install_dir, "rust-std-nightly-%s" % target,
"rust-std-%s" % target, "lib", "rustlib", target),
path.join(install_dir, "rustc-nightly-%s" % host_triple(),
"rustc", "lib", "rustlib", target))
shutil.rmtree(path.join(install_dir, "rust-std-nightly-%s" % target))
print("Extracting Rust snapshot...")
snap_dir = path.join(rust_dir,
path.basename(tgz_file).replace(".tar.gz", ""))
extract(tgz_file, rust_dir, movedir=snap_dir)
print("Snapshot Rust ready.")
@Command('bootstrap-rust-docs',
@ -149,7 +176,7 @@ class MachCommands(CommandBase):
self.ensure_bootstrapped()
hash_dir = path.join(self.context.sharedir, "rust",
self.rust_snapshot_path().split("/")[0])
docs_dir = path.join(hash_dir, self.rust_snapshot_path().split("/")[1], "doc")
docs_dir = path.join(hash_dir, "doc")
if not force and path.exists(docs_dir):
print("Snapshot Rust docs already downloaded.", end=" ")
print("Use |bootstrap-rust-docs --force| to download again.")
@ -158,8 +185,8 @@ class MachCommands(CommandBase):
if path.isdir(docs_dir):
shutil.rmtree(docs_dir)
docs_name = self.rust_snapshot_path().replace("rustc-", "rust-docs-")
snapshot_url = ("https://servo-rust.s3.amazonaws.com/%s.tar.gz"
% docs_name)
snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/rust-docs-nightly-%s.tar.gz"
% host_triple())
tgz_file = path.join(hash_dir, 'doc.tar.gz')
download_file("Rust docs", snapshot_url, tgz_file)

View file

@ -97,7 +97,7 @@ class CommandBase(object):
self.config["tools"].setdefault("cargo-root", "")
if not self.config["tools"]["system-rust"]:
self.config["tools"]["rust-root"] = path.join(
context.sharedir, "rust", *self.rust_snapshot_path().split("/"))
context.sharedir, "rust", self.rust_snapshot_path())
if not self.config["tools"]["system-cargo"]:
self.config["tools"]["cargo-root"] = path.join(
context.sharedir, "cargo", self.cargo_build_id())
@ -127,7 +127,8 @@ class CommandBase(object):
filename = path.join(self.context.topdir, "rust-snapshot-hash")
with open(filename) as f:
snapshot_hash = f.read().strip()
self._rust_snapshot_path = "%s-%s" % (snapshot_hash, host_triple())
self._rust_snapshot_path = ("%s/rustc-nightly-%s" %
(snapshot_hash, host_triple()))
return self._rust_snapshot_path
def cargo_build_id(self):
@ -337,6 +338,8 @@ class CommandBase(object):
if not self.config["tools"]["system-rust"] and \
not path.exists(path.join(
self.config["tools"]["rust-root"], "rustc", "bin", "rustc")):
print("looking for rustc at %s" % path.join(
self.config["tools"]["rust-root"], "rustc", "bin", "rustc"))
Registrar.dispatch("bootstrap-rust", context=self.context)
if not self.config["tools"]["system-cargo"] and \
not path.exists(path.join(

View file

@ -164,7 +164,7 @@ def check_lock(file_name, contents):
packages = {}
# package names to be neglected (as named by cargo)
exceptions = []
exceptions = ["libc"]
while idx < len(contents):
content = contents[idx].strip()