Skip to content

Commit

Permalink
add url to scala docs for tasty versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Nov 2, 2023
1 parent e013bde commit bfbd5e0
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 17 deletions.
8 changes: 6 additions & 2 deletions tasty/src/dotty/tools/tasty/TastyHeaderUnpickler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
val toolVersion = TastyVersion(toolMajor, toolMinor, toolExperimental)
val signature = signatureString(fileVersion, toolVersion, what = "backward", tool = None)
val fix = recompileFix(toolVersion.minStable)
throw new UnpickleException(signature + fix)
throw new UnpickleException(signature + fix + tastyAddendum)
}
else {
val fileMinor = readNat()
Expand Down Expand Up @@ -185,7 +185,7 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
}
else upgradeFix(fileVersion)
)
signature + fix
signature + fix + tastyAddendum
})

val uuid = new UUID(readUncompressedLong(), readUncompressedLong())
Expand Down Expand Up @@ -218,6 +218,10 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
val newTool = config.upgradedReaderTool(fileVersion)
s""" To read this ${fileVersion.kind} file, use $newTool.$addendum""".stripMargin
}

private def tastyAddendum: String = """
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}

object TastyHeaderUnpickler {
Expand Down
60 changes: 45 additions & 15 deletions tasty/test/dotty/tools/tasty/TastyHeaderUnpicklerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 3.4.0-RC1-bin-SNAPSHOT has a backward incompatible TASTy version 28.4-experimental-1,
| expected stable TASTy from 28.0 to 28.4.
| The source of this file should be recompiled by a Scala 3.4.0 compiler or newer.
| Usually this means that the library dependency containing this file should be updated.""".stripMargin
| Usually this means that the library dependency containing this file should be updated.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -66,7 +68,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 3.2.1-RC1-bin-SNAPSHOT has a backward incompatible TASTy version 28.3-experimental-1,
| expected stable TASTy from 28.0 to 28.4.
| The source of this file should be recompiled by a Scala 3.3.0 compiler or newer.
| Usually this means that the library dependency containing this file should be updated.""".stripMargin
| Usually this means that the library dependency containing this file should be updated.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -78,7 +82,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file has a backward incompatible TASTy version 27.3,
| expected stable TASTy from 28.0 to 28.3.
| The source of this file should be recompiled by a Scala 3.0.0 compiler or newer.
| Usually this means that the library dependency containing this file should be updated.""".stripMargin
| Usually this means that the library dependency containing this file should be updated.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -91,7 +97,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file has a backward incompatible TASTy version 27.3,
| expected stable TASTy from 28.0 to 28.3.
| The source of this file should be recompiled by a later version.
| Usually this means that the classpath entry of this file should be updated.""".stripMargin
| Usually this means that the classpath entry of this file should be updated.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -103,7 +111,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 3.3.3-RC1-NIGHTLY has a backward incompatible TASTy version 28.4-experimental-1,
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-2.
| The source of this file should be recompiled by the same nightly or snapshot Scala 3.3 compiler.
| Usually this means that the library dependency containing this file should be updated.""".stripMargin
| Usually this means that the library dependency containing this file should be updated.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -116,7 +126,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 3.3.3-RC1-NIGHTLY has a backward incompatible TASTy version 28.4-experimental-1,
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-2.
| The source of this file should be recompiled by a later version.
| Usually this means that the classpath entry of this file should be updated.""".stripMargin
| Usually this means that the classpath entry of this file should be updated.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -127,7 +139,9 @@ class TastyHeaderUnpicklerTest {
expectUnpickleError(runTest(file, read, "Scala 3.3.1")) {
"""TASTy file produced by Scala 3.3.1 has a forward incompatible TASTy version 28.3,
| expected stable TASTy from 28.0 to 28.2.
| To read this TASTy file, use a Scala 3.3.0 compiler or newer.""".stripMargin
| To read this TASTy file, use a Scala 3.3.0 compiler or newer.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -139,7 +153,9 @@ class TastyHeaderUnpicklerTest {
expectUnpickleError(runTest(file, read, "Scala 3.3.1", generic = true)) {
"""TASTy file produced by Scala 3.3.1 has a forward incompatible TASTy version 28.3,
| expected stable TASTy from 28.0 to 28.2.
| To read this TASTy file, use a newer version of this tool compatible with TASTy 28.3.""".stripMargin
| To read this TASTy file, use a newer version of this tool compatible with TASTy 28.3.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -151,7 +167,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 3.2.2-RC1-NIGHTLY has a forward incompatible TASTy version 28.3-experimental-1,
| expected stable TASTy from 28.0 to 28.2.
| To read this experimental TASTy file, use the same nightly or snapshot Scala 3.2 compiler.
| Note that you are using a stable compiler, which can not read experimental TASTy.""".stripMargin
| Note that you are using a stable compiler, which can not read experimental TASTy.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -162,7 +180,9 @@ class TastyHeaderUnpicklerTest {
expectUnpickleError(runTest(file, read, "Scala 4.0.0")) {
"""TASTy file produced by Scala 4.0.0 has a forward incompatible TASTy version 29.0,
| expected stable TASTy from 28.0 to 28.3.
| To read this TASTy file, use a more recent Scala compiler.""".stripMargin
| To read this TASTy file, use a more recent Scala compiler.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -174,7 +194,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 4.0.0-M1 has a forward incompatible TASTy version 29.0-experimental-1,
| expected stable TASTy from 28.0 to 28.3.
| To read this experimental TASTy file, use the same Scala compiler.
| Note that you are using a stable compiler, which can not read experimental TASTy.""".stripMargin
| Note that you are using a stable compiler, which can not read experimental TASTy.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -187,7 +209,9 @@ class TastyHeaderUnpicklerTest {
"""TASTy file produced by Scala 4.0.0-M1 has a forward incompatible TASTy version 29.0-experimental-1,
| expected stable TASTy from 28.0 to 28.3.
| To read this experimental TASTy file, use the version of this tool compatible with TASTy 29.0-experimental-1.
| Note that this tool does not support reading experimental TASTy.""".stripMargin
| Note that this tool does not support reading experimental TASTy.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -198,7 +222,9 @@ class TastyHeaderUnpicklerTest {
expectUnpickleError(runTest(file, read, "Scala 3.4.2")) {
"""TASTy file produced by Scala 3.4.2 has a forward incompatible TASTy version 28.4,
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-1.
| To read this TASTy file, use a Scala 3.4.0 compiler or newer.""".stripMargin
| To read this TASTy file, use a Scala 3.4.0 compiler or newer.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -209,7 +235,9 @@ class TastyHeaderUnpicklerTest {
expectUnpickleError(runTest(file, read, "Scala 3.3.3-RC2-NIGHTLY")) {
"""TASTy file produced by Scala 3.3.3-RC2-NIGHTLY has a forward incompatible TASTy version 28.4-experimental-2,
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-1.
| To read this experimental TASTy file, use the same nightly or snapshot Scala 3.3 compiler.""".stripMargin
| To read this experimental TASTy file, use the same nightly or snapshot Scala 3.3 compiler.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand All @@ -221,7 +249,9 @@ class TastyHeaderUnpicklerTest {
expectUnpickleError(runTest(file, read, "Scala 3.3.3-RC2-NIGHTLY", generic = true)) {
"""TASTy file produced by Scala 3.3.3-RC2-NIGHTLY has a forward incompatible TASTy version 28.4-experimental-2,
| expected stable TASTy from 28.0 to 28.3, or exactly 28.4-experimental-1.
| To read this experimental TASTy file, use the version of this tool compatible with TASTy 28.4-experimental-2.""".stripMargin
| To read this experimental TASTy file, use the version of this tool compatible with TASTy 28.4-experimental-2.
| Please refer to the documentation for information on TASTy versioning:
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
}
}

Expand Down

0 comments on commit bfbd5e0

Please sign in to comment.