@@ -290,7 +290,7 @@ fn build_batch(
290290 let mut intent_names = intent. unwrap_or_default ( ) ;
291291 if !skipped_modules. is_empty ( ) {
292292 tracing:: debug!(
293- skipped_count = skipped_modules. len ( ) ,
293+ skipped = ? skipped_modules. iter ( ) . collect :: < Vec <_>> ( ) ,
294294 "build_batch: registering skipped modules as FullCompile intent"
295295 ) ;
296296 intent_names. extend ( skipped_modules) ;
@@ -516,33 +516,45 @@ fn drain_full_compile_intent(
516516 let mut pending = AHashSet :: new ( ) ;
517517 let mut not_ready = HashSet :: new ( ) ;
518518
519+ let mut already_built = Vec :: new ( ) ;
520+ let mut discarded = Vec :: new ( ) ;
521+
519522 for name in names {
520523 match build_state. build_state . modules . get ( & name) {
521524 Some ( Module :: SourceFile ( sf) ) => match sf. compilation_stage ( ) {
522525 CompilationStage :: Built ( ..) => {
523- // Already compiled — nothing to do.
526+ already_built . push ( name ) ;
524527 }
525528 CompilationStage :: TypeChecked { .. } => {
526529 pending. insert ( name) ;
527530 }
528- _ => {
529- // Not ready yet (e.g. CompileError, SourceDirty).
531+ other => {
532+ tracing:: debug!(
533+ module = %name,
534+ stage = ?std:: mem:: discriminant( other) ,
535+ "drain_intent: module not ready"
536+ ) ;
530537 not_ready. insert ( name) ;
531538 }
532539 } ,
533540 _ => {
534- // Module no longer exists — discard.
541+ discarded . push ( name ) ;
535542 }
536543 }
537544 }
538545
546+ tracing:: debug!(
547+ built_count = already_built. len( ) ,
548+ pending_count = pending. len( ) ,
549+ not_ready_count = not_ready. len( ) ,
550+ discarded_count = discarded. len( ) ,
551+ built = ?already_built,
552+ pending_modules = ?pending. iter( ) . collect:: <Vec <_>>( ) ,
553+ not_ready_modules = ?not_ready. iter( ) . collect:: <Vec <_>>( ) ,
554+ "drain_intent: partition"
555+ ) ;
556+
539557 if pending. is_empty ( ) {
540- if !not_ready. is_empty ( ) {
541- tracing:: debug!(
542- "drain_intent: no TypeChecked modules to compile ({} still pending)" ,
543- not_ready. len( )
544- ) ;
545- }
546558 return not_ready;
547559 }
548560
@@ -563,7 +575,14 @@ fn drain_full_compile_intent(
563575 }
564576 Err ( e) => {
565577 tracing:: warn!( "drain_intent completed with errors: {e}" ) ;
578+ if !e. skipped_modules . is_empty ( ) {
579+ tracing:: debug!(
580+ skipped = ?e. skipped_modules. iter( ) . collect:: <Vec <_>>( ) ,
581+ "drain_intent: skipped modules from compile_dependencies"
582+ ) ;
583+ }
566584 // Keep failed modules in intent for next attempt.
585+ let mut became_built = Vec :: new ( ) ;
567586 for name in & pending {
568587 if build_state. build_state . modules . get ( name) . is_some_and ( |m| {
569588 !matches ! (
@@ -573,8 +592,16 @@ fn drain_full_compile_intent(
573592 )
574593 } ) {
575594 not_ready. insert ( name. clone ( ) ) ;
595+ } else {
596+ became_built. push ( name. clone ( ) ) ;
576597 }
577598 }
599+ if !became_built. is_empty ( ) {
600+ tracing:: debug!(
601+ modules = ?became_built,
602+ "drain_intent: modules reached Built despite errors (dropped from intent)"
603+ ) ;
604+ }
578605 diagnostics. extend ( e. diagnostics ) ;
579606 touched_files. extend ( module_names_to_paths ( build_state, & e. modules ) ) ;
580607 }
0 commit comments