@@ -55,11 +55,18 @@ impl core::fmt::Display for SpirvSource {
55
55
fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
56
56
match self {
57
57
Self :: CratesIO ( version) => version. fmt ( f) ,
58
- Self :: Git { url, rev } => f. write_str ( & format ! ( "{url}+{rev}" ) ) ,
58
+ Self :: Git { url, rev } => {
59
+ // shorten rev to 8 chars, prevents windows compile errors due to too long paths... seriously
60
+ if let Some ( short_rev) = rev. get ( ..8 ) {
61
+ write ! ( f, "{url}+{short_rev}" )
62
+ } else {
63
+ write ! ( f, "{url}+{rev}" )
64
+ }
65
+ }
59
66
Self :: Path {
60
67
rust_gpu_repo_root,
61
68
version,
62
- } => f . write_str ( & format ! ( "{rust_gpu_repo_root}+{version}" ) ) ,
69
+ } => write ! ( f , "{rust_gpu_repo_root}+{version}" ) ,
63
70
}
64
71
}
65
72
}
@@ -109,9 +116,7 @@ impl SpirvSource {
109
116
} => Ok ( rust_gpu_repo_root. as_std_path ( ) . to_owned ( ) ) ,
110
117
Self :: CratesIO { .. } | Self :: Git { .. } => {
111
118
let dir = crate :: to_dirname ( self . to_string ( ) . as_ref ( ) ) ;
112
- Ok ( crate :: cache_dir ( ) ?
113
- . join ( "rustc_backend_spirv_install" )
114
- . join ( dir) )
119
+ Ok ( crate :: cache_dir ( ) ?. join ( "codegen" ) . join ( dir) )
115
120
}
116
121
}
117
122
}
@@ -269,9 +274,6 @@ mod test {
269
274
. to_str ( )
270
275
. map ( std:: string:: ToString :: to_string)
271
276
. unwrap ( ) ;
272
- assert_eq ! (
273
- "https___github_com_Rust-GPU_rust-gpu+82a0f69008414f51d59184763146caa6850ac588" ,
274
- & name
275
- ) ;
277
+ assert_eq ! ( "https___github_com_Rust-GPU_rust-gpu+82a0f690" , & name) ;
276
278
}
277
279
}
0 commit comments