File tree 3 files changed +21
-3
lines changed
src/librustc_incremental/persist
3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -927,7 +927,10 @@ fn all_except_most_recent(
927
927
fn safe_remove_dir_all ( p : & Path ) -> io:: Result < ( ) > {
928
928
if p. exists ( ) {
929
929
let canonicalized = p. canonicalize ( ) ?;
930
- std_fs:: remove_dir_all ( canonicalized)
930
+ match std_fs:: remove_dir_all ( canonicalized) {
931
+ Err ( ref err) if err. kind ( ) == io:: ErrorKind :: NotFound => Ok ( ( ) ) ,
932
+ result => result,
933
+ }
931
934
} else {
932
935
Ok ( ( ) )
933
936
}
Original file line number Diff line number Diff line change @@ -39,8 +39,7 @@ impl LoadResult<(PreviousDepGraph, WorkProductMap)> {
39
39
}
40
40
LoadResult :: DataOutOfDate => {
41
41
if let Err ( err) = delete_all_session_dir_contents ( sess) {
42
- sess. err ( & format ! (
43
- "Failed to delete invalidated or incompatible \
42
+ sess. warn ( & format ! ( "Failed to delete invalidated or incompatible \
44
43
incremental compilation session directory contents `{}`: {}.",
45
44
dep_graph_path( sess) . display( ) ,
46
45
err
Original file line number Diff line number Diff line change @@ -119,6 +119,22 @@ where
119
119
}
120
120
}
121
121
122
+ let folder_path = path_buf. parent ( ) . unwrap ( ) ;
123
+
124
+ if !folder_path. exists ( ) {
125
+ match fs:: create_dir_all ( & folder_path) {
126
+ Ok ( ( ) ) => {
127
+ debug ! ( "save: created new dep-graph folder" ) ;
128
+ }
129
+ Err ( err) => {
130
+ sess. warn ( & format ! ( "failed to create missing directory for dep-graph `{}`: {}" ,
131
+ path_buf. display( ) ,
132
+ err) ) ;
133
+ return ;
134
+ }
135
+ }
136
+ }
137
+
122
138
// generate the data in a memory buffer
123
139
let mut encoder = Encoder :: new ( Vec :: new ( ) ) ;
124
140
file_format:: write_file_header ( & mut encoder) ;
You can’t perform that action at this time.
0 commit comments