Skip to content

Commit 1092b35

Browse files
committed
community build: stop injecting sbt-dotty
The sbt-dotty plugin was deprecated with the release of sbt 1.5.0, and removed from the dotty build in b477c42 However it was still being injected into the community build, as many projects therein had not been updated to a recent sbt, or were using a (possibly outdated) version of sbt-dotty either directly or indirectly via some other plugin. This commit discontinues that practice, since sbt 1.6.x no longer plays nice with sbt-dotty (see the linked ticket #14391). Many of the community build projects are already updated upstream to use sbt 1.5.x or 1.6.x without sbt-dotty; those are updated to their upstream versions in this PR as appropriate. A handful of community build projects are either unmaintained or do not offer Scala 3 support upstream, or their inclusion in the community build was part of some special effort. Those projects, listed below, have had their dotty-staging forks updated to use sbt 1.6.2 and drop sbt-dotty. - betterfiles - effpi - fastparse - intent - scalap
1 parent 1b0c27c commit 1092b35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+75
-81
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ compiler/after-pickling.txt
6565
bench/compile.txt
6666

6767
community-build/scala3-bootstrapped.version
68+
community-build/sbt-injected-plugins
6869
community-build/sbt-dotty-sbt
6970
community-build/sbt-scalajs-sbt
7071
community-build/dotty-community-build-deps

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "community-build/community-projects/algebra"]
2-
path = community-build/community-projects/algebra
3-
url = https://github.com/dotty-staging/algebra
41
[submodule "community-build/community-projects/betterfiles"]
52
path = community-build/community-projects/betterfiles
63
url = https://github.com/dotty-staging/better-files
Submodule AsyncFile updated 28 files
Submodule Lucre updated 326 files
Submodule Monocle updated 110 files
Submodule ScalaPB updated 652 files
Submodule akka updated 1306 files
Lines changed: 0 additions & 1 deletion
This file was deleted.
Submodule cats updated 298 files
Submodule fs2 updated 307 files
Submodule play-json updated 78 files
Submodule scala-xml updated 115 files
Submodule scalatest updated 244 files
Submodule scalaz updated 119 files
Submodule scodec updated 85 files
Submodule scodec-bits updated 31 files
Submodule sconfig updated 230 files
Submodule spire updated 128 files
Submodule zio updated 716 files

