@@ -444,9 +444,8 @@ def __init__(self):
444444 self.verbose = False
445445 self.git_version = None
446446 self.nix_deps_dir = None
447- self.rustc_commit = None
448447
449- def download_toolchain(self, rustc_channel=None ):
448+ def download_toolchain(self):
450449 """Fetch the build system for Rust, written in Rust
451450
452451 This method will build a cache directory, then it will fetch the
@@ -456,8 +455,7 @@ def download_toolchain(self, rustc_channel=None):
456455 Each downloaded tarball is extracted, after that, the script
457456 will move all the content to the right place.
458457 """
459- if rustc_channel is None:
460- rustc_channel = self.stage0_compiler.version
458+ rustc_channel = self.stage0_compiler.version
461459 bin_root = self.bin_root()
462460
463461 key = self.stage0_compiler.date
@@ -628,51 +626,6 @@ def fix_bin_or_dylib(self, fname):
628626 print("warning: failed to call patchelf:", reason)
629627 return
630628
631- # If `download-rustc` is set, download the most recent commit with CI artifacts
632- def maybe_download_ci_toolchain(self):
633- # If `download-rustc` is not set, default to rebuilding.
634- download_rustc = self.get_toml("download-rustc", section="rust")
635- if download_rustc is None or download_rustc == "false":
636- return None
637- assert download_rustc == "true" or download_rustc == "if-unchanged", download_rustc
638-
639- # Handle running from a directory other than the top level
640- rev_parse = ["git", "rev-parse", "--show-toplevel"]
641- top_level = subprocess.check_output(rev_parse, universal_newlines=True).strip()
642- compiler = "{}/compiler/".format(top_level)
643- library = "{}/library/".format(top_level)
644-
645- # Look for a version to compare to based on the current commit.
646- # Only commits merged by bors will have CI artifacts.
647- merge_base = [
648- "git", "rev-list", "--author=bors@rust-lang.org", "-n1",
649- "--first-parent", "HEAD"
650- ]
651- commit = subprocess.check_output(merge_base, universal_newlines=True).strip()
652- if not commit:
653- print("error: could not find commit hash for downloading rustc")
654- print("help: maybe your repository history is too shallow?")
655- print("help: consider disabling `download-rustc`")
656- print("help: or fetch enough history to include one upstream commit")
657- exit(1)
658-
659- # Warn if there were changes to the compiler or standard library since the ancestor commit.
660- status = subprocess.call(["git", "diff-index", "--quiet", commit, "--", compiler, library])
661- if status != 0:
662- if download_rustc == "if-unchanged":
663- if self.verbose:
664- print("warning: saw changes to compiler/ or library/ since {}; " \
665- "ignoring `download-rustc`".format(commit))
666- return None
667- print("warning: `download-rustc` is enabled, but there are changes to " \
668- "compiler/ or library/")
669-
670- if self.verbose:
671- print("using downloaded stage2 artifacts from CI (commit {})".format(commit))
672- self.rustc_commit = commit
673- # FIXME: support downloading artifacts from the beta channel
674- self.download_toolchain(False, "nightly")
675-
676629 def rustc_stamp(self):
677630 """Return the path for .rustc-stamp at the given stage
678631
@@ -1144,8 +1097,6 @@ def bootstrap(help_triggered):
11441097
11451098 # Fetch/build the bootstrap
11461099 build.download_toolchain()
1147- # Download the master compiler if `download-rustc` is set
1148- # build.maybe_download_ci_toolchain()
11491100 sys.stdout.flush()
11501101 build.ensure_vendored()
11511102 build.build_bootstrap()
@@ -1157,8 +1108,6 @@ def bootstrap(help_triggered):
11571108 env = os.environ.copy()
11581109 env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
11591110 env["BOOTSTRAP_PYTHON"] = sys.executable
1160- if build.rustc_commit is not None:
1161- env["BOOTSTRAP_DOWNLOAD_RUSTC"] = '1'
11621111 run(args, env=env, verbose=build.verbose, is_bootstrap=True)
11631112
11641113
0 commit comments