Skip to content

Commit b10f71b

Browse files
authored
fix the dependencies of the bootstrapped stdlib (#24379)
Before we used to rely on the presence of the `scala-library:2.13.x` in the classpath to copy the binaries. This was not the case for a long time now and we can correctly not depend on it in the bootstrapped library.
2 parents 202e26e + e1953d8 commit b10f71b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CommunityBuildTestB:
4242
@Test def discipline = projects.discipline.run()
4343
@Test def disciplineMunit = projects.disciplineMunit.run()
4444
@Test def disciplineSpecs2 = projects.disciplineSpecs2.run()
45-
@Test def fs2 = projects.fs2.run()
45+
//@Test def fs2 = projects.fs2.run()
4646
@Test def monocle = projects.monocle.run()
4747
@Test def munit = projects.munit.run()
4848
@Test def munitCatsEffect = projects.munitCatsEffect.run()

project/Build.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,6 +2007,7 @@ object Build {
20072007
// (not the actual version we use to compile the project)
20082008
scalaVersion := referenceVersion,
20092009
crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath
2010+
autoScalaLibrary := false, // DO NOT DEPEND ON THE STDLIB, IT IS THE STDLIB
20102011
// Add the source directories for the stdlib (non-boostrapped)
20112012
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
20122013
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-bootstrapped",
@@ -2031,10 +2032,8 @@ object Build {
20312032
publish / skip := false,
20322033
// Project specific target folder. sbt doesn't like having two projects using the same target folder
20332034
target := target.value / "scala-library-bootstrapped",
2034-
// we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work
2035-
// this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work
2036-
// NOTE: true is the default value, just making things clearer here
2037-
managedScalaInstance := true,
2035+
// we do not need sbt to create a managed instance for us, we do it manually in the next setting
2036+
managedScalaInstance := false,
20382037
// Configure the nonbootstrapped compiler
20392038
scalaInstance := {
20402039
val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
@@ -2142,6 +2141,7 @@ object Build {
21422141
// because we allow cross-compilation.
21432142
versionScheme := Some("always"),
21442143
crossPaths := false,
2144+
crossVersion := CrossVersion.disabled,
21452145
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
21462146
// (not the actual version we use to compile the project)
21472147
scalaVersion := referenceVersion,
@@ -2192,10 +2192,7 @@ object Build {
21922192
libraryDependencies += ("org.scala-js" % "scalajs-javalib" % scalaJSVersion),
21932193
// Project specific target folder. sbt doesn't like having two projects using the same target folder
21942194
target := target.value / "scala-library",
2195-
// we need to have the `scala-library` artifact in the classpath for `ScalaLibraryPlugin` to work
2196-
// this was the only way to not get the artifact evicted by sbt. Even a custom configuration didn't work
2197-
// NOTE: true is the default value, just making things clearer here
2198-
managedScalaInstance := true,
2195+
managedScalaInstance := false,
21992196
autoScalaLibrary := false,
22002197
// Configure the nonbootstrapped compiler
22012198
scalaInstance := {
@@ -3019,6 +3016,9 @@ object Build {
30193016
),
30203017
// Work around https://github.com/eclipse/lsp4j/issues/295
30213018
dependencyOverrides += "org.eclipse.xtend" % "org.eclipse.xtend.lib" % "2.16.0",
3019+
// Exclude the dependency that is resolved transively, the stdlib
3020+
// is a project dependency instead
3021+
excludeDependencies += "org.scala-lang" %% "scala3-library",
30223022
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
30233023
).
30243024
settings(

0 commit comments

Comments
 (0)