@@ -315,33 +315,20 @@ impl Build {
315
315
let in_tree_llvm_info = config. in_tree_llvm_info . clone ( ) ;
316
316
let in_tree_gcc_info = config. in_tree_gcc_info . clone ( ) ;
317
317
318
- let initial_target_libdir_str = if config. dry_run ( ) {
319
- "/dummy/lib/path/to/lib/" . to_string ( )
320
- } else {
321
- output (
322
- Command :: new ( & config. initial_rustc )
323
- . arg ( "--target" )
324
- . arg ( config. build . rustc_target_arg ( ) )
325
- . arg ( "--print" )
326
- . arg ( "target-libdir" ) ,
327
- )
328
- } ;
318
+ let initial_target_libdir_str =
319
+ config. initial_sysroot . join ( "lib/rustlib" ) . join ( config. build ) . join ( "lib" ) ;
320
+
329
321
let initial_target_dir = Path :: new ( & initial_target_libdir_str) . parent ( ) . unwrap ( ) ;
330
322
let initial_lld = initial_target_dir. join ( "bin" ) . join ( "rust-lld" ) ;
331
323
332
- let initial_sysroot = if config. dry_run ( ) {
333
- "/dummy" . to_string ( )
334
- } else {
335
- output ( Command :: new ( & config. initial_rustc ) . arg ( "--print" ) . arg ( "sysroot" ) )
336
- }
337
- . trim ( )
338
- . to_string ( ) ;
339
-
340
324
// FIXME(Zalathar): Determining this path occasionally fails locally for
341
325
// unknown reasons, so we print some extra context to help track down why.
342
326
let find_initial_libdir = || {
343
- let initial_libdir =
344
- initial_target_dir. parent ( ) ?. parent ( ) ?. strip_prefix ( & initial_sysroot) . ok ( ) ?;
327
+ let initial_libdir = initial_target_dir
328
+ . parent ( ) ?
329
+ . parent ( ) ?
330
+ . strip_prefix ( & config. initial_sysroot )
331
+ . ok ( ) ?;
345
332
Some ( initial_libdir. to_path_buf ( ) )
346
333
} ;
347
334
let Some ( initial_libdir) = find_initial_libdir ( ) else {
@@ -350,7 +337,6 @@ impl Build {
350
337
- config.initial_rustc: {rustc:?}
351
338
- initial_target_libdir_str: {initial_target_libdir_str:?}
352
339
- initial_target_dir: {initial_target_dir:?}
353
- - initial_sysroot: {initial_sysroot:?}
354
340
" ,
355
341
rustc = config. initial_rustc,
356
342
) ;
@@ -383,11 +369,11 @@ impl Build {
383
369
}
384
370
385
371
let mut build = Build {
386
- initial_rustc : config. initial_rustc . clone ( ) ,
387
- initial_cargo : config. initial_cargo . clone ( ) ,
388
372
initial_lld,
389
373
initial_libdir,
390
- initial_sysroot : initial_sysroot. into ( ) ,
374
+ initial_rustc : config. initial_rustc . clone ( ) ,
375
+ initial_cargo : config. initial_cargo . clone ( ) ,
376
+ initial_sysroot : config. initial_sysroot . clone ( ) ,
391
377
local_rebuild : config. local_rebuild ,
392
378
fail_fast : config. cmd . fail_fast ( ) ,
393
379
doc_tests : config. cmd . doc_tests ( ) ,
0 commit comments