           "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

  /// Careful: job may not be primary.

  public func collectJobsDiscoveredToBeNeededAfterFinishing(
    job finishedJob: Job) throws -> [Job]? {
    unfinishedCompileJobs.remove(finishedJob)

    // Find and deal with inputs that now need to be compiled
    let invalidatedInputs = collectInputsInvalidatedByRunning(finishedJob)
    assert(Set(invalidatedInputs).isDisjoint(with: finishedJob.primaryInputs),


    self.skippedCompileGroups = initial.skippedCompileGroups
    self.mandatoryJobsInOrder = initial.mandatoryJobsInOrder
    self.jobsAfterCompiles = jobsInPhases.afterCompiles
    self.moduleDependencyGraph = initial.graph
    self.driver = driver
