Skip to content

Commit f540871

Browse files
lihaoyihoangmaihuy
authored andcommitted
Fix transitiveCoursierProjects cause OOM on large build (com-lihaoyi#4452) (com-lihaoyi#4454)
Resolve com-lihaoyi#4451 It seems that `transitiveCoursierProjects` is populated with repetitive transitive modules, that's why it only causes problem for large build. Please open all PRs as drafts and ensure that your fork of Mill has `settings/actions` / `Allow all actions and reusable workflows` enabled to run CI on your own fork of the Mill repo. Only once CI passes mark the PR as `Ready for review` and CI will run on the main Mill repo before we merge it. Co-authored-by: Mai Huy Hoàng <hoangmaihuy@users.noreply.github.com>
1 parent c05e81b commit f540871

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scalalib/src/mill/scalalib/JavaModule.scala

+4-5
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,10 @@ trait JavaModule
638638
* Coursier project of this module and those of all its transitive module dependencies
639639
*/
640640
def transitiveCoursierProjects: Task[Seq[cs.Project]] = Task {
641-
Seq(coursierProject()) ++
642-
Task.traverse(compileModuleDepsChecked)(_.transitiveCoursierProjects)().flatten ++
643-
Task.traverse(moduleDepsChecked)(_.transitiveCoursierProjects)().flatten ++
644-
Task.traverse(runModuleDepsChecked)(_.transitiveCoursierProjects)().flatten ++
645-
Task.traverse(bomModuleDepsChecked)(_.transitiveCoursierProjects)().flatten
641+
(Seq(coursierProject()) ++
642+
Task.traverse(
643+
(compileModuleDepsChecked ++ moduleDepsChecked ++ runModuleDepsChecked ++ bomModuleDepsChecked).distinct
644+
)(_.transitiveCoursierProjects)().flatten).distinctBy(_.module)
646645
}
647646

648647
/**

0 commit comments

Comments
 (0)