1
1
use anyhow:: { anyhow, Context } ;
2
- use chrono:: { DateTime , TimeZone , Utc } ;
2
+ use chrono:: { DateTime , Utc } ;
3
3
use collector:: Sha ;
4
4
use std:: ffi:: OsStr ;
5
5
use std:: fmt;
@@ -30,8 +30,6 @@ impl Sysroot {
30
30
date,
31
31
} ;
32
32
let unpack_into = "cache" ;
33
- // Versions of rustc older than Mar 20 have bugs in their cargo.
34
- let download_cargo = commit. date >= Utc . ymd ( 2017 , 3 , 20 ) . and_hms ( 0 , 0 , 0 ) ;
35
33
36
34
fs:: create_dir_all ( & unpack_into) ?;
37
35
@@ -43,11 +41,9 @@ impl Sysroot {
43
41
44
42
download. get_and_extract ( ModuleVariant :: Rustc ) ?;
45
43
download. get_and_extract ( ModuleVariant :: Std ) ?;
46
- if download_cargo {
47
- download. get_and_extract ( ModuleVariant :: Cargo ) ?;
48
- }
44
+ download. get_and_extract ( ModuleVariant :: Cargo ) ?;
49
45
50
- download. into_sysroot ( download_cargo )
46
+ download. into_sysroot ( )
51
47
}
52
48
}
53
49
@@ -100,7 +96,7 @@ impl ModuleVariant {
100
96
}
101
97
102
98
impl SysrootDownload {
103
- fn into_sysroot ( self , download_cargo : bool ) -> anyhow:: Result < Sysroot > {
99
+ fn into_sysroot ( self ) -> anyhow:: Result < Sysroot > {
104
100
Ok ( Sysroot {
105
101
rustc : self
106
102
. directory
@@ -118,10 +114,7 @@ impl SysrootDownload {
118
114
. with_context ( || {
119
115
format ! ( "failed to canonicalize rustdoc path for {}" , self . rust_sha)
120
116
} ) ?,
121
- cargo : if !download_cargo {
122
- // go with cargo present in environment if we need to fallback
123
- PathBuf :: from ( "cargo" )
124
- } else {
117
+ cargo : {
125
118
let path = self . directory . join ( & self . rust_sha ) . join ( "cargo/bin/cargo" ) ;
126
119
path. canonicalize ( ) . with_context ( || {
127
120
format ! (
0 commit comments