@@ -539,23 +539,15 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
539
539
// (or "default") `--target-dir`, to append `/spirv-builder` to it.
540
540
let target_dir = outer_target_dir. map ( |outer| outer. join ( "spirv-builder" ) ) ;
541
541
if let Some ( target_dir) = target_dir {
542
- // HACK(eddyb) Cargo caches some information it got from `rustc` in
543
- // `.rustc_info.json`, and assumes it only depends on the `rustc`
544
- // binary, but in our case, `rustc_codegen_spirv` changes are also
545
- // relevant - so we remove the cache file if it may be out of date.
546
- let mtime = |path| std:: fs:: metadata ( path) ?. modified ( ) ;
547
- let rustc_info = target_dir. join ( ".rustc_info.json" ) ;
548
- if let Ok ( rustc_info_mtime) = mtime ( & rustc_info) {
549
- if let Ok ( rustc_codegen_spirv_mtime) = mtime ( & rustc_codegen_spirv) {
550
- if rustc_codegen_spirv_mtime > rustc_info_mtime {
551
- let _ = std:: fs:: remove_file ( rustc_info) ;
552
- }
553
- }
554
- }
555
-
556
542
cargo. arg ( "--target-dir" ) . arg ( target_dir) ;
557
543
}
558
544
545
+ // NOTE(eddyb) Cargo caches some information it got from `rustc` in
546
+ // `.rustc_info.json`, and assumes it only depends on the `rustc` binary,
547
+ // but in our case, `rustc_codegen_spirv` changes are also relevant,
548
+ // so we turn off that caching with an env var, just to avoid any issues.
549
+ cargo. env ( "CARGO_CACHE_RUSTC_INFO" , "0" ) ;
550
+
559
551
for ( key, _) in env:: vars_os ( ) {
560
552
let remove = key. to_str ( ) . map_or ( false , |s| {
561
553
s. starts_with ( "CARGO_FEATURES_" ) || s. starts_with ( "CARGO_CFG_" )
0 commit comments