File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ impl ResultName for FailureReason {
12
12
match self {
13
13
FailureReason :: Unknown => "failed (unknown)" . into ( ) ,
14
14
FailureReason :: Timeout => "timed out" . into ( ) ,
15
+ FailureReason :: NetworkAccess => "network access" . into ( ) ,
15
16
FailureReason :: OOM => "OOM" . into ( ) ,
16
17
FailureReason :: ICE => "ICE" . into ( ) ,
17
18
FailureReason :: CompilerError ( _) => "compiler error" . into ( ) ,
@@ -23,6 +24,7 @@ impl ResultName for FailureReason {
23
24
match self {
24
25
FailureReason :: CompilerError ( _) | FailureReason :: DependsOn ( _) => self . to_string ( ) ,
25
26
FailureReason :: Unknown
27
+ | FailureReason :: NetworkAccess
26
28
| FailureReason :: Timeout
27
29
| FailureReason :: OOM
28
30
| FailureReason :: ICE => self . short_name ( ) ,
Original file line number Diff line number Diff line change @@ -198,6 +198,7 @@ pub enum FailureReason {
198
198
OOM ,
199
199
Timeout ,
200
200
ICE ,
201
+ NetworkAccess ,
201
202
CompilerError ( BTreeSet < DiagnosticCode > ) ,
202
203
DependsOn ( BTreeSet < Crate > ) ,
203
204
}
@@ -211,6 +212,7 @@ impl ::std::fmt::Display for FailureReason {
211
212
FailureReason :: OOM => write ! ( f, "oom" ) ,
212
213
FailureReason :: Timeout => write ! ( f, "timeout" ) ,
213
214
FailureReason :: ICE => write ! ( f, "ice" ) ,
215
+ FailureReason :: NetworkAccess => write ! ( f, "network-access" ) ,
214
216
FailureReason :: CompilerError ( codes) => write ! (
215
217
f,
216
218
"compiler-error({})" ,
@@ -271,7 +273,7 @@ impl ::std::str::FromStr for FailureReason {
271
273
impl FailureReason {
272
274
pub ( crate ) fn is_spurious ( & self ) -> bool {
273
275
match * self {
274
- FailureReason :: OOM | FailureReason :: Timeout => true ,
276
+ FailureReason :: OOM | FailureReason :: Timeout | FailureReason :: NetworkAccess => true ,
275
277
FailureReason :: CompilerError ( _)
276
278
| FailureReason :: DependsOn ( _)
277
279
| FailureReason :: Unknown
Original file line number Diff line number Diff line change @@ -97,10 +97,15 @@ fn run_cargo<DB: WriteResults>(
97
97
} ;
98
98
99
99
let mut did_ice = false ;
100
+ let mut did_network = false ;
100
101
let mut error_codes = BTreeSet :: new ( ) ;
101
102
let mut deps = BTreeSet :: new ( ) ;
102
103
103
104
let mut detect_error = |line : & str , actions : & mut ProcessLinesActions | {
105
+ if line. contains ( "urlopen error" ) && line. contains ( "Temporary failure in name resolution" ) {
106
+ did_network = true ;
107
+ }
108
+
104
109
// Avoid trying to deserialize non JSON output
105
110
if !line. starts_with ( '{' ) {
106
111
return ;
@@ -169,6 +174,8 @@ fn run_cargo<DB: WriteResults>(
169
174
Err ( e. context ( FailureReason :: DependsOn ( deps) ) . into ( ) )
170
175
} else if !error_codes. is_empty ( ) {
171
176
Err ( e. context ( FailureReason :: CompilerError ( error_codes) ) . into ( ) )
177
+ } else if did_network {
178
+ Err ( e. context ( FailureReason :: NetworkAccess ) . into ( ) )
172
179
} else {
173
180
Err ( e. into ( ) )
174
181
}
You can’t perform that action at this time.
0 commit comments