Skip to content

Commit

Permalink
Quick fix for issue #2958
Browse files Browse the repository at this point in the history
Ensure when flatMap-ing, that we don't append duplicates.
Whether this is correct needs yet to be analyzed, but in general,
we don't enfore unique-ness of task results, and even when we evaluate
disjuct tasks, we can't assume that all results are disjuct, hence
using a strict Agg, which enforces uniqueness on append seems not
correct.

Here's my reasoning: If we have two tasks A and B, and B just forwards
the result of A as it's own result, both tasks return the same result.
  • Loading branch information
lefou committed Jan 8, 2024
1 parent 554c84f commit 3beb943
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main/eval/src/mill/eval/EvaluatorCore.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {

EvaluatorCore.Results(
goals.indexed.map(results(_).map(_._1).result),
finishedOptsMap.map(_._2).flatMap(_.toSeq.flatMap(_.newEvaluated)),
Strict.Agg.from(
Loose.Agg.from(
finishedOptsMap.values.flatMap(_.toSeq.flatMap(_.newEvaluated))
)
),
transitive,
getFailing(sortedGroups, results),
results.map { case (k, v) => (k, v.map(_._1)) }
Expand Down

0 comments on commit 3beb943

Please sign in to comment.