community-build/src/scala/dotty/communitybuild/CommunityBuildRunner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ trait CommunityBuildRunner:
3434
/** Build the given project with the published local compiler and sbt plugin.
3535
*
3636
* This test reads the compiler version from community-build/dotty-bootstrapped.version
37-
* and expects community-build/sbt-dotty-sbt to set the compiler plugin.
37+
* and expects community-build/sbt-injected-plugins to set any necessary plugins.
3838
*
3939
* @param project The project name, should be a git submodule in community-build/
4040
* @param command The binary file of the program used to test the project – usually

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ lazy val testedCompilerVersion: String =
1313
lazy val sbtPluginFilePath: String =
1414
// Workaround for https://github.com/sbt/sbt/issues/4395
1515
new File(sys.props("user.home") + "/.sbt/1.0/plugins").mkdirs()
16-
communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString()
16+
communitybuildDir.resolve("sbt-injected-plugins").toAbsolutePath().toString()
1717

1818
def log(msg: String) = println(Console.GREEN + msg + Console.RESET)
1919

@@ -281,12 +281,6 @@ object projects:
281281
requiresExperimental = true,
282282
)
283283

284-
lazy val algebra = SbtCommunityProject(
285-
project = "algebra",
286-
sbtTestCommand = "coreJVM/compile",
287-
sbtDocCommand = forceDoc("coreJVM")
288-
)
289-
290284
lazy val scalacheck = SbtCommunityProject(
291285
project = "scalacheck",
292286
sbtTestCommand = "jvm/test;js/test",
@@ -364,7 +358,7 @@ object projects:
364358

365359
lazy val scalaPB = SbtCommunityProject(
366360
project = "ScalaPB",
367-
sbtTestCommand = "dotty-community-build/compile",
361+
sbtTestCommand = "lensesJVM3/compile; runtimeJVM3/compile; grpcRuntimeJVM3/compile; compilerPluginJVM3/compile",
368362
// aggregateDoc("runtimeJVM")("scalapbc", "grpcRuntime", "compilerPlugin") fails with
369363
// module class ScalaPbCodeGenerator$ has non-class parent: TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module protocbridge),ProtocCodeGenerator)
370364
// Also it seems that we do not handle correctly aggreagation projects
@@ -442,6 +436,7 @@ object projects:
442436
project = "zio",
443437
sbtTestCommand = "testJVMDotty",
444438
sbtDocCommand = forceDoc("coreJVM"),
439+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"),
445440
dependencies = () => List(izumiReflect)
446441
)
447442

@@ -468,12 +463,13 @@ object projects:
468463
sbtTestCommand = "unitTests/test",
469464
// Adds <empty> package
470465
sbtDocCommand = "coreJVM/doc",
466+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
471467
dependencies = () => List(munit, scodecBits),
472468
)
473469

474470
lazy val scalaParserCombinators = SbtCommunityProject(
475471
project = "scala-parser-combinators",
476-
sbtTestCommand = "parserCombinatorsJVM/test",
472+
sbtTestCommand = "set every versionPolicyIntention := Compatibility.None; parserCombinatorsJVM/test",
477473
sbtDocCommand = forceDoc("parserCombinatorsJVM"),
478474
)
479475

@@ -512,7 +508,7 @@ object projects:
512508

513509
lazy val catsEffect3 = SbtCommunityProject(
514510
project = "cats-effect-3",
515-
sbtTestCommand = "test",
511+
sbtTestCommand = "ciJVM",
516512
sbtPublishCommand = "publishLocal",
517513
sbtDocCommand = ";coreJVM/doc ;lawsJVM/doc ;kernelJVM/doc",
518514
dependencies = () => List(cats, coop, disciplineSpecs2, scalacheck)
@@ -552,6 +548,7 @@ object projects:
552548
project = "discipline",
553549
sbtTestCommand = "coreJVM/test;coreJS/test",
554550
sbtPublishCommand = "set every credentials := Nil;coreJVM/publishLocal;coreJS/publishLocal",
551+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
555552
dependencies = () => List(scalacheck)
556553
)
557554

@@ -679,9 +676,9 @@ object projects:
679676

680677
lazy val scissLucre = SbtCommunityProject(
681678
project = "Lucre",
682-
sbtTestCommand = "adjunctJVM/test;baseJVM/test;confluentJVM/test;coreJVM/test;dataJVM/test;expr0JVM/test;expr1JVM/test;exprJVM/test;geomJVM/test;lucre-bdb/test;testsJVM/test",
679+
sbtTestCommand = "adjunctJVM/test;baseJVM/test;confluentJVM/test;coreJVM/test;dataJVM/test;exprJVM/test;geomJVM/test;lucre-bdb/test;testsJVM/test",
683680
extraSbtArgs = List("-Dde.sciss.lucre.ShortTests=true"),
684-
sbtPublishCommand = "adjunctJVM/publishLocal;baseJVM/publishLocal;confluentJVM/publishLocal;coreJVM/publishLocal;dataJVM/publishLocal;expr0JVM/publishLocal;expr1JVM/publishLocal;exprJVM/publishLocal;geomJVM/publishLocal;lucre-bdb/publishLocal",
681+
sbtPublishCommand = "adjunctJVM/publishLocal;baseJVM/publishLocal;confluentJVM/publishLocal;coreJVM/publishLocal;dataJVM/publishLocal;exprJVM/publishLocal;geomJVM/publishLocal;lucre-bdb/publishLocal",
685682
dependencies = () => List(scalaSTM, scissAsyncFile, scissEqual, scissFingerTree, scissLog, scissModel, scissNumbers, scissSerial, scissSpan, scalatest),
686683
)
687684

@@ -711,6 +708,7 @@ object projects:
711708
"""set actorTests/Compile/scalacOptions -= "-Xfatal-warnings"""",
712709
"akka-actor-tests/Test/compile",
713710
).mkString("; "),
711+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
714712
dependencies = () => List(scalatest, scalatestplusJunit, scalatestplusScalacheck)
715713
)
716714

@@ -761,6 +759,7 @@ object projects:
761759
project = "fs2",
762760
sbtTestCommand = "coreJVM/test; coreJS/test", // io/test requires JDK9+
763761
sbtPublishCommand = "coreJVM/publishLocal; coreJS/publishLocal",
762+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"),
764763
dependencies = () => List(cats, catsEffect3, munitCatsEffect, scalacheckEffect, scodecBits)
765764
)
766765

@@ -789,6 +788,7 @@ object projects:
789788
project = "spire",
790789
sbtTestCommand = "test",
791790
sbtPublishCommand = "publishLocal",
791+
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Xcheck-macros"),
792792
dependencies = () => List(cats, disciplineMunit)
793793
)
794794

@@ -824,7 +824,6 @@ def allProjects = List(
824824
projects.cask,
825825
projects.scas,
826826
projects.intent,
827-
projects.algebra,
828827
projects.scalacheck,
829828
projects.scalacheckForwardCompat,
830829
projects.scalatest,

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ class CommunityBuildTestB:
4343
@Test def disciplineMunit = projects.disciplineMunit.run()
4444
@Test def disciplineSpecs2 = projects.disciplineSpecs2.run()
4545
@Test def fs2 = projects.fs2.run()
46+
@Test def monocle = projects.monocle.run()
4647
@Test def munit = projects.munit.run()
4748
@Test def munitCatsEffect = projects.munitCatsEffect.run()
4849
@Test def perspective = projects.perspective.run()
4950
@Test def scalacheckEffect = projects.scalacheckEffect.run()
5051
@Test def scodec = projects.scodec.run()
5152
@Test def scodecBits = projects.scodecBits.run()
52-
@Test def monocle = projects.monocle.run()
5353
@Test def simulacrumScalafixAnnotations = projects.simulacrumScalafixAnnotations.run()
54+
@Test def spire = projects.spire.run()
5455
end CommunityBuildTestB
5556

5657
@Category(Array(classOf[TestCategory]))
5758
class CommunityBuildTestC:
5859
@Test def akka = projects.akka.run()
59-
@Test def algebra = projects.algebra.run()
6060
@Test def betterfiles = projects.betterfiles.run()
6161
@Test def cask = projects.cask.run()
6262
// Temporarily disabled until problem discovered in comments to #9449 is fixed
@@ -90,7 +90,6 @@ class CommunityBuildTestC:
9090
@Test def scas = projects.scas.run()
9191
@Test def sconfig = projects.sconfig.run()
9292
@Test def shapeless = projects.shapeless.run()
93-
@Test def spire = projects.spire.run()
9493
@Test def sourcecode = projects.sourcecode.run()
9594
@Test def specs2 = projects.specs2.run()
9695
@Test def stdLib213 = projects.stdLib213.run()

project/Build.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ object Build {
14621462
).evaluated
14631463
)
14641464

1465-
val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{scala3-bootstrapped.version,sbt-dotty-sbt}.")
1465+
val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{scala3-bootstrapped.version,sbt-injected-plugins}.")
14661466

14671467
lazy val `community-build` = project.in(file("community-build")).
14681468
dependsOn(dottyLibrary(Bootstrapped)).
@@ -1482,10 +1482,9 @@ object Build {
14821482
// (publishLocal in `scala3-staging`).value
14831483
val pluginText =
14841484
s"""updateOptions in Global ~= (_.withLatestSnapshots(false))
1485-
|addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "$sbtDottyVersion")
14861485
|addSbtPlugin("ch.epfl.lamp" % "sbt-community-build" % "$sbtCommunityBuildVersion")
14871486
|addSbtPlugin("org.scala-js" % "sbt-scalajs" % "$scalaJSVersion")""".stripMargin
1488-
IO.write(baseDirectory.value / "sbt-dotty-sbt", pluginText)
1487+
IO.write(baseDirectory.value / "sbt-injected-plugins", pluginText)
14891488
IO.write(baseDirectory.value / "scala3-bootstrapped.version", dottyVersion)
14901489
IO.delete(baseDirectory.value / "dotty-community-build-deps") // delete any stale deps file
14911490
},

0 commit comments

Comments
 (0)