Skip to content

Commit c6f7ecb

Browse files
committed
Build.sbt: avoid compiling dotty twice at the same time
I added custom tasks to do `dotty/publishLocal` before calling `update` on any of the bootstrapped project, but somehow this resulted in the same compile task being run twice at the same time, now the custom task is only added to `dotty-library-bootstrapped/update`. `dotty-compiler-bootstrapped/update` depends on `dotty-library-bootstrapped/update` so this is okay.
1 parent c1b42cb commit c6f7ecb

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

project/Build.scala

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ object DottyBuild extends Build {
9494
scalaCompilerBridgeSource :=
9595
(dottyOrganization % "dotty-sbt-bridge" % scalaVersion.value % "component").sources(),
9696

97-
// The non-bootstrapped compiler needs to be published first.
98-
update <<= update.dependsOn(Def.task {
99-
// This crazy stuff is equivalent to `dotty/publishLocal`, if we just did
100-
// `publishLocal in dotty` the aggregated projects would be ignored.
101-
val s = state.value
102-
val e = Project.extract(s)
103-
e.runAggregated(publishLocal in dotty, s)
104-
}),
105-
10697
// sbt gets very unhappy if two projects use the same target
10798
target := baseDirectory.value / ".." / "out" / name.value
10899
)
@@ -439,7 +430,17 @@ object DottyBuild extends Build {
439430
lazy val `dotty-library-bootstrapped` = project.in(file("library")).
440431
settings(sourceStructure).
441432
settings(commonBootstrappedSettings).
442-
settings(dottyLibrarySettings)
433+
settings(dottyLibrarySettings).
434+
settings(
435+
// The non-bootstrapped compiler needs to be published first.
436+
update <<= update.dependsOn(Def.task {
437+
// This crazy stuff is equivalent to `dotty/publishLocal`, if we just did
438+
// `publishLocal in dotty` the aggregated projects would be ignored.
439+
val s = state.value
440+
val e = Project.extract(s)
441+
e.runAggregated(publishLocal in dotty, s)
442+
})
443+
)
443444

444445
// until sbt/sbt#2402 is fixed (https://github.com/sbt/sbt/issues/2402)
445446
lazy val cleanSbtBridge = TaskKey[Unit]("cleanSbtBridge", "delete dotty-sbt-bridge cache")

0 commit comments

Comments
 (0)