Skip to content

Commit

Permalink
Use coursier thread pool to run coursier-related task (com-lihaoyi#3614)
Browse files Browse the repository at this point in the history
Using the default global `ExecutionContext`, also used by the BSP
server, can lead to deadlocks, as coursier doesn't mark blocking things
with `blocking`. (It deadlocks locally for me, during Mill import via
BSP in IntelliJ, with 4 threads being spawned and awaiting in the
default `ExecutionContext`.)
  • Loading branch information
alexarchambault authored Sep 27, 2024
1 parent 4c3d2cb commit 0e50ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scalalib/src/mill/scalalib/CoursierModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ trait CoursierModule extends mill.Module {
* The repositories used to resolved dependencies with [[resolveDeps()]].
*/
def repositoriesTask: Task[Seq[Repository]] = Task.Anon {
import scala.concurrent.ExecutionContext.Implicits.global
val resolve = Resolve()
val repos = Await.result(
Resolve().finalRepositories.future(),
resolve.finalRepositories.future()(resolve.cache.ec),
Duration.Inf
)
repos
Expand Down

0 comments on commit 0e50ff7

Please sign in to comment.