mirror of https://github.com/sbt/sbt.git
Commit 92b0564dc (fix for #8632) changed `csrSameVersions` so that Scala 2.13+ only aligned `scala-library` and `scala3-library`. This removed `scala-compiler` and `scala-reflect` from version
unification, so transitive dependencies pulling in an older `scala-compiler` (e.g. 2.13.15 via `refined_2.13`) were no longer evicted to match `scalaVersion` (e.g. 2.13.18).
This commit is contained in:
parent
4e0180d759
commit
772f616a29
|
|
@ -3151,16 +3151,24 @@ object Classpaths {
|
|||
}).value),
|
||||
csrSameVersions ++= {
|
||||
partialVersion(scalaVersion.value) match {
|
||||
case Some((major, minor)) if major == 2 && minor < 13 =>
|
||||
// See https://github.com/sbt/sbt/issues/8689
|
||||
// Scala 2.x should align all Scala 2 artifacts (scala-library, scala-compiler, scala-reflect, etc.)
|
||||
case Some((major, _)) if major == 2 =>
|
||||
ScalaArtifacts.Artifacts
|
||||
.map(a => InclExclRule(scalaOrganization.value, a))
|
||||
.toSet :: Nil
|
||||
// Due to the Scala 2.13-3.x sandwich, the absence of scala-reflect
|
||||
// that corresponds with scala-library 3.8.x propagates to 2.13 builds as well.
|
||||
case _ =>
|
||||
// Scala 3.0-3.7 uses the Scala 2.13 standard library, so align all Scala 2 artifacts
|
||||
case Some((3, minor)) if minor < 8 =>
|
||||
ScalaArtifacts.Artifacts
|
||||
.map(a => InclExclRule(scalaOrganization.value, a))
|
||||
.toSet :: Nil
|
||||
// Scala 3.8+ has its own scala-library, only align library artifacts
|
||||
// See https://github.com/sbt/sbt/issues/8224
|
||||
case Some((3, _)) =>
|
||||
ScalaArtifacts.Scala3_8Artifacts
|
||||
.map(a => InclExclRule(scalaOrganization.value, a))
|
||||
.toSet :: Nil
|
||||
case _ => Nil
|
||||
}
|
||||
},
|
||||
moduleName := normalizedName.value,
|
||||
|
|
|
|||
|
|
@ -1 +1,3 @@
|
|||
> update
|
||||
# Scala 3.8+ no longer supports being included into Scala 2.13 classpath
|
||||
> a/update
|
||||
-> b/update
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ import sbt.librarymanagement.InclExclRule
|
|||
lazy val a = project.settings(
|
||||
scalaVersion := "2.13.11",
|
||||
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
|
||||
TaskKey[Unit]("checkLibs") := checkLibs("2.13.11", (Compile/dependencyClasspath).value, ".*scala-library.*"),
|
||||
TaskKey[Unit]("checkLibs") := checkLibs("2.13.11", (Compile/dependencyClasspath).value, ".*scala-(library|reflect).*"),
|
||||
)
|
||||
|
||||
lazy val b = project.dependsOn(a).settings(
|
||||
scalaVersion := "2.13.12",
|
||||
TaskKey[Unit]("checkLibs") := checkLibs("2.13.12", (Compile/dependencyClasspath).value, ".*scala-library.*"),
|
||||
TaskKey[Unit]("checkLibs") := checkLibs("2.13.12", (Compile/dependencyClasspath).value, ".*scala-(library|reflect).*"),
|
||||
)
|
||||
|
||||
lazy val a3 = project.settings(
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ $ delete s2.13.14.txt
|
|||
# without the default `csrSameVersions`, scala-reflect in b stays at 2.13.11
|
||||
> set b/csrSameVersions := Nil
|
||||
> b/update
|
||||
-> b/checkLibs
|
||||
|
||||
> ak/checkLibs
|
||||
|
|
|
|||
Loading…
Reference in New Issue