@@ -232,15 +232,17 @@ def update(self,
232
232
self .manager .log_fine_grained ('previous targets with errors: %s' %
233
233
sorted (self .previous_targets_with_errors ))
234
234
235
+ blocking_error = None
235
236
if self .blocking_error :
236
237
# Handle blocking errors first. We'll exit as soon as we find a
237
238
# module that still has blocking errors.
238
239
self .manager .log_fine_grained ('existing blocker: %s' % self .blocking_error [0 ])
239
240
changed_modules = dedupe_modules ([self .blocking_error ] + changed_modules )
241
+ blocking_error = self .blocking_error [0 ]
240
242
self .blocking_error = None
241
243
242
244
while True :
243
- result = self .update_one (changed_modules , initial_set , removed_set )
245
+ result = self .update_one (changed_modules , initial_set , removed_set , blocking_error )
244
246
changed_modules , (next_id , next_path ), blocker_messages = result
245
247
246
248
if blocker_messages is not None :
@@ -289,9 +291,10 @@ def trigger(self, target: str) -> List[str]:
289
291
def update_one (self ,
290
292
changed_modules : List [Tuple [str , str ]],
291
293
initial_set : Set [str ],
292
- removed_set : Set [str ]) -> Tuple [List [Tuple [str , str ]],
293
- Tuple [str , str ],
294
- Optional [List [str ]]]:
294
+ removed_set : Set [str ],
295
+ blocking_error : Optional [str ]) -> Tuple [List [Tuple [str , str ]],
296
+ Tuple [str , str ],
297
+ Optional [List [str ]]]:
295
298
"""Process a module from the list of changed modules.
296
299
297
300
Returns:
@@ -303,9 +306,17 @@ def update_one(self,
303
306
"""
304
307
t0 = time .time ()
305
308
next_id , next_path = changed_modules .pop (0 )
306
- if next_id not in self .previous_modules and next_id not in initial_set :
307
- self .manager .log_fine_grained ('skip %r (module not in import graph)' % next_id )
309
+
310
+ # If we have a module with a blocking error that is no longer
311
+ # in the import graph, we must skip it as otherwise we'll be
312
+ # stuck with the blocking error.
313
+ if (next_id == blocking_error
314
+ and next_id not in self .previous_modules
315
+ and next_id not in initial_set ):
316
+ self .manager .log_fine_grained (
317
+ 'skip %r (module with blocking error not in import graph)' % next_id )
308
318
return changed_modules , (next_id , next_path ), None
319
+
309
320
result = self .update_module (next_id , next_path , next_id in removed_set )
310
321
remaining , (next_id , next_path ), blocker_messages = result
311
322
changed_modules = [(id , path ) for id , path in changed_modules
0 commit comments