mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
Fix "looking for rustc at …" message for stable when already bootstrapped
Also always download from static-rust-lang-org.s3.amazonaws.com instead of static.rust-lang.org. They host the same content, but the latter goes through a CDN and has a TLS certificate that failed to verify and some Python versions: https://github.com/servo/servo/issues/3582 https://github.com/servo/servo/pull/3971
This commit is contained in:
parent
a39170728d
commit
6ae5598a5c
2 changed files with 7 additions and 10 deletions
|
@ -138,12 +138,7 @@ class MachCommands(CommandBase):
|
||||||
self.set_use_stable_rust(stable)
|
self.set_use_stable_rust(stable)
|
||||||
version = self.rust_version()
|
version = self.rust_version()
|
||||||
rust_path = self.rust_path()
|
rust_path = self.rust_path()
|
||||||
if stable:
|
rust_dir = path.join(self.context.sharedir, "rust", rust_path)
|
||||||
rust_dir = path.join(
|
|
||||||
self.context.sharedir, "rust", version, rust_path)
|
|
||||||
else:
|
|
||||||
rust_dir = path.join(
|
|
||||||
self.context.sharedir, "rust", rust_path)
|
|
||||||
install_dir = path.join(self.context.sharedir, "rust", version)
|
install_dir = path.join(self.context.sharedir, "rust", version)
|
||||||
|
|
||||||
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)):
|
if not force and path.exists(path.join(rust_dir, "rustc", "bin", "rustc" + BIN_SUFFIX)):
|
||||||
|
@ -160,9 +155,10 @@ class MachCommands(CommandBase):
|
||||||
# giving a directory name that will be the same as the tarball name (rustc is
|
# giving a directory name that will be the same as the tarball name (rustc is
|
||||||
# in that directory).
|
# in that directory).
|
||||||
if stable:
|
if stable:
|
||||||
rustc_url = "https://static.rust-lang.org/dist/%s.tar.gz" % rust_path
|
tarball = "rustc-%s-%s.tar.gz" % (version, host_triple())
|
||||||
else:
|
else:
|
||||||
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/%s.tar.gz" % rust_path
|
tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple())
|
||||||
|
rustc_url = "https://static-rust-lang-org.s3.amazonaws.com/dist/" + tarball
|
||||||
tgz_file = rust_dir + '-rustc.tar.gz'
|
tgz_file = rust_dir + '-rustc.tar.gz'
|
||||||
|
|
||||||
download_file("Rust compiler", rustc_url, tgz_file)
|
download_file("Rust compiler", rustc_url, tgz_file)
|
||||||
|
|
|
@ -218,10 +218,11 @@ class CommandBase(object):
|
||||||
return self._use_stable_rust
|
return self._use_stable_rust
|
||||||
|
|
||||||
def rust_path(self):
|
def rust_path(self):
|
||||||
|
version = self.rust_version()
|
||||||
if self._use_stable_rust:
|
if self._use_stable_rust:
|
||||||
return "rustc-%s-%s" % (self.rust_version(), host_triple())
|
return "%s/rustc-%s-%s" % (version, version, host_triple())
|
||||||
else:
|
else:
|
||||||
return "%s/rustc-nightly-%s" % (self.rust_version(), host_triple())
|
return "%s/rustc-nightly-%s" % (version, host_triple())
|
||||||
|
|
||||||
def rust_version(self):
|
def rust_version(self):
|
||||||
if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable:
|
if self._rust_version is None or self._use_stable_rust != self._rust_version_is_stable:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue