Skip to content

Commit aff013e

Browse files
committed
chore: mark scala-library and scalajs-scalalib_2.13 as always instead of semver-spec
1 parent 746ebc8 commit aff013e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

project/Build.scala

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,12 @@ object Build {
16611661
name := "scala-library-nonbootstrapped",
16621662
moduleName := "scala-library",
16631663
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"),
16651670
scalaVersion := referenceVersion, // nonbootstrapped artifacts are compiled with the reference compiler (already officially published)
16661671
crossPaths := false, // org.scala-lang:scala-library doesn't have a crosspath
16671672
autoScalaLibrary := false, // do not add a dependency to stdlib
@@ -1736,7 +1741,12 @@ object Build {
17361741
name := "scala-library-bootstrapped",
17371742
moduleName := "scala-library",
17381743
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"),
17401750
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
17411751
// (not the actual version we use to compile the project)
17421752
scalaVersion := referenceVersion,
@@ -1851,7 +1861,12 @@ object Build {
18511861
// Yes, I know, this is weird and feels wrong.
18521862
moduleName := "scalajs-scalalib_2.13",
18531863
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"),
18551870
crossPaths := false,
18561871
// sbt defaults to scala 2.12.x and metals will report issues as it doesn't consider the project a scala 3 project
18571872
// (not the actual version we use to compile the project)

0 commit comments

Comments
 (0)