@@ -160,11 +160,8 @@ class RustBuild(object):
160160 def download_stage0 (self ):
161161 cache_dst = os .path .join (self .build_dir , "cache" )
162162 rustc_cache = os .path .join (cache_dst , self .stage0_rustc_date ())
163- cargo_cache = os .path .join (cache_dst , self .stage0_cargo_rev ())
164163 if not os .path .exists (rustc_cache ):
165164 os .makedirs (rustc_cache )
166- if not os .path .exists (cargo_cache ):
167- os .makedirs (cargo_cache )
168165
169166 if self .rustc ().startswith (self .bin_root ()) and \
170167 (not os .path .exists (self .rustc ()) or self .rustc_out_of_date ()):
@@ -195,15 +192,15 @@ def download_stage0(self):
195192 if self .cargo ().startswith (self .bin_root ()) and \
196193 (not os .path .exists (self .cargo ()) or self .cargo_out_of_date ()):
197194 self .print_what_it_means_to_bootstrap ()
198- filename = "cargo-nightly -{}.tar.gz" .format (self .build )
199- url = "https://s3.amazonaws.com/ rust-lang-ci/cargo-builds /" + self .stage0_cargo_rev ()
200- tarball = os .path .join (cargo_cache , filename )
195+ filename = "cargo-{} -{}.tar.gz" .format (channel , self .build )
196+ url = "https://static. rust-lang.org/dist /" + self .stage0_rustc_date ()
197+ tarball = os .path .join (rustc_cache , filename )
201198 if not os .path .exists (tarball ):
202199 get ("{}/{}" .format (url , filename ), tarball , verbose = self .verbose )
203200 unpack (tarball , self .bin_root (), match = "cargo" , verbose = self .verbose )
204201 self .fix_executable (self .bin_root () + "/bin/cargo" )
205202 with open (self .cargo_stamp (), 'w' ) as f :
206- f .write (self .stage0_cargo_rev ())
203+ f .write (self .stage0_rustc_date ())
207204
208205 def fix_executable (self , fname ):
209206 # If we're on NixOS we need to change the path to the dynamic loader
@@ -258,9 +255,6 @@ def fix_executable(self, fname):
258255 print ("warning: failed to call patchelf: %s" % e )
259256 return
260257
261- def stage0_cargo_rev (self ):
262- return self ._cargo_rev
263-
264258 def stage0_rustc_date (self ):
265259 return self ._rustc_date
266260
@@ -283,7 +277,7 @@ def cargo_out_of_date(self):
283277 if not os .path .exists (self .cargo_stamp ()) or self .clean :
284278 return True
285279 with open (self .cargo_stamp (), 'r' ) as f :
286- return self .stage0_cargo_rev () != f .read ()
280+ return self .stage0_rustc_date () != f .read ()
287281
288282 def bin_root (self ):
289283 return os .path .join (self .build_dir , self .build , "stage0" )
@@ -578,7 +572,6 @@ def bootstrap():
578572
579573 data = stage0_data (rb .rust_root )
580574 rb ._rustc_channel , rb ._rustc_date = data ['rustc' ].split ('-' , 1 )
581- rb ._cargo_rev = data ['cargo' ]
582575
583576 # Fetch/build the bootstrap
584577 rb .build = rb .build_triple ()
0 commit comments