Skip to content

Commit 5553862

Browse files
committed
Fix JLine dependencies
jline-$VERSION.jar is a bundle that contains the content of jline-terminal-$VERSION.jar and other modules. jline-terminal-jna depends on jline-terminal. This means that the Dotty build depends on both jline and jline-terminal and classfiles may be read from either jar (dependencies on the classpath are usually not in a stable order). They should be identical so it's not a big problem, but it breaks Zinc incremental compilation. This commit fixes this by not using the jline bundle jar anymore.
1 parent 9dd92a9 commit 5553862

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

compiler/test/dotty/Jars.scala

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,21 @@ object Jars {
2222
lazy val scalaXml: String =
2323
findJarFromRuntime("scala-xml")
2424

25-
/** JLine Jar */
26-
lazy val jline: String =
27-
findJarFromRuntime("jline-3.7.0")
25+
/** jline-terminal jar */
26+
lazy val jlineTerminal: String =
27+
findJarFromRuntime("jline-terminal-3.7.0")
28+
29+
/** jline-reader jar */
30+
lazy val jlineReader: String =
31+
findJarFromRuntime("jline-reader-3.7.0")
2832

2933
/** Dotty extras classpath from env or properties */
3034
val dottyExtras: List[String] = sys.env.get("DOTTY_EXTRAS")
3135
.map(_.split(":").toList).getOrElse(Properties.dottyExtras)
3236

3337
/** Dotty test dependencies */
3438
val dottyTestDeps: List[String] =
35-
dottyLib :: dottyCompiler :: dottyInterfaces :: jline :: dottyExtras
39+
dottyLib :: dottyCompiler :: dottyInterfaces :: jlineTerminal :: jlineReader :: dottyExtras
3640

3741
/** Dotty runtime with compiler dependencies, used for quoted.Expr.run */
3842
lazy val dottyRunWithCompiler: List[String] =

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class CompilationTests extends ParallelTesting {
205205
// as well as bootstrapped compiler:
206206
defaultOutputDir + dotty1Group + "/dotty/:" +
207207
// and the other compiler dependecies:
208-
Jars.dottyInterfaces + ":" + Jars.jline,
208+
Jars.dottyInterfaces + ":" + Jars.jlineTerminal + ":" + Jars.jlineReader,
209209
Array("-Ycheck-reentrant", "-Yemit-tasty-in-class")
210210
)
211211

dist/bin/common

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ SCALA_ASM=$(find_lib "*scala-asm*")
119119
SCALA_LIB=$(find_lib "*scala-library*")
120120
SCALA_XML=$(find_lib "*scala-xml*")
121121
SBT_INTF=$(find_lib "*compiler-interface*")
122-
JLINE=$(find_lib "*jline-3*")
122+
JLINE_READER=$(find_lib "*jline-reader-3*")
123123
JLINE_TERMINAL=$(find_lib "*jline-terminal-3*")
124124
JLINE_TERMINAL_JNA=$(find_lib "*jline-terminal-jna-3*")
125125

dist/bin/dotc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ classpathArgs () {
6666
toolchain+="$DOTTY_COMP$PSEP"
6767

6868
# jine
69-
toolchain+="$JLINE$PSEP"
69+
toolchain+="$JLINE_READER$PSEP"
7070
toolchain+="$JLINE_TERMINAL$PSEP"
7171
toolchain+="$JLINE_TERMINAL_JNA"
7272

project/Build.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,8 @@ object Build {
517517
("org.scala-lang.modules" %% "scala-xml" % "1.1.0").withDottyCompat(scalaVersion.value),
518518
"org.scala-lang" % "scala-library" % scalacVersion % "test",
519519
Dependencies.compilerInterface(sbtVersion.value),
520-
"org.jline" % "jline" % "3.7.0", // used by the REPL
520+
"org.jline" % "jline-reader" % "3.7.0", // used by the REPL
521+
"org.jline" % "jline-terminal" % "3.7.0",
521522
"org.jline" % "jline-terminal-jna" % "3.7.0" // needed for Windows
522523
),
523524

0 commit comments

Comments
 (0)