@@ -444,9 +444,8 @@ def __init__(self):
444
444
self .verbose = False
445
445
self .git_version = None
446
446
self .nix_deps_dir = None
447
- self .rustc_commit = None
448
447
449
- def download_toolchain (self , rustc_channel = None ):
448
+ def download_toolchain (self ):
450
449
"""Fetch the build system for Rust, written in Rust
451
450
452
451
This method will build a cache directory, then it will fetch the
@@ -456,8 +455,7 @@ def download_toolchain(self, rustc_channel=None):
456
455
Each downloaded tarball is extracted, after that, the script
457
456
will move all the content to the right place.
458
457
"""
459
- if rustc_channel is None :
460
- rustc_channel = self .stage0_compiler .version
458
+ rustc_channel = self .stage0_compiler .version
461
459
bin_root = self .bin_root ()
462
460
463
461
key = self .stage0_compiler .date
@@ -628,51 +626,6 @@ def fix_bin_or_dylib(self, fname):
628
626
print ("warning: failed to call patchelf:" , reason )
629
627
return
630
628
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" ,
"[email protected] " ,
"-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
-
676
629
def rustc_stamp (self ):
677
630
"""Return the path for .rustc-stamp at the given stage
678
631
@@ -1144,8 +1097,6 @@ def bootstrap(help_triggered):
1144
1097
1145
1098
# Fetch/build the bootstrap
1146
1099
build .download_toolchain ()
1147
- # Download the master compiler if `download-rustc` is set
1148
- # build.maybe_download_ci_toolchain()
1149
1100
sys .stdout .flush ()
1150
1101
build .ensure_vendored ()
1151
1102
build .build_bootstrap ()
@@ -1157,8 +1108,6 @@ def bootstrap(help_triggered):
1157
1108
env = os .environ .copy ()
1158
1109
env ["BOOTSTRAP_PARENT_ID" ] = str (os .getpid ())
1159
1110
env ["BOOTSTRAP_PYTHON" ] = sys .executable
1160
- if build .rustc_commit is not None :
1161
- env ["BOOTSTRAP_DOWNLOAD_RUSTC" ] = '1'
1162
1111
run (args , env = env , verbose = build .verbose , is_bootstrap = True )
1163
1112
1164
1113
0 commit comments