Skip to content

Commit 67351cb

Browse files
committed
add url to scala docs for tasty versioning
1 parent a6c5b17 commit 67351cb

File tree

2 files changed

+51
-17
lines changed

2 files changed

+51
-17
lines changed

tasty/src/dotty/tools/tasty/TastyHeaderUnpickler.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
137137
val toolVersion = TastyVersion(toolMajor, toolMinor, toolExperimental)
138138
val signature = signatureString(fileVersion, toolVersion, what = "backward", tool = None)
139139
val fix = recompileFix(toolVersion.minStable)
140-
throw new UnpickleException(signature + fix)
140+
throw new UnpickleException(signature + fix + tastyAddendum)
141141
}
142142
else {
143143
val fileMinor = readNat()
@@ -185,7 +185,7 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
185185
}
186186
else upgradeFix(fileVersion)
187187
)
188-
signature + fix
188+
signature + fix + tastyAddendum
189189
})
190190

191191
val uuid = new UUID(readUncompressedLong(), readUncompressedLong())
@@ -218,6 +218,10 @@ class TastyHeaderUnpickler(config: UnpicklerConfig, reader: TastyReader) {
218218
val newTool = config.upgradedReaderTool(fileVersion)
219219
s""" To read this ${fileVersion.kind} file, use $newTool.$addendum""".stripMargin
220220
}
221+
222+
private def tastyAddendum: String = """
223+
| Please refer to the documentation for information on TASTy versioning:
224+
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
221225
}
222226

223227
object TastyHeaderUnpickler {

tasty/test/dotty/tools/tasty/TastyHeaderUnpicklerTest.scala

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class TastyHeaderUnpicklerTest {
5454
"""TASTy file produced by Scala 3.4.0-RC1-bin-SNAPSHOT has a backward incompatible TASTy version 28.4-experimental-1,
5555
| expected stable TASTy from 28.0 to 28.4.
5656
| The source of this file should be recompiled by a Scala 3.4.0 compiler or newer.
57-
| Usually this means that the library dependency containing this file should be updated.""".stripMargin
57+
| Usually this means that the library dependency containing this file should be updated.
58+
| Please refer to the documentation for information on TASTy versioning:
59+
| https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html""".stripMargin
5860
}
5961
}
6062

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)