From dc5c608f58f40d5c32b07769afa6ee1b37e2b8a2 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Tue, 11 Nov 2025 19:05:28 +0100 Subject: [PATCH 1/4] fix: fix the dependencies of the bootstrapped stdlib --- project/Build.scala | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index cddf225f3475..962e54c0cdc9 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2007,6 +2007,7 @@ object Build { // (not the actual version we use to compile the project) scalaVersion := referenceVersion, crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath + autoScalaLibrary := false, // DO NOT DEPEND ON THE STDLIB, IT IS THE STDLIB // Add the source directories for the stdlib (non-boostrapped) Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"), Compile / unmanagedSourceDirectories += baseDirectory.value / "src-bootstrapped", @@ -2031,10 +2032,8 @@ object Build { publish / skip := false, // Project specific target folder. sbt doesn't like having two projects using the same target folder target := target.value / "scala-library-bootstrapped", - // we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work - // this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work - // NOTE: true is the default value, just making things clearer here - managedScalaInstance := true, + // we do not need sbt to create a managed instance for us, we do it manually in the next setting + managedScalaInstance := false, // Configure the nonbootstrapped compiler scalaInstance := { val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet @@ -2192,10 +2191,7 @@ object Build { libraryDependencies += ("org.scala-js" % "scalajs-javalib" % scalaJSVersion), // Project specific target folder. sbt doesn't like having two projects using the same target folder target := target.value / "scala-library", - // we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work - // this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work - // NOTE: true is the default value, just making things clearer here - managedScalaInstance := true, + managedScalaInstance := false, autoScalaLibrary := false, // Configure the nonbootstrapped compiler scalaInstance := { From be8547ad8a6d6881cf83edb3fe439233ef77ddad Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Wed, 12 Nov 2025 13:10:50 +0100 Subject: [PATCH 2/4] fix: exclude the transitive dependency to `scala3-library` in `scala3-language-server` sbt doesn't evict a library dependency if it has the same dependency as a project --- project/Build.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project/Build.scala b/project/Build.scala index 962e54c0cdc9..e100fbbecf00 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -3015,6 +3015,9 @@ object Build { ), // Work around https://github.com/eclipse/lsp4j/issues/295 dependencyOverrides += "org.eclipse.xtend" % "org.eclipse.xtend.lib" % "2.16.0", + // 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, ). settings( From 39a41cbaa1aa0ed6194fac1c141c73bdf00d0b7d Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Wed, 12 Nov 2025 14:29:15 +0100 Subject: [PATCH 3/4] fix: Scala.js stdlib should not have an artifact name ending with `_sjs1_3` This broke when we added the a dependency to the `DottyJSPlugin` --- project/Build.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/project/Build.scala b/project/Build.scala index e100fbbecf00..7f390bb4f4a7 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2141,6 +2141,7 @@ object Build { // because we allow cross-compilation. versionScheme := Some("always"), crossPaths := false, + crossVersion := CrossVersion.disabled, // sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project // (not the actual version we use to compile the project) scalaVersion := referenceVersion, From e1953d846c2c788e6c745eca12cf9ec883364fe3 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Wed, 12 Nov 2025 15:07:47 +0100 Subject: [PATCH 4/4] chore: disable `fs2`, it suffers from #22890 --- .../test/scala/dotty/communitybuild/CommunityBuildTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 0a5a1205b903..ae1217635662 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -42,7 +42,7 @@ class CommunityBuildTestB: @Test def discipline = projects.discipline.run() @Test def disciplineMunit = projects.disciplineMunit.run() @Test def disciplineSpecs2 = projects.disciplineSpecs2.run() - @Test def fs2 = projects.fs2.run() + //@Test def fs2 = projects.fs2.run() @Test def monocle = projects.monocle.run() @Test def munit = projects.munit.run() @Test def munitCatsEffect = projects.munitCatsEffect.run()