           "Queuing because of dependencies discovered later:", input)
       }
     }
-    let newJobs = try getJobs(for: invalidatedInputs)
-    unfinishedCompileJobs.formUnion(newJobs)
-    if unfinishedCompileJobs.isEmpty {
-      // no more compilations are possible
-      return nil
-    }
-    return newJobs
+    return try getJobs(for: invalidatedInputs)
   }
 
   /// After `job` finished find out which inputs must compiled that were not known to need compilation before


  /// Sadly, has to be `var` for formBatchedJobs
  private var driver: Driver

  /// Track required jobs that haven't finished so the build record can record the corresponding
  /// input statuses.
  private var unfinishedCompileJobs: Set<Job>

  /// Keyed by primary input. As required compilations are discovered after the first wave, these shrink.
  private var skippedCompileGroups = [TypedVirtualPath: CompileJobGroup]()

  /// Careful: job may not be primary.

  public func collectJobsDiscoveredToBeNeededAfterFinishing(
    job finishedJob: Job) throws -> [Job] {
    // Find and deal with inputs that now need to be compiled
    let invalidatedInputs = collectInputsInvalidatedByRunning(finishedJob)
    assert(Set(invalidatedInputs).isDisjoint(with: finishedJob.primaryInputs),
