File tree 2 files changed +16
-7
lines changed
2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ impl TreeResolver {
150
150
// host triple instead of the host triple detected by rustc.
151
151
. env ( "RUSTC_WRAPPER" , rustc_wrapper)
152
152
. env ( "HOST_TRIPLE" , host_triple)
153
+ . env ( "CARGO_CACHE_RUSTC_INFO" , "0" )
153
154
. current_dir ( manifest_path. parent ( ) . expect ( "All manifests should have a valid parent." ) )
154
155
. arg ( "tree" )
155
156
. arg ( "--manifest-path" )
Original file line number Diff line number Diff line change @@ -526,16 +526,24 @@ fn host_specific_build_deps() {
526
526
}
527
527
528
528
let r = runfiles:: Runfiles :: create ( ) . unwrap ( ) ;
529
+
530
+ let src_cargo_toml = runfiles:: rlocation!(
531
+ r,
532
+ "rules_rust/crate_universe/test_data/metadata/host_specific_build_deps/Cargo.toml"
533
+ )
534
+ . unwrap ( ) ;
535
+
536
+ // Put Cargo.toml into writable directory structure and create target/ directory to verify that
537
+ // cargo does not incorrectly cache rustc info in target/.rustc_info.json file.
538
+ let scratch = tempfile:: tempdir ( ) . unwrap ( ) ;
539
+ let cargo_toml = scratch. path ( ) . join ( "Cargo.toml" ) ;
540
+ fs:: copy ( src_cargo_toml, & cargo_toml) . unwrap ( ) ;
541
+ fs:: create_dir ( scratch. path ( ) . join ( "target" ) ) . unwrap ( ) ;
542
+
529
543
let metadata = run (
530
544
"host_specific_build_deps" ,
531
545
HashMap :: from ( [ (
532
- runfiles:: rlocation!(
533
- r,
534
- "rules_rust/crate_universe/test_data/metadata/host_specific_build_deps/Cargo.toml"
535
- )
536
- . unwrap ( )
537
- . to_string_lossy ( )
538
- . to_string ( ) ,
546
+ cargo_toml. to_string_lossy ( ) . to_string ( ) ,
539
547
"//:test_input" . to_string ( ) ,
540
548
) ] ) ,
541
549
"rules_rust/crate_universe/test_data/metadata/host_specific_build_deps/Cargo.lock" ,
You can’t perform that action at this time.
0 commit comments