@@ -160,11 +160,8 @@ class RustBuild(object):
160
160
def download_stage0 (self ):
161
161
cache_dst = os .path .join (self .build_dir , "cache" )
162
162
rustc_cache = os .path .join (cache_dst , self .stage0_rustc_date ())
163
- cargo_cache = os .path .join (cache_dst , self .stage0_cargo_rev ())
164
163
if not os .path .exists (rustc_cache ):
165
164
os .makedirs (rustc_cache )
166
- if not os .path .exists (cargo_cache ):
167
- os .makedirs (cargo_cache )
168
165
169
166
if self .rustc ().startswith (self .bin_root ()) and \
170
167
(not os .path .exists (self .rustc ()) or self .rustc_out_of_date ()):
@@ -195,15 +192,15 @@ def download_stage0(self):
195
192
if self .cargo ().startswith (self .bin_root ()) and \
196
193
(not os .path .exists (self .cargo ()) or self .cargo_out_of_date ()):
197
194
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 )
201
198
if not os .path .exists (tarball ):
202
199
get ("{}/{}" .format (url , filename ), tarball , verbose = self .verbose )
203
200
unpack (tarball , self .bin_root (), match = "cargo" , verbose = self .verbose )
204
201
self .fix_executable (self .bin_root () + "/bin/cargo" )
205
202
with open (self .cargo_stamp (), 'w' ) as f :
206
- f .write (self .stage0_cargo_rev ())
203
+ f .write (self .stage0_rustc_date ())
207
204
208
205
def fix_executable (self , fname ):
209
206
# If we're on NixOS we need to change the path to the dynamic loader
@@ -258,9 +255,6 @@ def fix_executable(self, fname):
258
255
print ("warning: failed to call patchelf: %s" % e )
259
256
return
260
257
261
- def stage0_cargo_rev (self ):
262
- return self ._cargo_rev
263
-
264
258
def stage0_rustc_date (self ):
265
259
return self ._rustc_date
266
260
@@ -283,7 +277,7 @@ def cargo_out_of_date(self):
283
277
if not os .path .exists (self .cargo_stamp ()) or self .clean :
284
278
return True
285
279
with open (self .cargo_stamp (), 'r' ) as f :
286
- return self .stage0_cargo_rev () != f .read ()
280
+ return self .stage0_rustc_date () != f .read ()
287
281
288
282
def bin_root (self ):
289
283
return os .path .join (self .build_dir , self .build , "stage0" )
@@ -578,7 +572,6 @@ def bootstrap():
578
572
579
573
data = stage0_data (rb .rust_root )
580
574
rb ._rustc_channel , rb ._rustc_date = data ['rustc' ].split ('-' , 1 )
581
- rb ._cargo_rev = data ['cargo' ]
582
575
583
576
# Fetch/build the bootstrap
584
577
rb .build = rb .build_triple ()
0 commit comments