File tree 1 file changed +13
-0
lines changed
src/librustc_incremental/persist
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,19 @@ pub fn prepare_session_directory(tcx: TyCtxt) -> Result<bool, ()> {
201
201
debug ! ( "crate-dir: {}" , crate_dir. display( ) ) ;
202
202
try!( create_dir ( tcx. sess , & crate_dir, "crate" ) ) ;
203
203
204
+ // Hack: canonicalize the path *after creating the directory*
205
+ // because, on windows, long paths can cause problems;
206
+ // canonicalization inserts this weird prefix that makes windows
207
+ // tolerate long paths.
208
+ let crate_dir = match crate_dir. canonicalize ( ) {
209
+ Ok ( v) => v,
210
+ Err ( err) => {
211
+ tcx. sess . err ( & format ! ( "incremental compilation: error canonicalizing path `{}`: {}" ,
212
+ crate_dir. display( ) , err) ) ;
213
+ return Err ( ( ) ) ;
214
+ }
215
+ } ;
216
+
204
217
let mut source_directories_already_tried = FxHashSet ( ) ;
205
218
206
219
loop {
You can’t perform that action at this time.
0 commit comments