From c985f3cd9bd847216c981b2fed8d44a31abe9069 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:27:08 +0100 Subject: [PATCH 01/19] use the new artifacts for the default scalaInstance [Cherry-picked 8488286ded98038b6d8e6772ec00bb2bb8ee5a16] --- project/Build.scala | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 3ad23fdb1904..efbce4ede4a9 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -581,21 +581,21 @@ object Build { // Compile using the non-bootstrapped and non-published dotty managedScalaInstance := false, scalaInstance := { - val externalLibraryDeps = (`scala3-library` / Compile / externalDependencyClasspath).value.map(_.data).toSet - val externalCompilerDeps = (`scala3-compiler` / Compile / externalDependencyClasspath).value.map(_.data).toSet + val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet // IMPORTANT: We need to use actual jars to form the ScalaInstance and not // just directories containing classfiles because sbt maintains a cache of // compiler instances. This cache is invalidated based on timestamps // however this is only implemented on jars, directories are never // invalidated. - val tastyCore = (`tasty-core` / Compile / packageBin).value - val scala3Library = (`scala3-library` / Compile / packageBin).value + val tastyCore = (`tasty-core-nonbootstrapped` / Compile / packageBin).value + val scala3Library = (`scala3-library-nonbootstrapped` / Compile / packageBin).value + val scalaLibrary = (`scala-library-nonbootstrapped` / Compile / packageBin).value val scala3Interfaces = (`scala3-interfaces` / Compile / packageBin).value - val scala3Compiler = (`scala3-compiler` / Compile / packageBin).value + val scala3Compiler = (`scala3-compiler-nonbootstrapped` / Compile / packageBin).value - val libraryJars = Array(scala3Library) ++ externalLibraryDeps - val compilerJars = Seq(tastyCore, scala3Interfaces, scala3Compiler) ++ (externalCompilerDeps -- externalLibraryDeps) + val libraryJars = Array(scala3Library, scalaLibrary) + val compilerJars = Seq(tastyCore, scala3Interfaces, scala3Compiler) ++ externalCompilerDeps Defaults.makeScalaInstance( scalaVersion.value, @@ -612,8 +612,8 @@ object Build { // in the `scalaInstance` of the `doc` task which allows us to run // `scala3-library-bootstrapped/doc` for example. doc / scalaInstance := { - val externalDeps = (LocalProject("scaladoc") / Compile / externalDependencyClasspath).value.map(_.data) - val scalaDoc = (LocalProject("scaladoc") / Compile / packageBin).value + val externalDeps = (LocalProject("scaladoc-new") / Compile / externalDependencyClasspath).value.map(_.data) + val scalaDoc = (LocalProject("scaladoc-new") / Compile / packageBin).value val docJars = Array(scalaDoc) ++ externalDeps val base = scalaInstance.value From 00a7e52609757213efeec5d0e2a0ceef18330e7f Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:29:55 +0100 Subject: [PATCH 02/19] disable bench in the build [Cherry-picked 8d9f9b0cc55c95feaf4ea18a24f7310ae566f370] --- build.sbt | 8 ++++---- project/Build.scala | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build.sbt b/build.sbt index c6c9a8e3caa7..de05974df02d 100644 --- a/build.sbt +++ b/build.sbt @@ -26,9 +26,10 @@ val `scala3-staging-new` = Build.`scala3-staging-new` val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector` val `scala3-tasty-inspector-new` = Build.`scala3-tasty-inspector-new` val `scala3-language-server` = Build.`scala3-language-server` -val `scala3-bench` = Build.`scala3-bench` -val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped` -val `scala3-bench-micro` = Build.`scala3-bench-micro` +//val `scala3-bench` = Build.`scala3-bench` +//val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped` +//val `scala3-bench-micro` = Build.`scala3-bench-micro` +//val `scala3-bench-run` = Build.`scala3-bench-run` val `tasty-core` = Build.`tasty-core` val `tasty-core-nonbootstrapped` = Build.`tasty-core-nonbootstrapped` val `tasty-core-bootstrapped-new` = Build.`tasty-core-bootstrapped-new` @@ -40,7 +41,6 @@ val `scaladoc-testcases` = Build.`scaladoc-testcases` val `scaladoc-js-common` = Build.`scaladoc-js-common` val `scaladoc-js-main` = Build.`scaladoc-js-main` val `scaladoc-js-contributors` = Build.`scaladoc-js-contributors` -val `scala3-bench-run` = Build.`scala3-bench-run` val dist = Build.dist val `dist-mac-x86_64` = Build.`dist-mac-x86_64` val `dist-mac-aarch64` = Build.`dist-mac-aarch64` diff --git a/project/Build.scala b/project/Build.scala index efbce4ede4a9..133b80ddc1eb 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -3427,13 +3427,13 @@ object Build { Test / forkOptions := (Test / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value), ) - lazy val `scala3-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped) - lazy val `scala3-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped) - lazy val `scala3-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped) + //lazy val `scala3-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped) + //lazy val `scala3-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped) + //lazy val `scala3-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped) - lazy val `scala3-bench-micro` = project.in(file("bench-micro")) + /*lazy val `scala3-bench-micro` = project.in(file("bench-micro")) .asDottyBench(Bootstrapped) - .settings(Jmh / run / mainClass := Some("org.openjdk.jmh.Main")) + .settings(Jmh / run / mainClass := Some("org.openjdk.jmh.Main"))*/ val testcasesOutputDir = taskKey[Seq[String]]("Root directory where tests classes are generated") val testcasesSourceRoot = taskKey[String]("Root directory where tests sources are generated") @@ -4057,10 +4057,10 @@ object Build { scalacOptions += "-Ytasty-reader" // to read scala3 library ) - def asDottyBench(implicit mode: Mode): Project = project.withCommonSettings. + /*def asDottyBench(implicit mode: Mode): Project = project.withCommonSettings. dependsOn(dottyCompiler). settings(commonBenchmarkSettings). - enablePlugins(JmhPlugin) + enablePlugins(JmhPlugin)*/ def asDist(implicit mode: Mode): Project = project. enablePlugins(UniversalPlugin, RepublishPlugin). From 5058a7bb51bc948013baf518962f04cfc2e185c2 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:34:28 +0100 Subject: [PATCH 03/19] disable dist projects [Cherry-picked 53dac46bc038ee8586840e7b0933485f76d5e2b8] --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/scaladoc.yaml | 10 ++++----- .github/workflows/test-launchers.yml | 2 +- build.sbt | 12 +++++------ project/Build.scala | 32 ++++++++++++++-------------- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7ea631a379ed..52ffcf1ddcd6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -128,9 +128,9 @@ jobs: run: sbt ";scala3-bootstrapped/compile" shell: cmd - - name: build binary - run: sbt "dist-win-x86_64/Universal/stage" & bash -version - shell: cmd + #- name: build binary + # run: sbt "dist-win-x86_64/Universal/stage" & bash -version + # shell: cmd - name: cygwin tests run: '"C:\Program Files\cygwin64\bin\bash" ./project/scripts/winCmdTests' diff --git a/.github/workflows/scaladoc.yaml b/.github/workflows/scaladoc.yaml index 0482a0845650..89497a27a509 100644 --- a/.github/workflows/scaladoc.yaml +++ b/.github/workflows/scaladoc.yaml @@ -41,11 +41,11 @@ jobs: - name: Compile and test scala3doc-js run: ./project/scripts/sbt scaladoc-js-main/test - - name: Compile and test - run: | - ./project/scripts/sbt scaladoc/test - ./project/scripts/sbt dist/Universal/stage - ./project/scripts/cmdScaladocTests + #- name: Compile and test + # run: | + # ./project/scripts/sbt scaladoc/test + # ./project/scripts/sbt dist/Universal/stage + # ./project/scripts/cmdScaladocTests - name: Locally publish self run: ./project/scripts/sbt scaladoc/publishLocal diff --git a/.github/workflows/test-launchers.yml b/.github/workflows/test-launchers.yml index cce861d06f35..58daf323561e 100644 --- a/.github/workflows/test-launchers.yml +++ b/.github/workflows/test-launchers.yml @@ -1,6 +1,6 @@ name: Test CLI Launchers on all the platforms on: - pull_request: + #pull_request: workflow_dispatch: env: diff --git a/build.sbt b/build.sbt index de05974df02d..40cec8809a5f 100644 --- a/build.sbt +++ b/build.sbt @@ -41,12 +41,12 @@ val `scaladoc-testcases` = Build.`scaladoc-testcases` val `scaladoc-js-common` = Build.`scaladoc-js-common` val `scaladoc-js-main` = Build.`scaladoc-js-main` val `scaladoc-js-contributors` = Build.`scaladoc-js-contributors` -val dist = Build.dist -val `dist-mac-x86_64` = Build.`dist-mac-x86_64` -val `dist-mac-aarch64` = Build.`dist-mac-aarch64` -val `dist-win-x86_64` = Build.`dist-win-x86_64` -val `dist-linux-x86_64` = Build.`dist-linux-x86_64` -val `dist-linux-aarch64` = Build.`dist-linux-aarch64` +//val dist = Build.dist +//val `dist-mac-x86_64` = Build.`dist-mac-x86_64` +//val `dist-mac-aarch64` = Build.`dist-mac-aarch64` +//val `dist-win-x86_64` = Build.`dist-win-x86_64` +//val `dist-linux-x86_64` = Build.`dist-linux-x86_64` +//val `dist-linux-aarch64` = Build.`dist-linux-aarch64` val `community-build` = Build.`community-build` val `scala3-presentation-compiler` = Build.`scala3-presentation-compiler` val `scala3-presentation-compiler-testcases` = Build.`scala3-presentation-compiler-testcases` diff --git a/project/Build.scala b/project/Build.scala index 133b80ddc1eb..872ed6c738cb 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -3854,7 +3854,7 @@ object Build { ), ) - lazy val commonDistSettings = Seq( + /*lazy val commonDistSettings = Seq( publishArtifact := false, republishRepo := target.value / "republish", Universal / packageName := packageName.value, @@ -3879,9 +3879,9 @@ object Build { republishCommandLibs += ("scala" -> List("scala3-interfaces", "scala3-compiler", "scala3-library", "tasty-core")), republishCommandLibs += ("with_compiler" -> List("scala3-staging", "scala3-tasty-inspector", "^!scala3-interfaces", "^!scala3-compiler", "^!scala3-library", "^!tasty-core")), republishCommandLibs += ("scaladoc" -> List("scala3-interfaces", "scala3-compiler", "scala3-library", "tasty-core", "scala3-tasty-inspector", "scaladoc")), - ) + )*/ - lazy val dist = project.asDist(Bootstrapped) + /*lazy val dist = project.asDist(Bootstrapped) .settings(packageName := "scala3-" + dottyVersion) .settings( republishLibexecDir := baseDirectory.value / "libexec", @@ -3889,9 +3889,9 @@ object Build { ("coursier.jar" -> s"https://github.com/coursier/coursier/releases/download/v$coursierJarVersion/coursier.jar"), republishLaunchers += ("scala-cli.jar" -> s"https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli.jar"), - ) + )*/ - lazy val `dist-mac-x86_64` = project.in(file("dist/mac-x86_64")).asDist(Bootstrapped) + /*lazy val `dist-mac-x86_64` = project.in(file("dist/mac-x86_64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-x86_64-apple-darwin") .settings( republishLibexecDir := (dist / republishLibexecDir).value, @@ -3899,9 +3899,9 @@ object Build { republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-apple-darwin.gz") - ) + )*/ - lazy val `dist-mac-aarch64` = project.in(file("dist/mac-aarch64")).asDist(Bootstrapped) + /*lazy val `dist-mac-aarch64` = project.in(file("dist/mac-aarch64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-aarch64-apple-darwin") .settings( republishLibexecDir := (dist / republishLibexecDir).value, @@ -3909,9 +3909,9 @@ object Build { republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-aarch64-apple-darwin.gz") - ) + )*/ - lazy val `dist-win-x86_64` = project.in(file("dist/win-x86_64")).asDist(Bootstrapped) + /*lazy val `dist-win-x86_64` = project.in(file("dist/win-x86_64")).asDist(Bootstrapped) .enablePlugins(WindowsPlugin) // TO GENERATE THE `.msi` installer .settings(packageName := (dist / packageName).value + "-x86_64-pc-win32") .settings( @@ -3936,9 +3936,9 @@ object Build { wixProductId := "*", // Unique ID for each generated MSI; will change for each generated msi wixProductUpgradeId := "3E5A1A82-CA67-4353-94FE-5BDD400AF66B", // Unique ID to identify the package; used to manage the upgrades wixProductLicense := Some(dist.base / "LICENSE.rtf") // Link to the LICENSE to show during the installation (keep in sync with ../LICENSE) - ) + )*/ - lazy val `dist-linux-x86_64` = project.in(file("dist/linux-x86_64")).asDist(Bootstrapped) + /*lazy val `dist-linux-x86_64` = project.in(file("dist/linux-x86_64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-x86_64-pc-linux") .settings( republishLibexecDir := (dist / republishLibexecDir).value, @@ -3946,9 +3946,9 @@ object Build { republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-x86_64-pc-linux.gz") - ) + )*/ - lazy val `dist-linux-aarch64` = project.in(file("dist/linux-aarch64")).asDist(Bootstrapped) + /*lazy val `dist-linux-aarch64` = project.in(file("dist/linux-aarch64")).asDist(Bootstrapped) .settings(packageName := (dist / packageName).value + "-aarch64-pc-linux") .settings( republishLibexecDir := (dist / republishLibexecDir).value, @@ -3956,7 +3956,7 @@ object Build { republishFetchCoursier := (dist / republishFetchCoursier).value, republishLaunchers += ("scala-cli" -> s"gz+https://github.com/VirtusLab/scala-cli/releases/download/v$scalaCliLauncherVersion/scala-cli-aarch64-pc-linux.gz") - ) + )*/ private def customMimaReportBinaryIssues(issueFilterLocation: String) = mimaReportBinaryIssues := { mimaReportBinaryIssues.result.value match { @@ -4062,7 +4062,7 @@ object Build { settings(commonBenchmarkSettings). enablePlugins(JmhPlugin)*/ - def asDist(implicit mode: Mode): Project = project. + /*def asDist(implicit mode: Mode): Project = project. enablePlugins(UniversalPlugin, RepublishPlugin). withCommonSettings. settings(commonDistSettings). @@ -4078,7 +4078,7 @@ object Build { ). bootstrappedSettings( target := baseDirectory.value / "target" // override setting in commonBootstrappedSettings - ) + )*/ def withCommonSettings(implicit mode: Mode): Project = project.settings(mode match { case NonBootstrapped => commonNonBootstrappedSettings From 73b8563360574739253d097a3dcd572fe96a41a5 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:35:32 +0100 Subject: [PATCH 04/19] remove tasty-core-scala2 (dead project) [Cherry-picked aa8a7b6c62f80390dc35f32695965bd85cb88f5f] --- build.sbt | 1 - project/Build.scala | 12 ------------ 2 files changed, 13 deletions(-) diff --git a/build.sbt b/build.sbt index 40cec8809a5f..3f05994c25ae 100644 --- a/build.sbt +++ b/build.sbt @@ -34,7 +34,6 @@ val `tasty-core` = Build.`tasty-core` val `tasty-core-nonbootstrapped` = Build.`tasty-core-nonbootstrapped` val `tasty-core-bootstrapped-new` = Build.`tasty-core-bootstrapped-new` val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped` -val `tasty-core-scala2` = Build.`tasty-core-scala2` val scaladoc = Build.scaladoc val `scaladoc-new` = Build.`scaladoc-new` val `scaladoc-testcases` = Build.`scaladoc-testcases` diff --git a/project/Build.scala b/project/Build.scala index 872ed6c738cb..de2b36d3bb2d 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2920,7 +2920,6 @@ object Build { lazy val `tasty-core` = project.in(file("tasty")).asTastyCore(NonBootstrapped) lazy val `tasty-core-bootstrapped`: Project = project.in(file("tasty")).asTastyCore(Bootstrapped) - lazy val `tasty-core-scala2`: Project = project.in(file("tasty")).asTastyCoreScala2 def tastyCore(implicit mode: Mode): Project = mode match { case NonBootstrapped => `tasty-core` @@ -4046,17 +4045,6 @@ object Build { ), ) - def asTastyCoreScala2: Project = project - .settings(commonScala2Settings) - // need to add @annotation.internal.sharable to the classpath for compiling - // we don't actually publish this library anywhere, so it's fine. - // if someone depends on the sources of tasty-core in a scala 2 project, - // they should strip the sharable annotation, or add -Ytasty-reader - .dependsOn(dottyLibrary(NonBootstrapped) % Provided) - .settings( - scalacOptions += "-Ytasty-reader" // to read scala3 library - ) - /*def asDottyBench(implicit mode: Mode): Project = project.withCommonSettings. dependsOn(dottyCompiler). settings(commonBenchmarkSettings). From 0ca9616dfec809a65b48d5a213eac449ad7b932b Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:38:45 +0100 Subject: [PATCH 05/19] remove old `sbt-bridge` [Cherry-picked 916e00f4f5794e5c9840431fb13d5e27fab2c787] --- build.sbt | 2 -- project/Build.scala | 37 ++----------------------------------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/build.sbt b/build.sbt index 3f05994c25ae..ddf4129af627 100644 --- a/build.sbt +++ b/build.sbt @@ -17,10 +17,8 @@ val `scala3-library-bootstrapped-new` = Build.`scala3-library-bootstrapped-new` val `scala3-library` = Build.`scala3-library` val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped` val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS` -val `scala3-sbt-bridge` = Build.`scala3-sbt-bridge` val `scala3-sbt-bridge-bootstrapped` = Build.`scala3-sbt-bridge-bootstrapped` val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped` -val `scala3-sbt-bridge-tests` = Build.`scala3-sbt-bridge-tests` val `scala3-staging` = Build.`scala3-staging` val `scala3-staging-new` = Build.`scala3-staging-new` val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector` diff --git a/project/Build.scala b/project/Build.scala index de2b36d3bb2d..8a8d8efc4612 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -557,7 +557,7 @@ object Build { scalaVersion := dottyNonBootstrappedVersion, scalaCompilerBridgeBinaryJar := { - Some((`scala3-sbt-bridge` / Compile / packageBin).value) + Some((`scala3-sbt-bridge-nonbootstrapped` / Compile / packageBin).value) }, // Use the same name as the non-bootstrapped projects for the artifacts. @@ -2946,39 +2946,6 @@ object Build { javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value ) - lazy val `scala3-sbt-bridge` = project.in(file("sbt-bridge/src")). - // We cannot depend on any bootstrapped project to compile the bridge, since the - // bridge is needed to compile these projects. - dependsOn(`scala3-compiler` % Provided). - settings(commonJavaSettings). - settings( - description := "sbt compiler bridge for Dotty", - - Test / sources := Seq(), - Compile / scalaSource := baseDirectory.value, - Compile / javaSource := baseDirectory.value, - Compile / resourceDirectory := baseDirectory.value.getParentFile / "resources", - - // Referring to the other project using a string avoids an infinite loop - // when sbt reads the settings. - Test / test := (LocalProject("scala3-sbt-bridge-tests") / Test / test).value, - - libraryDependencies += Dependencies.compilerInterface % Provided - ) - - // We use a separate project for the bridge tests since they can only be run - // with the bootstrapped library on the classpath. - lazy val `scala3-sbt-bridge-tests` = project.in(file("sbt-bridge/test")). - dependsOn(dottyCompiler(Bootstrapped) % Test). - dependsOn(`scala3-sbt-bridge`). - settings(commonBootstrappedSettings). - settings( - Compile / sources := Seq(), - Test / scalaSource := baseDirectory.value, - Test / javaSource := baseDirectory.value, - libraryDependencies += ("org.scala-sbt" %% "zinc-apiinfo" % "1.8.0" % Test).cross(CrossVersion.for3Use2_13) - ) - lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler")) .withCommonSettings(Bootstrapped) .dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-library-bootstrapped-new`, `scala3-presentation-compiler-testcases` % "test->test") @@ -3970,7 +3937,7 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. - aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, `scala3-sbt-bridge`). + aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore). bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`, `scala3-library-bootstrappedJS`, scaladoc, `scala3-presentation-compiler`). dependsOn(tastyCore). From a1a0971c0926e05112d876f1a149030be7d17d28 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:42:00 +0100 Subject: [PATCH 06/19] remove old `scala3-tasty-inspector` [Cherry-picked bdbac4a7db09a29601dc50332a73dcd872e27448] --- build.sbt | 1 - project/Build.scala | 17 +++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/build.sbt b/build.sbt index ddf4129af627..feef225d57c0 100644 --- a/build.sbt +++ b/build.sbt @@ -21,7 +21,6 @@ val `scala3-sbt-bridge-bootstrapped` = Build.`scala3-sbt-bridge-bootstrapped` val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped` val `scala3-staging` = Build.`scala3-staging` val `scala3-staging-new` = Build.`scala3-staging-new` -val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector` val `scala3-tasty-inspector-new` = Build.`scala3-tasty-inspector-new` val `scala3-language-server` = Build.`scala3-language-server` //val `scala3-bench` = Build.`scala3-bench` diff --git a/project/Build.scala b/project/Build.scala index 8a8d8efc4612..5b8cbd2b4619 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1047,7 +1047,6 @@ object Build { (`scala3-compiler` / packageAll).value ++ Seq( "scala3-compiler" -> (Compile / packageBin).value.getAbsolutePath, "scala3-staging" -> (LocalProject("scala3-staging") / Compile / packageBin).value.getAbsolutePath, - "scala3-tasty-inspector" -> (LocalProject("scala3-tasty-inspector") / Compile / packageBin).value.getAbsolutePath, "tasty-core" -> (LocalProject("tasty-core-bootstrapped") / Compile / packageBin).value.getAbsolutePath, ) }, @@ -2936,16 +2935,6 @@ object Build { javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value ) - lazy val `scala3-tasty-inspector` = project.in(file("tasty-inspector")). - withCommonSettings(Bootstrapped). - // We want the compiler to be present in the compiler classpath when compiling this project but not - // when compiling a project that depends on scala3-tasty-inspector (see sbt-test/sbt-dotty/tasty-inspector-example-project), - // but we always need it to be present on the JVM classpath at runtime. - dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test"). - settings( - javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value - ) - lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler")) .withCommonSettings(Bootstrapped) .dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-library-bootstrapped-new`, `scala3-presentation-compiler-testcases` % "test->test") @@ -3500,7 +3489,7 @@ object Build { configs(SourceLinksIntegrationTest). settings(commonBootstrappedSettings). dependsOn(`scala3-compiler-bootstrapped`). - dependsOn(`scala3-tasty-inspector`). + dependsOn(`scala3-tasty-inspector-new`). settings(inConfig(SourceLinksIntegrationTest)(Defaults.testSettings)). settings( SourceLinksIntegrationTest / scalaSource := baseDirectory.value / "test-source-links", @@ -3938,8 +3927,8 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore). - bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, - `scala3-tasty-inspector`, `scala3-library-bootstrappedJS`, scaladoc, `scala3-presentation-compiler`). + bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, + `scala3-library-bootstrappedJS`, scaladoc, `scala3-presentation-compiler`). dependsOn(tastyCore). dependsOn(dottyCompiler). dependsOn(dottyLibrary). From eed40ca79931df1d9edfb11aa103ff1bec50c846 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:43:24 +0100 Subject: [PATCH 07/19] remove old `scala3-staging` [Cherry-picked fb22fe48138b0139e37e9a16150914d2761566b3] --- build.sbt | 1 - project/Build.scala | 13 +------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/build.sbt b/build.sbt index feef225d57c0..021259dd9b95 100644 --- a/build.sbt +++ b/build.sbt @@ -19,7 +19,6 @@ val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped` val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS` val `scala3-sbt-bridge-bootstrapped` = Build.`scala3-sbt-bridge-bootstrapped` val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped` -val `scala3-staging` = Build.`scala3-staging` val `scala3-staging-new` = Build.`scala3-staging-new` val `scala3-tasty-inspector-new` = Build.`scala3-tasty-inspector-new` val `scala3-language-server` = Build.`scala3-language-server` diff --git a/project/Build.scala b/project/Build.scala index 5b8cbd2b4619..9d69f9f77d29 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1046,7 +1046,6 @@ object Build { packageAll := { (`scala3-compiler` / packageAll).value ++ Seq( "scala3-compiler" -> (Compile / packageBin).value.getAbsolutePath, - "scala3-staging" -> (LocalProject("scala3-staging") / Compile / packageBin).value.getAbsolutePath, "tasty-core" -> (LocalProject("tasty-core-bootstrapped") / Compile / packageBin).value.getAbsolutePath, ) }, @@ -2925,16 +2924,6 @@ object Build { case Bootstrapped => `tasty-core-bootstrapped` } - lazy val `scala3-staging` = project.in(file("staging")). - withCommonSettings(Bootstrapped). - // We want the compiler to be present in the compiler classpath when compiling this project but not - // when compiling a project that depends on scala3-staging (see sbt-test/sbt-dotty/quoted-example-project), - // but we always need it to be present on the JVM classpath at runtime. - dependsOn(dottyCompiler(Bootstrapped) % "provided; compile->runtime; test->test"). - settings( - javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value - ) - lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler")) .withCommonSettings(Bootstrapped) .dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-library-bootstrapped-new`, `scala3-presentation-compiler-testcases` % "test->test") @@ -3927,7 +3916,7 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore). - bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, + bootstrappedAggregate(`scala3-language-server`, `scala3-library-bootstrappedJS`, scaladoc, `scala3-presentation-compiler`). dependsOn(tastyCore). dependsOn(dottyCompiler). From 3a66a0bf82a6a9343c136b1854a78b0b57a5bbab Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:46:33 +0100 Subject: [PATCH 08/19] remove old tasty-core [Cherry-picked 5fbab5d08676e5fe4bbbae96788324f0664c1730] --- build.sbt | 2 -- project/Build.scala | 23 +++-------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/build.sbt b/build.sbt index 021259dd9b95..7e1eb33a2e56 100644 --- a/build.sbt +++ b/build.sbt @@ -26,10 +26,8 @@ val `scala3-language-server` = Build.`scala3-language-server` //val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped` //val `scala3-bench-micro` = Build.`scala3-bench-micro` //val `scala3-bench-run` = Build.`scala3-bench-run` -val `tasty-core` = Build.`tasty-core` val `tasty-core-nonbootstrapped` = Build.`tasty-core-nonbootstrapped` val `tasty-core-bootstrapped-new` = Build.`tasty-core-bootstrapped-new` -val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped` val scaladoc = Build.scaladoc val `scaladoc-new` = Build.`scaladoc-new` val `scaladoc-testcases` = Build.`scaladoc-testcases` diff --git a/project/Build.scala b/project/Build.scala index 9d69f9f77d29..69d9b960a05a 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -1009,7 +1009,6 @@ object Build { Map( "scala3-interfaces" -> (`scala3-interfaces` / Compile / packageBin).value, "scala3-compiler" -> (Compile / packageBin).value, - "tasty-core" -> (`tasty-core` / Compile / packageBin).value, // NOTE: Using scala3-library-bootstrapped here is intentional: when // running the compiler, we should always have the bootstrapped @@ -1046,7 +1045,6 @@ object Build { packageAll := { (`scala3-compiler` / packageAll).value ++ Seq( "scala3-compiler" -> (Compile / packageBin).value.getAbsolutePath, - "tasty-core" -> (LocalProject("tasty-core-bootstrapped") / Compile / packageBin).value.getAbsolutePath, ) }, @@ -1574,7 +1572,7 @@ object Build { val dottyInterfaces = (`scala3-interfaces` / Compile / packageBin).value.getAbsolutePath.toString val dottyStaging = (`scala3-staging-new` / Compile / packageBin).value.getAbsolutePath.toString val dottyTastyInspector = (`scala3-tasty-inspector-new` / Compile / packageBin).value.getAbsolutePath.toString - val tastyCore = (`tasty-core-bootstrapped` / Compile / packageBin).value.getAbsolutePath.toString + val tastyCore = (`tasty-core-bootstrapped-new` / Compile / packageBin).value.getAbsolutePath.toString val asm = findArtifactPath(externalDeps, "scala-asm") val compilerInterface = findArtifactPath(externalDeps, "compiler-interface") extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm, dottyStaging, dottyTastyInspector, tastyCore, compilerInterface) @@ -2916,12 +2914,9 @@ object Build { scalacOptions += "-source:3.0-migration" ) - lazy val `tasty-core` = project.in(file("tasty")).asTastyCore(NonBootstrapped) - lazy val `tasty-core-bootstrapped`: Project = project.in(file("tasty")).asTastyCore(Bootstrapped) - def tastyCore(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `tasty-core` - case Bootstrapped => `tasty-core-bootstrapped` + case NonBootstrapped => `tasty-core-nonbootstrapped` + case Bootstrapped => `tasty-core-bootstrapped-new` } lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler")) @@ -3978,18 +3973,6 @@ object Build { } else base } - - def asTastyCore(implicit mode: Mode): Project = project.withCommonSettings. - dependsOn(dottyLibrary). - settings(tastyCoreSettings). - settings(disableDocSetting). - settings( - versionScheme := Some("semver-spec"), - Test / envVars ++= Map( - "EXPECTED_TASTY_VERSION" -> expectedTastyVersion, - ), - ) - /*def asDottyBench(implicit mode: Mode): Project = project.withCommonSettings. dependsOn(dottyCompiler). settings(commonBenchmarkSettings). From c40fb366daad68a3b0d88b4a469f68ddbb8bf00f Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:49:57 +0100 Subject: [PATCH 09/19] remove old bootstrapped compiler [Cherry-picked a4760bbbc7dfd3bd312d31480129fb5995a968ab] --- build.sbt | 1 - project/Build.scala | 29 ++++++----------------------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/build.sbt b/build.sbt index 7e1eb33a2e56..80457b0bcdd7 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,6 @@ val `scala3-interfaces` = Build.`scala3-interfaces` val `scala3-compiler` = Build.`scala3-compiler` val `scala3-compiler-nonbootstrapped` = Build.`scala3-compiler-nonbootstrapped` val `scala3-compiler-bootstrapped-new` = Build.`scala3-compiler-bootstrapped-new` -val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped` val `scala3-repl` = Build.`scala3-repl` val `scala-library-sjs` = Build.`scala-library-sjs` val `scala3-library-sjs` = Build.`scala3-library-sjs` diff --git a/project/Build.scala b/project/Build.scala index 69d9b960a05a..ee09c60d16d4 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -662,7 +662,7 @@ object Build { /** Projects -------------------------------------------------------------- */ - val dottyCompilerBootstrappedRef = LocalProject("scala3-compiler-bootstrapped") + val dottyCompilerBootstrappedRef = LocalProject("scala3-compiler-bootstrapped-new") /** External dependencies we may want to put on the compiler classpath. */ def externalCompilerClasspathTask: Def.Initialize[Task[Def.Classpath]] = @@ -1058,26 +1058,10 @@ object Build { lazy val `scala3-compiler` = project.in(file("compiler")).asDottyCompiler(NonBootstrapped) lazy val Scala3CompilerCoursierTest = config("scala3CompilerCoursierTest") extend Test - lazy val `scala3-compiler-bootstrapped` = project.in(file("compiler")).asDottyCompiler(Bootstrapped) - .configs(Scala3CompilerCoursierTest) - .settings( - inConfig(Scala3CompilerCoursierTest)(Defaults.testSettings), - Scala3CompilerCoursierTest / scalaSource := baseDirectory.value / "test-coursier", - Scala3CompilerCoursierTest / fork := true, - Scala3CompilerCoursierTest / envVars := Map("DOTTY_BOOTSTRAPPED_VERSION" -> dottyVersion), - Scala3CompilerCoursierTest / unmanagedClasspath += (Scala3CompilerCoursierTest / scalaSource).value, - Scala3CompilerCoursierTest / test := ((Scala3CompilerCoursierTest / test) dependsOn ( - publishLocal, // Had to enumarate all deps since calling `scala3-bootstrap` / publishLocal will lead to recursive dependency => stack overflow - `scala3-interfaces` / publishLocal, - dottyLibrary(Bootstrapped) / publishLocal, - tastyCore(Bootstrapped) / publishLocal, - ), - ).value, - ) def dottyCompiler(implicit mode: Mode): Project = mode match { case NonBootstrapped => `scala3-compiler` - case Bootstrapped => `scala3-compiler-bootstrapped` + case Bootstrapped => `scala3-compiler-bootstrapped-new` } // Settings shared between scala3-library, scala3-library-bootstrapped and scala3-library-bootstrappedJS @@ -2993,7 +2977,7 @@ object Build { } lazy val `scala3-presentation-compiler-testcases` = project.in(file("presentation-compiler-testcases")) - .dependsOn(`scala3-compiler-bootstrapped`) + .dependsOn(`scala3-compiler-bootstrapped-new`) .settings(commonBootstrappedSettings) lazy val `scala3-language-server` = project.in(file("language-server")). @@ -3009,7 +2993,7 @@ object Build { // Exclude the dependency that is resolved transively, the stdlib // is a project dependency instead excludeDependencies += "org.scala-lang" %% "scala3-library", - javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value, + javaOptions := (`scala3-compiler-bootstrapped-new` / javaOptions).value, ). settings( ideTestsCompilerVersion := (`scala3-compiler` / version).value, @@ -3392,7 +3376,7 @@ object Build { val generateReferenceDocumentation = inputKey[Unit]("Generate language reference documentation for Scala 3") lazy val `scaladoc-testcases` = project.in(file("scaladoc-testcases")). - dependsOn(`scala3-compiler-bootstrapped`). + dependsOn(`scala3-compiler-bootstrapped-new`). settings(commonBootstrappedSettings) @@ -3472,7 +3456,7 @@ object Build { lazy val scaladoc = project.in(file("scaladoc")). configs(SourceLinksIntegrationTest). settings(commonBootstrappedSettings). - dependsOn(`scala3-compiler-bootstrapped`). + dependsOn(`scala3-compiler-bootstrapped-new`). dependsOn(`scala3-tasty-inspector-new`). settings(inConfig(SourceLinksIntegrationTest)(Defaults.testSettings)). settings( @@ -3929,7 +3913,6 @@ object Build { // non-bootstrapped compiler), so publish the bootstrapped one by // default. addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"), - repl := (`scala3-compiler-bootstrapped` / repl).value, buildQuick := { val _ = (`scala3-compiler` / Compile / compile).value val cp = (`scala3-compiler` / Compile / fullClasspath).value.map(_.data.getAbsolutePath).mkString(File.pathSeparator) From 1ba37b0d032cc6c843ea7fb55a05fdd563faa9c2 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:52:14 +0100 Subject: [PATCH 10/19] remove old scala3 library for Scala.js [Cherry-picked 3cafb39b53c73056a4c9577dcf3ca495783a66e9] --- build.sbt | 1 - project/Build.scala | 51 ++------------------------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/build.sbt b/build.sbt index 80457b0bcdd7..8f9caaa00437 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,6 @@ val `scala-library-bootstrapped` = Build.`scala-library-bootstrapped` val `scala3-library-bootstrapped-new` = Build.`scala3-library-bootstrapped-new` val `scala3-library` = Build.`scala3-library` val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped` -val `scala3-library-bootstrappedJS` = Build.`scala3-library-bootstrappedJS` val `scala3-sbt-bridge-bootstrapped` = Build.`scala3-sbt-bridge-bootstrapped` val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped` val `scala3-staging-new` = Build.`scala3-staging-new` diff --git a/project/Build.scala b/project/Build.scala index ee09c60d16d4..d1457f58b039 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2852,52 +2852,6 @@ object Build { case Bootstrapped => `scala3-library-bootstrapped` } - /** The dotty standard library compiled with the Scala.js back-end, to produce - * the corresponding .sjsir files. - * - * This artifact must be on the classpath on every "Dotty.js" project. - * - * Currently, only a very small fraction of the dotty library is actually - * included in this project, and hence available to Dotty.js projects. More - * will be added in the future as things are confirmed to be supported. - */ - lazy val `scala3-library-bootstrappedJS`: Project = project.in(file("library-js")). - asDottyLibrary(Bootstrapped). - enablePlugins(DottyJSPlugin). - settings( - commonBootstrappedSettings, - libraryDependencies += - ("org.scala-js" %% "scalajs-library" % scalaJSVersion).cross(CrossVersion.for3Use2_13), - // NOTE: Until 3.8.0, we pin the source files to be used by the scala3 library - Compile / sources := (`scala3-library-bootstrapped` / Compile / sources).value, - Compile / sources ++= Seq( - file(s"${baseDirectory.value}/src/scala/scalajs/js/internal/UnitOps.scala"), - file(s"${baseDirectory.value}/src/scala/scalajs/runtime/AnonFunctionXXL.scala"), - ), - // NOTE: We keep this so that the mappings are correct when packaging - Compile / unmanagedSourceDirectories ++= - (`scala3-library-bootstrapped` / Compile / unmanagedSourceDirectories).value, - - // Configure the source maps to point to GitHub for releases - scalacOptions ++= { - if (isRelease) { - val baseURI = (LocalRootProject / baseDirectory).value.toURI - val dottyVersion = version.value - Seq(s"-scalajs-mapSourceURI:$baseURI->$dottyGithubRawUserContentUrl/$dottyVersion/") - } else { - Nil - } - }, - - // Make sure `scala3-bootstrapped/test` doesn't fail on this project for no reason - Test / test := {}, - Test / testOnly := {}, - ) - - lazy val tastyCoreSettings = Seq( - scalacOptions += "-source:3.0-migration" - ) - def tastyCore(implicit mode: Mode): Project = mode match { case NonBootstrapped => `tasty-core-nonbootstrapped` case Bootstrapped => `tasty-core-bootstrapped-new` @@ -3389,7 +3343,7 @@ object Build { */ lazy val `scaladoc-js-common` = project.in(file("scaladoc-js/common")). enablePlugins(DottyJSPlugin). - dependsOn(`scala3-library-bootstrappedJS`). + dependsOn(`scala3-library-sjs`). settings( commonBootstrappedSettings, libraryDependencies += ("org.scala-js" %%% "scalajs-dom" % "2.8.0")) @@ -3895,8 +3849,7 @@ object Build { // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore). - bootstrappedAggregate(`scala3-language-server`, - `scala3-library-bootstrappedJS`, scaladoc, `scala3-presentation-compiler`). + bootstrappedAggregate(`scala3-language-server`, scaladoc, `scala3-presentation-compiler`). dependsOn(tastyCore). dependsOn(dottyCompiler). dependsOn(dottyLibrary). From fea61fd7be8c2effbd305c3f1aeeb9dd20304f81 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:54:27 +0100 Subject: [PATCH 11/19] remove old scala3 library bootstrapped [Cherry-picked a749656e5165e507aa77e277c7b3ecb123936022] --- build.sbt | 1 - project/Build.scala | 149 ++------------------------------------------ 2 files changed, 5 insertions(+), 145 deletions(-) diff --git a/build.sbt b/build.sbt index 8f9caaa00437..a4541607ed5b 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,6 @@ val `scala3-library-nonbootstrapped` = Build.`scala3-library-nonbootstrapped` val `scala-library-bootstrapped` = Build.`scala-library-bootstrapped` val `scala3-library-bootstrapped-new` = Build.`scala3-library-bootstrapped-new` val `scala3-library` = Build.`scala3-library` -val `scala3-library-bootstrapped` = Build.`scala3-library-bootstrapped` val `scala3-sbt-bridge-bootstrapped` = Build.`scala3-sbt-bridge-bootstrapped` val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped` val `scala3-staging-new` = Build.`scala3-staging-new` diff --git a/project/Build.scala b/project/Build.scala index d1457f58b039..f31fd6e2426f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -635,12 +635,12 @@ object Build { (`scala3-compiler` / Compile / fullClasspathAsJars).value.map(_.data.toPath) ) - lazy val commonBenchmarkSettings = Seq( + /*lazy val commonBenchmarkSettings = Seq( Jmh / bspEnabled := false, Jmh / run / mainClass := Some("dotty.tools.benchmarks.Bench"), // custom main for jmh:run javaOptions += "-DBENCH_COMPILER_CLASS_PATH=" + Attributed.data((`scala3-bootstrapped` / Compile / fullClasspath).value).mkString("", File.pathSeparator, ""), javaOptions += "-DBENCH_CLASS_PATH=" + Attributed.data((`scala3-library-bootstrapped` / Compile / fullClasspath).value).mkString("", File.pathSeparator, "") - ) + )*/ lazy val commonMiMaSettings = Def.settings( mimaPreviousArtifacts += { @@ -1014,7 +1014,7 @@ object Build { // running the compiler, we should always have the bootstrapped // library on the compiler classpath since the non-bootstrapped one // may not be binary-compatible. - "scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value + //"scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value ).mapValues(_.getAbsolutePath) } }.value, @@ -1220,145 +1220,6 @@ object Build { file(s"${baseDirectory.value}/src/scala/runtime/VarArgsBuilder.scala"), ) ) - lazy val `scala3-library-bootstrapped`: Project = project.in(file("library")).asDottyLibrary(Bootstrapped) - .settings( - // Note: extracted using `print scala3-library-bootstrapped / Compile / sources` - // Only keep scala3 files until 3.8.0 - Compile / sources := Seq( - file(s"${baseDirectory.value}/src/scala/Precise.scala"), - file(s"${baseDirectory.value}/src/scala/CanEqual.scala"), - file(s"${baseDirectory.value}/src/scala/Conversion.scala"), - file(s"${baseDirectory.value}/src/scala/PolyFunction.scala"), - file(s"${baseDirectory.value}/src/scala/IArray.scala"), - file(s"${baseDirectory.value}/src/scala/CanThrow.scala"), - file(s"${baseDirectory.value}/src/scala/Tuple.scala"), - file(s"${baseDirectory.value}/src/scala/Selectable.scala"), - file(s"${baseDirectory.value}/src/scala/main.scala"), - file(s"${baseDirectory.value}/src/scala/NamedTuple.scala"), - file(s"${baseDirectory.value}/src/scala/util/FromDigits.scala"), - file(s"${baseDirectory.value}/src/scala/util/CommandLineParser.scala"), - file(s"${baseDirectory.value}/src/scala/util/TupledFunction.scala"), - file(s"${baseDirectory.value}/src/scala/util/NotGiven.scala"), - file(s"${baseDirectory.value}/src/scala/util/boundary.scala"), - file(s"${baseDirectory.value}/src/scala/caps/package.scala"), - file(s"${baseDirectory.value}/src/scala/caps/Pure.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/TypeTest.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/Selectable.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/Typeable.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/Enum.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TupleMirror.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TypeBox.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/Arrays.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TupledFunctions.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/FunctionXXL.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/Scala3RunTime.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/$$throws.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/LazyVals.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/EnumValue.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TupleXXL.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/Tuples.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/MatchCase.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/retains.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/capability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/static.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/transparentTrait.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/RefiningAnnotation.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/retainsByName.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/threadUnsafe.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/constructorOnly.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/experimental.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/MacroAnnotation.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/alpha.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/publicInBinary.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/init.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/unroll.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/targetName.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/stableNull.scala"), - file(s"${baseDirectory.value}/src/scala/deriving/Mirror.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/package.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Type.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Varargs.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Quotes.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Expr.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/ExprMap.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/FromExpr.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Exprs.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/ToExpr.scala"), - file(s"${baseDirectory.value}/src/scala/util/control/NonLocalReturns.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/stdLibPatches/language.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/stdLibPatches/Predef.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure8.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure10.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure4.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure5.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure11.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure9.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure2.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure20.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure16.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure17.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure3.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure21.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure18.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure22.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure0.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure14.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure15.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure1.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure19.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure12.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure6.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure7.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure13.java"), - file(s"${baseDirectory.value}/src/scala/runtime/coverage/Invoker.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/ErasedParam.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/RuntimeChecked.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/CaptureChecked.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/ContextResultCount.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/TASTYSignature.java"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Alias.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/MappedAlternative.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Repeated.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/WithPureFuns.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Child.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/ProvisionalSuperClass.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/WitnessNames.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/AssignedNonLocally.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/preview.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/InlineParam.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/SourceFile.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/reachCapability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/$$into.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/TASTYLongSignature.java"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/readOnlyCapability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/unshared.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/AnnotationDefault.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/sharable.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Body.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/requiresCapability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/unchecked/uncheckedCaptures.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/unchecked/uncheckedCapabilityLeaks.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/testing/Error.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/testing/ErrorKind.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/testing/package.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/long.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/any.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/int.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/string.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/double.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/boolean.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/float.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/QuoteUnpickler.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/QuoteMatching.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/Expr.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/Patterns.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/SplicedType.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/StopMacroExpansion.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/Erased.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/onlyCapability.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/VarArgsBuilder.scala"), - ) - ) // ============================================================================================== // ================================= NON-BOOTSTRAPPED PROJECTS ================================== @@ -2848,8 +2709,8 @@ object Build { ) def dottyLibrary(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `scala3-library` - case Bootstrapped => `scala3-library-bootstrapped` + case NonBootstrapped => `scala3-library-nonbootstrapped` + case Bootstrapped => `scala3-library-bootstrapped-new` } def tastyCore(implicit mode: Mode): Project = mode match { From eeccf364b350760478076dd2eca35e8f3d38add2 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 14:59:36 +0100 Subject: [PATCH 12/19] remove old aggregates [Cherry-picked 601b78f745076398f7fdd739cd1d651383807199] --- build.sbt | 4 ++-- project/Build.scala | 47 --------------------------------------------- 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/build.sbt b/build.sbt index a4541607ed5b..cb42670ea93e 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ -val scala3 = Build.scala3 +// Aggregate projects val `scala3-nonbootstrapped` = Build.`scala3-nonbootstrapped` -val `scala3-bootstrapped` = Build.`scala3-bootstrapped` val `scala3-bootstrapped-new` = Build.`scala3-bootstrapped-new` + val `scala3-interfaces` = Build.`scala3-interfaces` val `scala3-compiler` = Build.`scala3-compiler` val `scala3-compiler-nonbootstrapped` = Build.`scala3-compiler-nonbootstrapped` diff --git a/project/Build.scala b/project/Build.scala index f31fd6e2426f..38bca2341c07 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -671,13 +671,6 @@ object Build { // the compiler classpath, not the JVM classpath. (dottyCompilerBootstrappedRef / Runtime / externalDependencyClasspath) - // The root project: - // - aggregates other projects so that "compile", "test", etc are run on all projects at once. - // - publishes its own empty artifact "dotty" that depends on "scala3-library" and "scala3-compiler", - // this is only necessary for compatibility with sbt which currently hardcodes the "dotty" artifact name - lazy val scala3 = project.in(file(".")).asDottyRoot(NonBootstrapped) - lazy val `scala3-bootstrapped` = project.asDottyRoot(Bootstrapped) - lazy val `scala3-interfaces` = project.in(file("interfaces")). settings(commonJavaSettings). settings(commonMiMaSettings). @@ -3707,46 +3700,6 @@ object Build { implicit class ProjectDefinitions(val project: Project) extends AnyVal { - // FIXME: we do not aggregate `bin` because its tests delete jars, thus breaking other tests - def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings. - aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore). - bootstrappedAggregate(`scala3-language-server`, scaladoc, `scala3-presentation-compiler`). - dependsOn(tastyCore). - dependsOn(dottyCompiler). - dependsOn(dottyLibrary). - bootstrappedSettings( - addCommandAlias("clean", ";scala3-bootstrapped/clean"), - ). - nonBootstrappedSettings( - addCommandAlias("run", "scala3-compiler/run"), - // Clean everything by default - addCommandAlias("clean", ";scala3/clean;scala3-bootstrapped/clean"), - // `publishLocal` on the non-bootstrapped compiler does not produce a - // working distribution (it can't in general, since there's no guarantee - // that the non-bootstrapped library is compatible with the - // non-bootstrapped compiler), so publish the bootstrapped one by - // default. - addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"), - buildQuick := { - val _ = (`scala3-compiler` / Compile / compile).value - val cp = (`scala3-compiler` / Compile / fullClasspath).value.map(_.data.getAbsolutePath).mkString(File.pathSeparator) - IO.write(baseDirectory.value / "bin" / ".cp", cp) - }, - (Compile / console) := (Compile / console).dependsOn(Def.task { - import _root_.scala.io.AnsiColor._ - val msg = "`console` uses the reference Scala version. Use `repl` instead." - val f = "═" * (msg.length + 2) - val box = - s"""╔$f╗ - |║ ${BOLD}$msg$RESET ║ - |╚$f╝""".stripMargin - streams.value.log.warn(box) - }).value, - ). - settings( - publish / skip := true - ) - def asDottyCompiler(implicit mode: Mode): Project = project.withCommonSettings. dependsOn(`scala3-interfaces`). dependsOn(dottyLibrary). From 801c4d6fbcbaa4060fd866956dd9265b3fa7ceed Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 15:04:25 +0100 Subject: [PATCH 13/19] remove old scala3-compiler [Cherry-picked 481842cb96189144df383296cc1103785d15e542] --- build.sbt | 4 +++- project/Build.scala | 35 ++++------------------------------- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/build.sbt b/build.sbt index cb42670ea93e..559bfcc89783 100644 --- a/build.sbt +++ b/build.sbt @@ -3,9 +3,11 @@ val `scala3-nonbootstrapped` = Build.`scala3-nonbootstrapped` val `scala3-bootstrapped-new` = Build.`scala3-bootstrapped-new` val `scala3-interfaces` = Build.`scala3-interfaces` -val `scala3-compiler` = Build.`scala3-compiler` + +// Compiler projects val `scala3-compiler-nonbootstrapped` = Build.`scala3-compiler-nonbootstrapped` val `scala3-compiler-bootstrapped-new` = Build.`scala3-compiler-bootstrapped-new` + val `scala3-repl` = Build.`scala3-repl` val `scala-library-sjs` = Build.`scala-library-sjs` val `scala3-library-sjs` = Build.`scala3-library-sjs` diff --git a/project/Build.scala b/project/Build.scala index 38bca2341c07..be9efc232f7b 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -632,7 +632,7 @@ object Build { Compile / doc / scalacOptions ++= scalacOptionsDocSettings(), // force recompilation of bootstrapped modules when the compiler changes Compile / extraDevelocityCacheInputFiles ++= - (`scala3-compiler` / Compile / fullClasspathAsJars).value.map(_.data.toPath) + (`scala3-compiler-nonbootstrapped` / Compile / fullClasspathAsJars).value.map(_.data.toPath) ) /*lazy val commonBenchmarkSettings = Seq( @@ -1021,26 +1021,7 @@ object Build { (Test / javaOptions) += "-Xss2m" ) - lazy val bootstrappedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq( - javaOptions ++= { - val jars = packageAll.value - Seq( - "-Ddotty.tests.classes.dottyStaging=" + jars("scala3-staging"), - "-Ddotty.tests.classes.dottyTastyInspector=" + jars("scala3-tasty-inspector"), - ) - }, - // For compatibility at this moment, both the bootstrapped and the non-bootstrapped - // compilers are compiled without flexible types. - // We should move the flag to commonDottyCompilerSettings once the reference - // compiler is updated. - // Then, the next step is to enable flexible types by default and reduce the use of - // `unsafeNulls`. - packageAll := { - (`scala3-compiler` / packageAll).value ++ Seq( - "scala3-compiler" -> (Compile / packageBin).value.getAbsolutePath, - ) - }, - + lazy val bootstrappedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq( repl := (Compile / console).value, Compile / console / scalacOptions := Nil, // reset so that we get stock REPL behaviour! E.g. avoid -unchecked being enabled ) @@ -1048,12 +1029,10 @@ object Build { def dottyCompilerSettings(implicit mode: Mode): sbt.Def.SettingsDefinition = if (mode == NonBootstrapped) nonBootstrappedDottyCompilerSettings else bootstrappedDottyCompilerSettings - lazy val `scala3-compiler` = project.in(file("compiler")).asDottyCompiler(NonBootstrapped) - lazy val Scala3CompilerCoursierTest = config("scala3CompilerCoursierTest") extend Test def dottyCompiler(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `scala3-compiler` + case NonBootstrapped => `scala3-compiler-nonbootstrapped` case Bootstrapped => `scala3-compiler-bootstrapped-new` } @@ -2804,7 +2783,7 @@ object Build { javaOptions := (`scala3-compiler-bootstrapped-new` / javaOptions).value, ). settings( - ideTestsCompilerVersion := (`scala3-compiler` / version).value, + ideTestsCompilerVersion := (`scala3-compiler-nonbootstrapped` / version).value, ideTestsCompilerArguments := Seq(), ideTestsDependencyClasspath := { val scalaLib = (`scala-library-bootstrapped` / Compile / classDirectory).value @@ -3700,12 +3679,6 @@ object Build { implicit class ProjectDefinitions(val project: Project) extends AnyVal { - def asDottyCompiler(implicit mode: Mode): Project = project.withCommonSettings. - dependsOn(`scala3-interfaces`). - dependsOn(dottyLibrary). - dependsOn(tastyCore). - settings(dottyCompilerSettings) - def asDottyLibrary(implicit mode: Mode): Project = { val base = project .withCommonSettings From 5f21b4cad0e0a552ae9ccec15159da9929938d4f Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 13 Nov 2025 15:21:00 +0100 Subject: [PATCH 14/19] cleanups [Cherry-picked 3eb2321b06822b4657afda46f6429697c6330485] --- build.sbt | 8 +- project/Build.scala | 544 +------------------------------------- project/MiMaFilters.scala | 108 +------- 3 files changed, 10 insertions(+), 650 deletions(-) diff --git a/build.sbt b/build.sbt index 559bfcc89783..aedb04e93ec9 100644 --- a/build.sbt +++ b/build.sbt @@ -9,13 +9,15 @@ val `scala3-compiler-nonbootstrapped` = Build.`scala3-compiler-nonbootstrapped` val `scala3-compiler-bootstrapped-new` = Build.`scala3-compiler-bootstrapped-new` val `scala3-repl` = Build.`scala3-repl` -val `scala-library-sjs` = Build.`scala-library-sjs` -val `scala3-library-sjs` = Build.`scala3-library-sjs` + +// The Standard Library val `scala-library-nonbootstrapped` = Build.`scala-library-nonbootstrapped` val `scala3-library-nonbootstrapped` = Build.`scala3-library-nonbootstrapped` val `scala-library-bootstrapped` = Build.`scala-library-bootstrapped` val `scala3-library-bootstrapped-new` = Build.`scala3-library-bootstrapped-new` -val `scala3-library` = Build.`scala3-library` +val `scala-library-sjs` = Build.`scala-library-sjs` +val `scala3-library-sjs` = Build.`scala3-library-sjs` + val `scala3-sbt-bridge-bootstrapped` = Build.`scala3-sbt-bridge-bootstrapped` val `scala3-sbt-bridge-nonbootstrapped` = Build.`scala3-sbt-bridge-nonbootstrapped` val `scala3-staging-new` = Build.`scala3-staging-new` diff --git a/project/Build.scala b/project/Build.scala index be9efc232f7b..2516febe94c5 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -125,13 +125,6 @@ object Build { // LTS or Next val versionLine = "Next" - // Versions used by the vscode extension to create a new project - // This should be the latest published releases. - // TODO: Have the vscode extension fetch these numbers from the Internet - // instead of hardcoding them ? - val publishedDottyVersion = referenceVersion - val sbtDottyVersion = "0.5.5" - /** Minor version against which we check binary compatibility. * * This must be the earliest published release in the same versioning line. @@ -167,17 +160,6 @@ object Build { } } - /** scala-library version required to compile Dotty. - * - * Both the non-bootstrapped and bootstrapped version should match, unless - * we're in the process of upgrading to a new major version of - * scala-library. - */ - def stdlibVersion(implicit mode: Mode): String = mode match { - case NonBootstrapped => "2.13.16" - case Bootstrapped => "2.13.16" - } - /** Version of the scala-library for which we will generate TASTy. * * We should never use a nightly version here to release. @@ -190,19 +172,6 @@ object Build { val homepageUrl = "https://scala-lang.org/" val dottyOrganization = "org.scala-lang" val dottyGithubUrl = "https://github.com/scala/scala3" - val dottyGithubRawUserContentUrl = "https://raw.githubusercontent.com/scala/scala3" - - val sbtCommunityBuildVersion = "0.1.0-SNAPSHOT" - - val agentOptions = List( - // "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" - // "-agentpath:/home/dark/opt/yjp-2013-build-13072/bin/linux-x86-64/libyjpagent.so" - // "-agentpath:/Applications/YourKit_Java_Profiler_2015_build_15052.app/Contents/Resources/bin/mac/libyjpagent.jnilib", - // "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1g", "-Xss2m" - ) - - // Packages all subprojects to their jars - val packageAll = taskKey[Map[String, String]]("Package everything needed to run tests") // Run tests with filter through vulpix test suite val testCompilation = inputKey[Unit]("runs integration test with the supplied filter") @@ -210,16 +179,6 @@ object Build { // Used to compile files similar to ./bin/scalac script val scalac = inputKey[Unit]("run the compiler using the correct classpath, or the user supplied classpath") - // Used to run binaries similar to ./bin/scala script - val scala = inputKey[Unit]("run compiled binary using the correct classpath, or the user supplied classpath") - - val repl = taskKey[Unit]("spawns a repl with the correct classpath") - - val buildQuick = taskKey[Unit]("builds the compiler and writes the classpath to bin/.cp to enable the bin/scalacQ and bin/scalaQ scripts") - - // Compiles the documentation and static site - val genDocs = inputKey[Unit]("run scaladoc to generate static documentation site") - // Settings used to configure the test language server val ideTestsCompilerVersion = taskKey[String]("Compiler version to use in IDE tests") val ideTestsCompilerArguments = taskKey[Seq[String]]("Compiler arguments to use in IDE tests") @@ -345,7 +304,7 @@ object Build { PgpKeys.useGpgPinentry := true, // Do not cut off the bottom of large stack traces (default is 1024) - javaOptions ++= "-XX:MaxJavaStackTraceDepth=1000000" :: agentOptions, + javaOptions ++= "-XX:MaxJavaStackTraceDepth=1000000" :: Nil, excludeLintKeys ++= Set( // We set these settings in `commonSettings`, if a project @@ -416,25 +375,6 @@ object Build { ), ) - lazy val commonScala2Settings = commonSettings ++ Seq( - scalaVersion := stdlibVersion(Bootstrapped), - moduleName ~= { _.stripSuffix("-scala2") }, - version := dottyVersion, - target := baseDirectory.value / ".." / "out" / "scala-2" / name.value, - - disableDocSetting - ) - - // Settings used when compiling dotty with the reference compiler - lazy val commonNonBootstrappedSettings = commonDottySettings ++ Seq( - (Compile / unmanagedSourceDirectories) += baseDirectory.value / "src-non-bootstrapped", - - version := dottyNonBootstrappedVersion, - scalaVersion := referenceVersion, - - disableDocSetting - ) - private lazy val currentYear: String = java.util.Calendar.getInstance().get(java.util.Calendar.YEAR).toString private val shellBanner: String = @@ -660,17 +600,6 @@ object Build { mimaExcludeAnnotations += "scala.annotation.experimental", ) - /** Projects -------------------------------------------------------------- */ - - val dottyCompilerBootstrappedRef = LocalProject("scala3-compiler-bootstrapped-new") - - /** External dependencies we may want to put on the compiler classpath. */ - def externalCompilerClasspathTask: Def.Initialize[Task[Def.Classpath]] = - // Even if we're running the non-bootstrapped compiler, we want the - // dependencies of the bootstrapped compiler since we want to put them on - // the compiler classpath, not the JVM classpath. - (dottyCompilerBootstrappedRef / Runtime / externalDependencyClasspath) - lazy val `scala3-interfaces` = project.in(file("interfaces")). settings(commonJavaSettings). settings(commonMiMaSettings). @@ -754,445 +683,12 @@ object Build { recur(lines) } - // Settings shared between scala3-compiler and scala3-compiler-bootstrapped - lazy val commonDottyCompilerSettings = Seq( - // Note: bench/profiles/projects.yml should be updated accordingly. - Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Wsafe-init"), - - // TODO: Enable fatal warnings after 3.8 because old stdlib has different nullability. - Compile / scalacOptions -= "-Werror", - - // Use source 3.3 to avoid fatal migration warnings on scalajs-ir - scalacOptions ++= Seq("-source", "3.3"), - - /* Ignore a deprecation warning about AnyRefMap in scalajs-ir. The latter - * cross-compiles for 2.12, and therefore AnyRefMap remains useful there - * for performance reasons. - * The build of Scala.js core does the same thing. - */ - scalacOptions += "-Wconf:cat=deprecation&origin=scala\\.collection\\.mutable\\.AnyRefMap.*:s", - - // Generate compiler.properties, used by sbt - (Compile / resourceGenerators) += generateCompilerProperties.taskValue, - - // get libraries onboard - libraryDependencies ++= Seq( - "org.scala-lang.modules" % "scala-asm" % "9.9.0-scala-1", // used by the backend - Dependencies.compilerInterface, - ("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13), - ), - - // For convenience, change the baseDirectory when running the compiler - Compile / forkOptions := (Compile / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value), - Compile / run / forkOptions := (Compile / run / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value), - // And when running the tests - Test / forkOptions := (Test / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value), - - Test / test := { - // Exclude VulpixMetaTests - (Test / testOnly).toTask(" -- --exclude-categories=dotty.VulpixMetaTests").value - }, - - (Test / testOptions) += Tests.Argument( - TestFrameworks.JUnit, - "--run-listener=dotty.tools.ContextEscapeDetector", - ), - - // Spawn new JVM in run and test - - // Add git-hash used to package the distribution to the manifest to know it in runtime and report it in REPL - packageOptions += ManifestAttributes(("Git-Hash", VersionUtil.gitHash)), - - javaOptions ++= { - val log = streams.value.log - val managedSrcDir = { - // Populate the directory - (Compile / managedSources).value - - (Compile / sourceManaged).value - } - val externalDeps = externalCompilerClasspathTask.value - val jars = packageAll.value - - Seq( - "-Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir, - "-Ddotty.tests.classes.dottyInterfaces=" + jars("scala3-interfaces"), - "-Ddotty.tests.classes.dottyLibrary=" + jars("scala3-library"), - "-Ddotty.tests.classes.dottyCompiler=" + jars("scala3-compiler"), - "-Ddotty.tests.classes.tastyCore=" + jars("tasty-core"), - "-Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, "compiler-interface"), - "-Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, "scala-library"), - "-Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, "scala-asm"), - ) - }, - - javaOptions ++= Seq( - s"-Ddotty.tools.dotc.semanticdb.test=${(ThisBuild / baseDirectory).value/"tests"/"semanticdb"}", - ), - - testCompilation := Def.inputTaskDyn { - val args = spaceDelimited("").parsed - if (args.contains("--help")) { - println( - s""" - |usage: testCompilation [--help] [--from-tasty] [--update-checkfiles] [--failed] [] - | - |By default runs tests in dotty.tools.dotc.*CompilationTests and dotty.tools.dotc.coverage.*, - |excluding tests tagged with dotty.SlowTests. - | - | --help show this message - | --from-tasty runs tests in dotty.tools.dotc.FromTastyTests - | --update-checkfiles override the checkfiles that did not match with the current output - | --failed re-run only failed tests - | substring of the path of the tests file - | - """.stripMargin - ) - (Test / testOnly).toTask(" not.a.test") - } - else { - val updateCheckfile = args.contains("--update-checkfiles") - val rerunFailed = args.contains("--failed") - val fromTasty = args.contains("--from-tasty") - val args1 = if (updateCheckfile | fromTasty | rerunFailed) args.filter(x => x != "--update-checkfiles" && x != "--from-tasty" && x != "--failed") else args - val test = if (fromTasty) "dotty.tools.dotc.FromTastyTests" else "dotty.tools.dotc.*CompilationTests dotty.tools.dotc.coverage.*" - val cmd = s" $test -- --exclude-categories=dotty.SlowTests" + - (if (updateCheckfile) " -Ddotty.tests.updateCheckfiles=TRUE" else "") + - (if (rerunFailed) " -Ddotty.tests.rerunFailed=TRUE" else "") + - (if (args1.nonEmpty) " -Ddotty.tests.filter=" + args1.mkString(" ") else "") - (Test / testOnly).toTask(cmd) - } - }.evaluated, - - Compile / mainClass := Some("dotty.tools.dotc.Main"), - - scala := { - val args: List[String] = spaceDelimited("").parsed.toList - val externalDeps = externalCompilerClasspathTask.value - val jars = packageAll.value - - val argsWithDefaultClasspath: List[String] = - if (args.contains("-classpath")) args - else insertClasspathInArgs(args, (baseDirectory.value / ".." / "out" / "default-last-scalac-out.jar").getPath) - - val scalaLib = findArtifactPath(externalDeps, "scala-library") - val dottyLib = jars("scala3-library") - - def run(args: List[String]): Unit = { - val fullArgs = insertClasspathInArgs(args, List(".", dottyLib, scalaLib).mkString(File.pathSeparator)) - runProcess("java" :: fullArgs, wait = true) - } - - if (args.isEmpty) { - println("Couldn't run `scala` without args. Use `repl` to run the repl or add args to run the dotty application") - } else if (scalaLib == "") { - println("Couldn't find scala-library on classpath, please run using script in bin dir instead") - } else if (args.contains("-with-compiler")) { - val args1 = argsWithDefaultClasspath.filter(_ != "-with-compiler") - val asm = findArtifactPath(externalDeps, "scala-asm") - val dottyCompiler = jars("scala3-compiler") - val dottyStaging = jars("scala3-staging") - val dottyTastyInspector = jars("scala3-tasty-inspector") - val dottyInterfaces = jars("scala3-interfaces") - val tastyCore = jars("tasty-core") - val compilerInterface = findArtifactPath(externalDeps, "compiler-interface") - run(insertClasspathInArgs(args1, List(dottyCompiler, dottyInterfaces, asm, dottyStaging, dottyTastyInspector, tastyCore, compilerInterface).mkString(File.pathSeparator))) - } else run(argsWithDefaultClasspath) - }, - - run := scalac.evaluated, - scalac := Def.inputTaskDyn { - val log = streams.value.log - val externalDeps = externalCompilerClasspathTask.value - val jars = packageAll.value - val scalaLib = findArtifactPath(externalDeps, "scala-library") - val dottyLib = jars("scala3-library") - val dottyCompiler = jars("scala3-compiler") - val args0: List[String] = spaceDelimited("").parsed.toList - val decompile = args0.contains("-decompile") - val printTasty = args0.contains("-print-tasty") - val debugFromTasty = args0.contains("-Ythrough-tasty") - val defaultOutputDirectory = - if (printTasty || decompile || debugFromTasty || args0.contains("-d")) Nil else List("-d", (baseDirectory.value / ".." / "out" / "default-last-scalac-out.jar").getPath) - val args = args0.filter(arg => arg != "-repl" && arg != "-decompile" && - arg != "-with-compiler" && arg != "-Ythrough-tasty" && arg != "-print-tasty") - val main = - if (decompile) "dotty.tools.dotc.decompiler.Main" - else if (printTasty) "dotty.tools.dotc.core.tasty.TastyPrinter" - else if (debugFromTasty) "dotty.tools.dotc.fromtasty.Debug" - else "dotty.tools.dotc.Main" - - var extraClasspath = Seq(scalaLib, dottyLib) - - if (decompile && !args.contains("-classpath")) - extraClasspath ++= Seq(".") - - if (args0.contains("-with-compiler")) { - if (scalaVersion.value == referenceVersion) { - log.error("-with-compiler should only be used with a bootstrapped compiler") - } - val dottyInterfaces = jars("scala3-interfaces") - val dottyStaging = jars("scala3-staging") - val dottyTastyInspector = jars("scala3-tasty-inspector") - val tastyCore = jars("tasty-core") - val asm = findArtifactPath(externalDeps, "scala-asm") - val compilerInterface = findArtifactPath(externalDeps, "compiler-interface") - extraClasspath ++= Seq(dottyCompiler, dottyInterfaces, asm, dottyStaging, dottyTastyInspector, tastyCore, compilerInterface) - } - - val wrappedArgs = if (printTasty) args else insertClasspathInArgs(args, extraClasspath.mkString(File.pathSeparator)) - val fullArgs = main :: (defaultOutputDirectory ::: wrappedArgs).map("\""+ _ + "\"").map(_.replace("\\", "\\\\")) - - (Compile / runMain).toTask(fullArgs.mkString(" ", " ", "")) - }.evaluated, - - /* Add the sources of scalajs-ir. - * To guarantee that dotty can bootstrap without depending on a version - * of scalajs-ir built with a different Scala compiler, we add its - * sources instead of depending on the binaries. - */ - ivyConfigurations += SourceDeps.hide, - transitiveClassifiers := Seq("sources"), - libraryDependencies += - ("org.scala-js" %% "scalajs-ir" % scalaJSVersion % "sourcedeps").cross(CrossVersion.for3Use2_13), - (Compile / sourceGenerators) += Def.task { - val s = streams.value - val cacheDir = s.cacheDirectory - val trgDir = (Compile / sourceManaged).value / "scalajs-ir-src" - - val report = updateClassifiers.value - val scalaJSIRSourcesJar = report.select( - configuration = configurationFilter("sourcedeps"), - module = (_: ModuleID).name.startsWith("scalajs-ir_"), - artifact = artifactFilter(`type` = "src")).headOption.getOrElse { - sys.error(s"Could not fetch scalajs-ir sources") - } - - FileFunction.cached(cacheDir / s"fetchScalaJSIRSource", - FilesInfo.lastModified, FilesInfo.exists) { dependencies => - s.log.info(s"Unpacking scalajs-ir sources to $trgDir...") - if (trgDir.exists) - IO.delete(trgDir) - IO.createDirectory(trgDir) - IO.unzip(scalaJSIRSourcesJar, trgDir) - - val sjsSources = (trgDir ** "*.scala").get.toSet - sjsSources.foreach(f => { - val lines = IO.readLines(f) - val linesWithPackage = replacePackage(lines) { - case "org.scalajs.ir" => "dotty.tools.sjs.ir" - } - IO.writeLines(f, insertUnsafeNullsImport(linesWithPackage)) - }) - sjsSources - } (Set(scalaJSIRSourcesJar)).toSeq - }.taskValue, - ) - def insertClasspathInArgs(args: List[String], cp: String): List[String] = { val (beforeCp, fromCp) = args.span(_ != "-classpath") val classpath = fromCp.drop(1).headOption.fold(cp)(_ + File.pathSeparator + cp) "-classpath" :: classpath :: beforeCp ::: fromCp.drop(2) } - lazy val nonBootstrappedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq( - // packageAll packages all and then returns a map with the abs location - packageAll := Def.taskDyn { // Use a dynamic task to avoid loops when loading the settings - Def.task { - Map( - "scala3-interfaces" -> (`scala3-interfaces` / Compile / packageBin).value, - "scala3-compiler" -> (Compile / packageBin).value, - - // NOTE: Using scala3-library-bootstrapped here is intentional: when - // running the compiler, we should always have the bootstrapped - // library on the compiler classpath since the non-bootstrapped one - // may not be binary-compatible. - //"scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value - ).mapValues(_.getAbsolutePath) - } - }.value, - - (Test / testOptions) += Tests.Argument( - TestFrameworks.JUnit, - "--exclude-categories=dotty.BootstrappedOnlyTests", - ), - // increase stack size for non-bootstrapped compiler, because some code - // is only tail-recursive after bootstrap - (Test / javaOptions) += "-Xss2m" - ) - - lazy val bootstrappedDottyCompilerSettings = commonDottyCompilerSettings ++ Seq( - repl := (Compile / console).value, - Compile / console / scalacOptions := Nil, // reset so that we get stock REPL behaviour! E.g. avoid -unchecked being enabled - ) - - def dottyCompilerSettings(implicit mode: Mode): sbt.Def.SettingsDefinition = - if (mode == NonBootstrapped) nonBootstrappedDottyCompilerSettings else bootstrappedDottyCompilerSettings - - lazy val Scala3CompilerCoursierTest = config("scala3CompilerCoursierTest") extend Test - - def dottyCompiler(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `scala3-compiler-nonbootstrapped` - case Bootstrapped => `scala3-compiler-bootstrapped-new` - } - - // Settings shared between scala3-library, scala3-library-bootstrapped and scala3-library-bootstrappedJS - def dottyLibrarySettings(implicit mode: Mode) = Seq( - versionScheme := Some("semver-spec"), - libraryDependencies += "org.scala-lang" % "scala-library" % stdlibVersion, - (Compile / scalacOptions) ++= Seq( - // Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called - // NOTE: Do not use `sourceDirectories` since `sources` are currently pinned until `3.8.0` - "-sourcepath", (Compile / sources).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator), - "-Yexplicit-nulls", - ), - (Compile / doc / scalacOptions) ++= ScaladocConfigs.DefaultGenerationSettings.value.settings, - (Compile / packageSrc / mappings) ++= { - val auxBase = (ThisBuild / baseDirectory).value / "library-aux/src" - auxBase ** "*.scala" pair io.Path.relativeTo(auxBase) - }, - ) - - lazy val `scala3-library` = project.in(file("library")).asDottyLibrary(NonBootstrapped) - .settings( - // Note: extracted using `print scala3-library / Compile / sources` - // Only keep scala3 files until 3.8.0 - Compile / sources := Seq( - file(s"${baseDirectory.value}/src/scala/Precise.scala"), - file(s"${baseDirectory.value}/src/scala/CanEqual.scala"), - file(s"${baseDirectory.value}/src/scala/Conversion.scala"), - file(s"${baseDirectory.value}/src/scala/PolyFunction.scala"), - file(s"${baseDirectory.value}/src/scala/IArray.scala"), - file(s"${baseDirectory.value}/src/scala/CanThrow.scala"), - file(s"${baseDirectory.value}/src/scala/Tuple.scala"), - file(s"${baseDirectory.value}/src/scala/Selectable.scala"), - file(s"${baseDirectory.value}/src/scala/main.scala"), - file(s"${baseDirectory.value}/src/scala/NamedTuple.scala"), - file(s"${baseDirectory.value}/src/scala/util/FromDigits.scala"), - file(s"${baseDirectory.value}/src/scala/util/CommandLineParser.scala"), - file(s"${baseDirectory.value}/src/scala/util/TupledFunction.scala"), - file(s"${baseDirectory.value}/src/scala/util/NotGiven.scala"), - file(s"${baseDirectory.value}/src/scala/util/boundary.scala"), - file(s"${baseDirectory.value}/src/scala/caps/package.scala"), - file(s"${baseDirectory.value}/src/scala/caps/Pure.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/TypeTest.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/Selectable.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/Typeable.scala"), - file(s"${baseDirectory.value}/src/scala/reflect/Enum.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TupleMirror.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TypeBox.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/Arrays.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TupledFunctions.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/FunctionXXL.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/Scala3RunTime.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/$$throws.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/LazyVals.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/EnumValue.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/TupleXXL.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/Tuples.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/MatchCase.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/retains.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/capability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/static.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/transparentTrait.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/RefiningAnnotation.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/retainsByName.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/threadUnsafe.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/constructorOnly.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/experimental.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/MacroAnnotation.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/alpha.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/publicInBinary.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/init.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/unroll.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/targetName.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/stableNull.scala"), - file(s"${baseDirectory.value}/src/scala/deriving/Mirror.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/package.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Type.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Varargs.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Quotes.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Expr.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/ExprMap.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/FromExpr.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/Exprs.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/ToExpr.scala"), - file(s"${baseDirectory.value}/src/scala/util/control/NonLocalReturns.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/stdLibPatches/language.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/stdLibPatches/Predef.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure8.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure10.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure4.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure5.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure11.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure9.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure2.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure20.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure16.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure17.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure3.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure21.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure18.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure22.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure0.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure14.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure15.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure1.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure19.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure12.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure6.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure7.java"), - file(s"${baseDirectory.value}/src/scala/runtime/function/JProcedure13.java"), - file(s"${baseDirectory.value}/src/scala/runtime/coverage/Invoker.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/ErasedParam.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/RuntimeChecked.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/CaptureChecked.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/ContextResultCount.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/TASTYSignature.java"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Alias.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/MappedAlternative.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Repeated.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/WithPureFuns.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Child.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/ProvisionalSuperClass.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/WitnessNames.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/AssignedNonLocally.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/preview.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/InlineParam.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/SourceFile.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/reachCapability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/$$into.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/TASTYLongSignature.java"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/readOnlyCapability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/unshared.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/AnnotationDefault.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/sharable.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/Body.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/requiresCapability.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/unchecked/uncheckedCaptures.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/unchecked/uncheckedCapabilityLeaks.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/testing/Error.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/testing/ErrorKind.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/testing/package.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/long.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/any.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/int.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/string.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/double.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/boolean.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/ops/float.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/QuoteUnpickler.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/QuoteMatching.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/Expr.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/Patterns.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/SplicedType.scala"), - file(s"${baseDirectory.value}/src/scala/quoted/runtime/StopMacroExpansion.scala"), - file(s"${baseDirectory.value}/src/scala/compiletime/Erased.scala"), - file(s"${baseDirectory.value}/src/scala/annotation/internal/onlyCapability.scala"), - file(s"${baseDirectory.value}/src/scala/runtime/VarArgsBuilder.scala"), - ) - ) - // ============================================================================================== // ================================= NON-BOOTSTRAPPED PROJECTS ================================== // ============================================================================================== @@ -1441,7 +937,7 @@ object Build { scriptedBatchExecution := true, scriptedLaunchOpts ++= Seq( s"-Dplugin.scalaVersion=${dottyVersion}", - s"-Dplugin.scala2Version=${stdlibVersion(Bootstrapped)}", + s"-Dplugin.scala2Version=2.13.16", s"-Dplugin.scalaJSVersion=${scalaJSVersion}", ), scriptedBufferLog := true, @@ -2680,18 +2176,8 @@ object Build { }, ) - def dottyLibrary(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `scala3-library-nonbootstrapped` - case Bootstrapped => `scala3-library-bootstrapped-new` - } - - def tastyCore(implicit mode: Mode): Project = mode match { - case NonBootstrapped => `tasty-core-nonbootstrapped` - case Bootstrapped => `tasty-core-bootstrapped-new` - } - lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler")) - .withCommonSettings(Bootstrapped) + .settings(commonBootstrappedSettings) .dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-library-bootstrapped-new`, `scala3-presentation-compiler-testcases` % "test->test") .settings(presentationCompilerSettings) .settings(scala3PresentationCompilerBuildInfo) @@ -3342,7 +2828,7 @@ object Build { | @@ -3679,23 +3165,6 @@ object Build { implicit class ProjectDefinitions(val project: Project) extends AnyVal { - def asDottyLibrary(implicit mode: Mode): Project = { - val base = project - .withCommonSettings - .settings(dottyLibrarySettings) - if (mode == Bootstrapped) { - base.settings( - (Compile/doc) := { - // Workaround for - // [error] |object IArray cannot have the same name as object IArray in package scala - // -- cannot define object member with the same name as a object member in self reference _. - val doWork = (Compile/doc).result.value - (Compile/doc/target).value - }, - ) - } else base - } - /*def asDottyBench(implicit mode: Mode): Project = project.withCommonSettings. dependsOn(dottyCompiler). settings(commonBenchmarkSettings). @@ -3719,11 +3188,6 @@ object Build { target := baseDirectory.value / "target" // override setting in commonBootstrappedSettings )*/ - def withCommonSettings(implicit mode: Mode): Project = project.settings(mode match { - case NonBootstrapped => commonNonBootstrappedSettings - case Bootstrapped => commonBootstrappedSettings - }) - } /* Tests TASTy version invariants during NIGHLY, RC or Stable releases */ diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 42ba23cac480..4d180db5093b 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -34,83 +34,6 @@ object MiMaFilters { ProblemFilters.exclude[MissingClassProblem]("scala.caps.Control"), ), - // Additions since last LTS - Build.mimaPreviousLTSDottyVersion -> Seq( - ProblemFilters.exclude[MissingClassProblem]("scala.NamedTuple"), - ProblemFilters.exclude[MissingClassProblem]("scala.NamedTuple$"), - ProblemFilters.exclude[MissingClassProblem]("scala.NamedTupleDecomposition"), - ProblemFilters.exclude[MissingClassProblem]("scala.NamedTupleDecomposition$"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefMethods"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefTypeTest"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.FunctionClass"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.PolyFunctionClass"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#FlagsModule.AbsOverride"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.paramVariance"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeLambdaMethods.paramVariances"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.dealiasKeepOpaques"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.reverse"), - ProblemFilters.exclude[MissingClassProblem]("scala.annotation.publicInBinary"), - ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.AssignedNonLocally"), - ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.CaptureChecked"), - ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.reachCapability"), - ProblemFilters.exclude[MissingClassProblem]("scala.annotation.internal.preview"), - ProblemFilters.exclude[MissingClassProblem]("scala.annotation.unchecked.uncheckedCaptures"), - ProblemFilters.exclude[MissingClassProblem]("scala.quoted.Quotes$reflectModule$ValOrDefDefMethods"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E4$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E4$minusmigration$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E5$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E5$minusmigration$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$clauseInterleaving$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$relaxedExtensionImports$"), - ProblemFilters.exclude[MissingClassProblem]("scala.scalajs.runtime.AnonFunctionXXL"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.4-migration"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.4"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.5-migration"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.5"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.clauseInterleaving"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.relaxedExtensionImports"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E6$minusmigration$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.6-migration"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E6$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.6"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.annotation.experimental.this"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.compiletime.package#package.deferred"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.MethodTypeKind"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.FlexibleTypeTypeTest"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.FlexibleType"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule.FlexibleTypeMethods"), - ProblemFilters.exclude[MissingClassProblem]("scala.quoted.Quotes$reflectModule$FlexibleTypeMethods"), - ProblemFilters.exclude[MissingClassProblem]("scala.quoted.Quotes$reflectModule$FlexibleTypeModule"), - ProblemFilters.exclude[MissingClassProblem]("scala.quoted.Quotes$reflectModule$MethodTypeKind"), - ProblemFilters.exclude[MissingClassProblem]("scala.quoted.Quotes$reflectModule$MethodTypeKind$"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#MethodTypeMethods.isContextual"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#MethodTypeMethods.methodTypeKind"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#MethodTypeModule.apply"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.isSuperAccessor"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#ImplicitsModule.searchIgnoring"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Expr.summonIgnoring"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.runtime.Patterns.higherOrderHoleWithTypes"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.namedTuples"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.modularity"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.betterMatchTypeExtractors"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$betterMatchTypeExtractors$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$modularity$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$namedTuples$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.betterFors"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$betterFors$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.quotedPatternsWithPolymorphicFunctions"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$quotedPatternsWithPolymorphicFunctions$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language#experimental.packageObjectValues"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$experimental$packageObjectValues$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.7-migration"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.7"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E7$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E7$minusmigration$"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.8-migration"), - ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.8"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E8$"), - ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E8$minusmigration$"), - ), ) val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map( @@ -571,22 +494,6 @@ object MiMaFilters { // NO IDEA FOR NOW :) ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.collection.mutable.ArrayDequeOps.scala$collection$mutable$ArrayDequeOps$$super$sliding"), ), - - // Breaking changes since last LTS - Build.mimaPreviousLTSDottyVersion -> Seq( - // Quotes is assumed to only be implemented by the compiler and on the same version of the library. - // It is exceptionally OK to break this compatibility. In these cases, there add new abstract methods that would - // potentially not be implemented by others. If some other library decides to implement these, - // they need to recompile and republish on each minor release. - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefMethods"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule.ValOrDefDefTypeTest"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.FunctionClass"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#defnModule.PolyFunctionClass"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#FlagsModule.AbsOverride"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#SymbolMethods.paramVariance"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeLambdaMethods.paramVariances"), - ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.dealiasKeepOpaques"), - ), ) } @@ -597,10 +504,6 @@ object MiMaFilters { ProblemFilters.exclude[DirectMissingMethodProblem]("dotty.tools.tasty.TastyFormat.FLEXIBLEtype"), ProblemFilters.exclude[DirectMissingMethodProblem]("dotty.tools.tasty.TastyFormat.TRACKED"), ), - - // Additions since last LTS - Build.mimaPreviousLTSDottyVersion -> Seq( - ) ) val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map( @@ -611,8 +514,6 @@ object MiMaFilters { ProblemFilters.exclude[DirectMissingMethodProblem]("dotty.tools.tasty.TastyVersion.copy$default$2"), ProblemFilters.exclude[DirectMissingMethodProblem]("dotty.tools.tasty.TastyVersion.copy$default$3"), ), - // Breaking changes since last LTS - Build.mimaPreviousLTSDottyVersion -> Seq.empty // We should never break backwards compatibility ) } @@ -621,16 +522,9 @@ object MiMaFilters { // Additions that require a new minor version of interfaces Build.mimaPreviousDottyVersion -> Seq( ), - - // Additions since last LTS - Build.mimaPreviousLTSDottyVersion -> Seq( - ) ) - val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map( - // Breaking changes since last LTS - Build.mimaPreviousLTSDottyVersion -> Seq.empty // We should never break backwards compatibility - ) + val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map.empty } } From 66e053288393ef11b577dfbea7c6fb8f49e428bd Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 3 Dec 2025 13:38:18 +0100 Subject: [PATCH 15/19] drop MiMa against LTS. It was never checked... [Cherry-picked 05d079862afce1776b9fc5db39ca6c71c8ae4de6][modified] --- project/Build.scala | 8 -------- project/MiMaFilters.scala | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 2516febe94c5..b375813981cd 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -134,14 +134,6 @@ object Build { */ val mimaPreviousDottyVersion = "3.7.3" // for 3.8.0, we compare against 3.7.3 - /** LTS version against which we check binary compatibility. - * - * This must be the earliest published release in the LTS versioning line. - * For example, if the latest LTS release is be 3.3.4, then this must be - * set to 3.3.0. - */ - val mimaPreviousLTSDottyVersion = "3.3.0" - /** Version of Scala CLI to download */ val scalaCliLauncherVersion = "1.10.1" /** Version of Coursier to download for initializing the local maven repo of Scala command */ diff --git a/project/MiMaFilters.scala b/project/MiMaFilters.scala index 4d180db5093b..4c1cc71a67f4 100644 --- a/project/MiMaFilters.scala +++ b/project/MiMaFilters.scala @@ -497,6 +497,21 @@ object MiMaFilters { ) } + object ScalaLibrarySJS { + val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map( + // Additions that require a new minor version of the library + Build.mimaPreviousDottyVersion -> Seq( + // No .class files generated in the artifacts, only `scala.scalajs.*` files might be present + ProblemFilters.exclude[MissingClassProblem]("scala.*"), + ), + ) + + val BackwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map( + // We should never break backwards compatibility + Build.mimaPreviousDottyVersion -> Seq.empty, + ) + } + object TastyCore { val ForwardsBreakingChanges: Map[String, Seq[ProblemFilter]] = Map( // Additions that require a new minor version of tasty core From 5d4b8e22c21d848f617a2720933f41e80dfb9e5d Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Sun, 16 Nov 2025 12:03:07 +0100 Subject: [PATCH 16/19] remove dead code from old workflow [Cherry-picked 87254388b7d4fc162ceb9990fe9e1ef60c1c0f90] --- .github/workflows/ci.yaml | 176 +++++++++----------------------------- 1 file changed, 41 insertions(+), 135 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 52ffcf1ddcd6..3d6479833398 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,99 +51,6 @@ env: # text on stderr and so can break tests which check the output of a program). jobs: - test: - runs-on: [self-hosted, Linux] - container: - image: lampepfl/dotty:2024-10-18 - options: --cpu-shares 4096 - volumes: - - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "github.event_name == 'schedule' && github.repository == 'scala/scala3' - || github.event_name == 'push' - || github.event_name == 'merge_group' - || ( - github.event_name == 'pull_request' - && !contains(github.event.pull_request.body, '[skip ci]') - && !contains(github.event.pull_request.body, '[skip test]') - ) - || ( - github.event_name == 'workflow_dispatch' - && github.repository == 'scala/scala3' - )" - - steps: - - name: Set JDK 17 as default - run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH - - - name: Reset existing repo - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true - - - name: Checkout cleanup script - uses: actions/checkout@v5 - - - name: Cleanup - run: .github/workflows/cleanup.sh - - - name: Git Checkout - uses: actions/checkout@v5 - - - name: Add SBT proxy repositories - run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - - name: Cmd Tests - run: | - ./project/scripts/buildScalaBinary - ./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/publishLocal ;scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test" - ./project/scripts/cmdTests - ./project/scripts/bootstrappedOnlyCmdTests - - test_windows_fast: - runs-on: [self-hosted, Windows] - if: "( - github.event_name == 'push' - && github.ref != 'refs/heads/main' - ) - || github.event_name == 'merge_group' - || ( - github.event_name == 'pull_request' - && !contains(github.event.pull_request.body, '[skip ci]') - && !contains(github.event.pull_request.body, '[skip test_windows_fast]') - )" - - steps: - - name: Reset existing repo - shell: cmd - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true - - - name: Git Checkout - uses: actions/checkout@v5 - - - name: Test - run: sbt ";scala3-bootstrapped/compile" - shell: cmd - - #- name: build binary - # run: sbt "dist-win-x86_64/Universal/stage" & bash -version - # shell: cmd - - - name: cygwin tests - run: '"C:\Program Files\cygwin64\bin\bash" ./project/scripts/winCmdTests' - shell: cmd - - - name: msys tests - run: '"C:\Program Files\Git\bin\bash" ./project/scripts/winCmdTests' - shell: cmd - - - name: win tests - run: './project/scripts/winCmdTests.bat' - shell: cmd - test_windows_full: runs-on: [self-hosted, Windows] if: "github.event_name == 'schedule' && github.repository == 'scala/scala3' @@ -179,7 +86,6 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, build-sdk-package, build-msi-package] if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')" env: @@ -317,44 +223,44 @@ jobs: - name: Publish Release (org.scala-js) run: ./project/scripts/sbtPublish "clean; scala-library-sjs/publishSigned ;sonaUpload" - build-msi-package: - uses: ./.github/workflows/build-msi.yml - if : - (github.event_name == 'pull_request' && contains(github.event.pull_request.body, '[test_msi]')) || - (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) - - test-msi-package: - uses: ./.github/workflows/test-msi.yml - needs: [build-msi-package] - with: - # Ensure that version starts with prefix 3. - # In the future it can be adapted to compare with git tag or version set in the project/Build.scala - version: "3." - java-version: 17 - - build-sdk-package: - uses: ./.github/workflows/build-sdk.yml - if: - (github.event_name == 'pull_request' && !contains(github.event.pull_request.body, '[skip ci]')) || - (github.event_name == 'workflow_dispatch' && github.repository == 'scala/scala3') || - (github.event_name == 'schedule' && github.repository == 'scala/scala3') || - github.event_name == 'push' || - github.event_name == 'merge_group' - with: - java-version: 17 - - build-chocolatey-package: - uses: ./.github/workflows/build-chocolatey.yml - needs: [ build-sdk-package ] - with: - version: 3.6.0-SNAPSHOT # Fake version, used only for choco tests - url : https://api.github.com/repos/scala/scala3/actions/artifacts/${{ needs.build-sdk-package.outputs.win-x86_64-id }}/zip - digest : ${{ needs.build-sdk-package.outputs.win-x86_64-digest }} - - test-chocolatey-package: - uses: ./.github/workflows/test-chocolatey.yml - with: - version : 3.6.0-SNAPSHOT # Fake version, used only for choco tests - java-version: 17 - if: github.event_name == 'pull_request' && contains(github.event.pull_request.body, '[test_chocolatey]') - needs: [ build-chocolatey-package ] + #build-msi-package: + # uses: ./.github/workflows/build-msi.yml + # if : + # (github.event_name == 'pull_request' && contains(github.event.pull_request.body, '[test_msi]')) || + # (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')) + + #test-msi-package: + # uses: ./.github/workflows/test-msi.yml + # needs: [build-msi-package] + # with: + # # Ensure that version starts with prefix 3. + # # In the future it can be adapted to compare with git tag or version set in the project/Build.scala + # version: "3." + # java-version: 17 + + #build-sdk-package: + # uses: ./.github/workflows/build-sdk.yml + # if: + # (github.event_name == 'pull_request' && !contains(github.event.pull_request.body, '[skip ci]')) || + # (github.event_name == 'workflow_dispatch' && github.repository == 'scala/scala3') || + # (github.event_name == 'schedule' && github.repository == 'scala/scala3') || + # github.event_name == 'push' || + # github.event_name == 'merge_group' + # with: + # java-version: 17 + + #build-chocolatey-package: + # uses: ./.github/workflows/build-chocolatey.yml + # needs: [ build-sdk-package ] + # with: + # version: 3.6.0-SNAPSHOT # Fake version, used only for choco tests + # url : https://api.github.com/repos/scala/scala3/actions/artifacts/${{ needs.build-sdk-package.outputs.win-x86_64-id }}/zip + # digest : ${{ needs.build-sdk-package.outputs.win-x86_64-digest }} + + #test-chocolatey-package: + # uses: ./.github/workflows/test-chocolatey.yml + # with: + # version : 3.6.0-SNAPSHOT # Fake version, used only for choco tests + # java-version: 17 + # if: github.event_name == 'pull_request' && contains(github.event.pull_request.body, '[test_chocolatey]') + # needs: [ build-chocolatey-package ] From 44996166f756d30af63976a9f113a17321771a71 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Sun, 16 Nov 2025 12:11:20 +0100 Subject: [PATCH 17/19] fix: avoid fatal warning in `scaladoc-js` [Cherry-picked 82fd6441b074c9b8d11d1eee3a698582731c7924] --- scaladoc-js/contributors/src/Main.scala | 2 +- scaladoc-js/main/src/Main.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scaladoc-js/contributors/src/Main.scala b/scaladoc-js/contributors/src/Main.scala index 5260e11538e8..a20637aa797a 100644 --- a/scaladoc-js/contributors/src/Main.scala +++ b/scaladoc-js/contributors/src/Main.scala @@ -1,5 +1,5 @@ package dotty.tools.scaladoc import scala.scalajs.js.annotation._ -object Main extends App: +@main def Main = ContentContributors() diff --git a/scaladoc-js/main/src/Main.scala b/scaladoc-js/main/src/Main.scala index 79dce8dba88c..a4e26b2d104f 100644 --- a/scaladoc-js/main/src/Main.scala +++ b/scaladoc-js/main/src/Main.scala @@ -1,7 +1,7 @@ package dotty.tools.scaladoc import scala.scalajs.js.annotation._ -object Main extends App: +@main def Main = Searchbar() DropdownHandler() TooltipNormalizer() From edb2303e3f7987f6858365f95fde12954f61daee Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Sun, 16 Nov 2025 12:33:22 +0100 Subject: [PATCH 18/19] avoid fatal warning in `scaladoc-testcases` [Cherry-picked 7228cbbc84c7f817f34b2786044c468c9b82b0f5] --- scaladoc-testcases/src/tests/modifiersSignatureTestSource.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scaladoc-testcases/src/tests/modifiersSignatureTestSource.scala b/scaladoc-testcases/src/tests/modifiersSignatureTestSource.scala index 3cb250ae172b..8b749bfc67d4 100644 --- a/scaladoc-testcases/src/tests/modifiersSignatureTestSource.scala +++ b/scaladoc-testcases/src/tests/modifiersSignatureTestSource.scala @@ -20,7 +20,7 @@ abstract class Methods() def method1(): Unit inline def inlineMethod(): Unit - = Unit + = () implicit def toImplicitString(): String = "asd" From 34ea145d88afdd048104831f094b06ea840d29ae Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Wed, 3 Dec 2025 13:47:25 +0100 Subject: [PATCH 19/19] Restore removed dottyGithubRawUserContentUrl --- project/Build.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/project/Build.scala b/project/Build.scala index b375813981cd..4565e92cb2e1 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -164,6 +164,7 @@ object Build { val homepageUrl = "https://scala-lang.org/" val dottyOrganization = "org.scala-lang" val dottyGithubUrl = "https://github.com/scala/scala3" + val dottyGithubRawUserContentUrl = "https://raw.githubusercontent.com/scala/scala3" // Run tests with filter through vulpix test suite val testCompilation = inputKey[Unit]("runs integration test with the supplied filter")