@@ -78,6 +78,7 @@ pub(crate) fn main() {
78
78
let mut channel = "release" ;
79
79
let mut sysroot_kind = SysrootKind :: Clif ;
80
80
let mut use_unstable_features = true ;
81
+ let mut frozen = false ;
81
82
while let Some ( arg) = args. next ( ) . as_deref ( ) {
82
83
match arg {
83
84
"--out-dir" => {
@@ -96,17 +97,38 @@ pub(crate) fn main() {
96
97
}
97
98
}
98
99
"--no-unstable-features" => use_unstable_features = false ,
100
+ "--frozen" => frozen = true ,
99
101
flag if flag. starts_with ( "-" ) => arg_error ! ( "Unknown flag {}" , flag) ,
100
102
arg => arg_error ! ( "Unexpected argument {}" , arg) ,
101
103
}
102
104
}
103
105
104
- let bootstrap_host_compiler = Compiler :: bootstrap_with_triple (
105
- std:: env:: var ( "HOST_TRIPLE" )
106
+ let rustup_toolchain_name = match ( env:: var ( "CARGO" ) , env:: var ( "RUSTC" ) , env:: var ( "RUSTDOC" ) ) {
107
+ ( Ok ( _) , Ok ( _) , Ok ( _) ) => None ,
108
+ ( Err ( _) , Err ( _) , Err ( _) ) => Some ( rustc_info:: get_toolchain_name ( ) ) ,
109
+ _ => {
110
+ eprintln ! ( "All of CARGO, RUSTC and RUSTDOC need to be set or none must be set" ) ;
111
+ process:: exit ( 1 ) ;
112
+ }
113
+ } ;
114
+ let bootstrap_host_compiler = {
115
+ let cargo = rustc_info:: get_cargo_path ( ) ;
116
+ let rustc = rustc_info:: get_rustc_path ( ) ;
117
+ let rustdoc = rustc_info:: get_rustdoc_path ( ) ;
118
+ let triple = std:: env:: var ( "HOST_TRIPLE" )
106
119
. ok ( )
107
120
. or_else ( || config:: get_value ( "host" ) )
108
- . unwrap_or_else ( || rustc_info:: get_host_triple ( ) ) ,
109
- ) ;
121
+ . unwrap_or_else ( || rustc_info:: get_host_triple ( & rustc) ) ;
122
+ Compiler {
123
+ cargo,
124
+ rustc,
125
+ rustdoc,
126
+ rustflags : String :: new ( ) ,
127
+ rustdocflags : String :: new ( ) ,
128
+ triple,
129
+ runner : vec ! [ ] ,
130
+ }
131
+ } ;
110
132
let target_triple = std:: env:: var ( "TARGET_TRIPLE" )
111
133
. ok ( )
112
134
. or_else ( || config:: get_value ( "target" ) )
@@ -120,6 +142,7 @@ pub(crate) fn main() {
120
142
download_dir : out_dir. join ( "download" ) ,
121
143
build_dir : out_dir. join ( "build" ) ,
122
144
dist_dir : out_dir. join ( "dist" ) ,
145
+ frozen,
123
146
} ;
124
147
125
148
path:: RelPath :: BUILD . ensure_exists ( & dirs) ;
@@ -134,7 +157,7 @@ pub(crate) fn main() {
134
157
}
135
158
136
159
if command == Command :: Prepare {
137
- prepare:: prepare ( & dirs) ;
160
+ prepare:: prepare ( & dirs, & bootstrap_host_compiler . rustc ) ;
138
161
process:: exit ( 0 ) ;
139
162
}
140
163
@@ -158,6 +181,7 @@ pub(crate) fn main() {
158
181
sysroot_kind,
159
182
& cg_clif_dylib,
160
183
& bootstrap_host_compiler,
184
+ rustup_toolchain_name. as_deref ( ) ,
161
185
target_triple. clone ( ) ,
162
186
) ;
163
187
}
@@ -166,7 +190,14 @@ pub(crate) fn main() {
166
190
eprintln ! ( "Abi-cafe doesn't support cross-compilation" ) ;
167
191
process:: exit ( 1 ) ;
168
192
}
169
- abi_cafe:: run ( channel, sysroot_kind, & dirs, & cg_clif_dylib, & bootstrap_host_compiler) ;
193
+ abi_cafe:: run (
194
+ channel,
195
+ sysroot_kind,
196
+ & dirs,
197
+ & cg_clif_dylib,
198
+ rustup_toolchain_name. as_deref ( ) ,
199
+ & bootstrap_host_compiler,
200
+ ) ;
170
201
}
171
202
Command :: Build => {
172
203
build_sysroot:: build_sysroot (
@@ -175,6 +206,7 @@ pub(crate) fn main() {
175
206
sysroot_kind,
176
207
& cg_clif_dylib,
177
208
& bootstrap_host_compiler,
209
+ rustup_toolchain_name. as_deref ( ) ,
178
210
target_triple,
179
211
) ;
180
212
}
@@ -185,9 +217,10 @@ pub(crate) fn main() {
185
217
sysroot_kind,
186
218
& cg_clif_dylib,
187
219
& bootstrap_host_compiler,
220
+ rustup_toolchain_name. as_deref ( ) ,
188
221
target_triple,
189
222
) ;
190
- bench:: benchmark ( & dirs) ;
223
+ bench:: benchmark ( & dirs, & bootstrap_host_compiler ) ;
191
224
}
192
225
}
193
226
}
0 commit comments