Skip to content

Commit

Permalink
Fix transitiveCoursierProjects cause OOM on large build (com-lihaoy…
Browse files Browse the repository at this point in the history
…i#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 <[email protected]>
  • Loading branch information
2 people authored and alexarchambault committed Feb 3, 2025
1 parent c05e81b commit f540871
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scalalib/src/mill/scalalib/JavaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,10 @@ trait JavaModule
* Coursier project of this module and those of all its transitive module dependencies
*/
def transitiveCoursierProjects: Task[Seq[cs.Project]] = Task {
Seq(coursierProject()) ++
Task.traverse(compileModuleDepsChecked)(_.transitiveCoursierProjects)().flatten ++
Task.traverse(moduleDepsChecked)(_.transitiveCoursierProjects)().flatten ++
Task.traverse(runModuleDepsChecked)(_.transitiveCoursierProjects)().flatten ++
Task.traverse(bomModuleDepsChecked)(_.transitiveCoursierProjects)().flatten
(Seq(coursierProject()) ++
Task.traverse(
(compileModuleDepsChecked ++ moduleDepsChecked ++ runModuleDepsChecked ++ bomModuleDepsChecked).distinct
)(_.transitiveCoursierProjects)().flatten).distinctBy(_.module)
}

/**
Expand Down

0 comments on commit f540871

Please sign in to comment.