@@ -395,7 +395,8 @@ top_level_options!(
395
395
output_types: OutputTypes [ TRACKED ] ,
396
396
search_paths: Vec <SearchPath > [ UNTRACKED ] ,
397
397
libs: Vec <( String , Option <String >, Option <cstore:: NativeLibraryKind >) > [ TRACKED ] ,
398
- maybe_sysroot: Option <PathBuf > [ TRACKED ] ,
398
+ maybe_sysroot: Option <PathBuf > [ UNTRACKED ] ,
399
+ maybe_sysroot_remapped: Option <PathBuf > [ TRACKED ] ,
399
400
400
401
target_triple: TargetTriple [ TRACKED ] ,
401
402
@@ -610,6 +611,7 @@ impl Default for Options {
610
611
output_types : OutputTypes ( BTreeMap :: new ( ) ) ,
611
612
search_paths : vec ! [ ] ,
612
613
maybe_sysroot : None ,
614
+ maybe_sysroot_remapped : None ,
613
615
target_triple : TargetTriple :: from_triple ( host_triple ( ) ) ,
614
616
test : false ,
615
617
incremental : None ,
@@ -2453,7 +2455,7 @@ pub fn build_session_options_and_crate_config(
2453
2455
2454
2456
let crate_name = matches. opt_str ( "crate-name" ) ;
2455
2457
2456
- let remap_path_prefix = matches
2458
+ let remap_path_prefix: Vec < ( PathBuf , PathBuf ) > = matches
2457
2459
. opt_strs ( "remap-path-prefix" )
2458
2460
. into_iter ( )
2459
2461
. map ( |remap| {
@@ -2470,6 +2472,10 @@ pub fn build_session_options_and_crate_config(
2470
2472
} )
2471
2473
. collect ( ) ;
2472
2474
2475
+ let sysroot_remapped_opt = sysroot_opt
2476
+ . clone ( )
2477
+ . map ( |sysroot| FilePathMapping :: new ( remap_path_prefix. clone ( ) ) . map_prefix ( sysroot) . 0 ) ;
2478
+
2473
2479
(
2474
2480
Options {
2475
2481
crate_types,
@@ -2481,6 +2487,7 @@ pub fn build_session_options_and_crate_config(
2481
2487
output_types : OutputTypes ( output_types) ,
2482
2488
search_paths,
2483
2489
maybe_sysroot : sysroot_opt,
2490
+ maybe_sysroot_remapped : sysroot_remapped_opt,
2484
2491
target_triple,
2485
2492
test,
2486
2493
incremental,
0 commit comments