@@ -1661,7 +1661,12 @@ object Build {
1661
1661
name := " scala-library-nonbootstrapped" ,
1662
1662
moduleName := " scala-library" ,
1663
1663
version := dottyNonBootstrappedVersion,
1664
- versionScheme := Some (" semver-spec" ),
1664
+ // We mark the current library as "always" instead of "semver-spec" so that buildtools can
1665
+ // assume binary compatibility between 2.13.x and 3.x.y. If not set, build tools will, at least sbt,
1666
+ // will error by claiming that scala-library:2.13.x and 3.x.y are potentially binary incompatible.
1667
+ // Situation where we have 2.13.x and 3.x.y in the same dependency tree happens
1668
+ // because we allow cross-compilation.
1669
+ versionScheme := Some (" always" ),
1665
1670
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
1666
1671
crossPaths := false , // org.scala-lang:scala-library doesn't have a crosspath
1667
1672
autoScalaLibrary := false , // do not add a dependency to stdlib
@@ -1736,7 +1741,12 @@ object Build {
1736
1741
name := " scala-library-bootstrapped" ,
1737
1742
moduleName := " scala-library" ,
1738
1743
version := dottyVersion,
1739
- versionScheme := Some (" semver-spec" ),
1744
+ // We mark the current library as "always" instead of "semver-spec" so that buildtools can
1745
+ // assume binary compatibility between 2.13.x and 3.x.y. If not set, build tools will, at least sbt,
1746
+ // will error by claiming that scala-library:2.13.x and 3.x.y are potentially binary incompatible.
1747
+ // Situation where we have 2.13.x and 3.x.y in the same dependency tree happens
1748
+ // because we allow cross-compilation.
1749
+ versionScheme := Some (" always" ),
1740
1750
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1741
1751
// (not the actual version we use to compile the project)
1742
1752
scalaVersion := referenceVersion,
@@ -1851,7 +1861,12 @@ object Build {
1851
1861
// Yes, I know, this is weird and feels wrong.
1852
1862
moduleName := " scalajs-scalalib_2.13" ,
1853
1863
version := dottyVersion,
1854
- versionScheme := Some (" semver-spec" ),
1864
+ // We mark the current library as "always" instead of "semver-spec" so that buildtools can
1865
+ // assume binary compatibility between 2.13.x and 3.x.y. If not set, build tools will, at least sbt,
1866
+ // will error by claiming that scalajs-scalalib_2.13:2.13.x and 3.x.y are potentially binary incompatible.
1867
+ // Situation where we have 2.13.x and 3.x.y in the same dependency tree happens
1868
+ // because we allow cross-compilation.
1869
+ versionScheme := Some (" always" ),
1855
1870
crossPaths := false ,
1856
1871
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
1857
1872
// (not the actual version we use to compile the project)
0 commit comments