New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
console
does not work with Scala 2.13.13, sbt 1.9.8
#7502
Comments
console
does not work with Scala 2.13.13 with sbt 1.9.8console
does not work with Scala 2.13.13, sbt 1.9.8
gah, this is bad. attn @eed3si9n @lrytz over in scala/scala we merged the JLine 3.24.1 upgrade all the way back in October 2023, but of course it's common for nobody to notice a regression in nightlies, even over a period of months. and obviously the community build is no help with interactive stuff like this Eugene, let's discuss, is this remediable in the sbt 1.9.x series, or do we have to try to get to 1.10.0 soon, or what? |
It works on my machine with sbt 1.10.0-M1: sbt:foo> console
[info] Starting scala interpreter...
Welcome to Scala 2.13.13 (OpenJDK 64-Bit Server VM, Java 1.8.0_362).
Type in expressions for evaluation. Or try :help.
scala> 1 + 1
val res0: Int = 2 |
Oh btw, thanks @xuwei-k for reporting this! 🙏🏼 |
Whew. Any chance of accelerating the progression to 1.10.0-RC1 and 1.10.0 final? Is that progression waiting on anything in particular? |
Or I guess we can just backport the JLine bump to 1.9.x series. At this point, the odds of it potentially breaking more things can be balanced with the fact that latest stable Scala 2.13.x can't console on sbt 1.9.x. |
Here's my PR - #7503 |
Suits me!! |
yeah, but it's still on us (scala/scala), we should have the most basic smoke test somewhere. |
good news is you can pipe a command from stdin: $ echo "sys.exit()" | sbt console
[info] welcome to sbt 1.9.8 (Azul Systems, Inc. Java 1.8.0_352)
....
[info] Starting scala interpreter...
Welcome to Scala 2.13.13 (OpenJDK 64-Bit Server VM, Java 1.8.0_352).
Type in expressions for evaluation. Or try :help.
Failed to initialize compiler: NoSuchMethodError.
This is most often remedied by a full clean and recompile.
Otherwise, your classpath may continue bytecode compiled by
different and incompatible versions of scala.
java.lang.NoSuchMethodError: org.jline.utils.AttributedString.fromAnsi(Ljava/lang/String;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;)Lorg/jline/utils/AttributedString;
at org.jline.reader.impl.LineReaderImpl.fromAnsi(LineReaderImpl.java:4232)
at org.jline.reader.impl.LineReaderImpl.expandPromptPattern(LineReaderImpl.java:4154)
at org.jline.reader.impl.LineReaderImpl.setPrompt(LineReaderImpl.java:1253)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:628)
at org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:512)
at scala.tools.nsc.interpreter.jline.Reader.readOneLine(Reader.scala:44)
at scala.tools.nsc.interpreter.shell.InteractiveReader.readLine(InteractiveReader.scala:38)
at scala.tools.nsc.interpreter.shell.InteractiveReader.readLine$(InteractiveReader.scala:38)
at scala.tools.nsc.interpreter.jline.Reader.readLine(Reader.scala:34)
at scala.tools.nsc.interpreter.shell.ILoop.readOneLine(ILoop.scala:455)
at scala.tools.nsc.interpreter.shell.ILoop.loop(ILoop.scala:460)
at scala.tools.nsc.interpreter.shell.ILoop.run(ILoop.scala:993)
at scala.tools.xsbt.ConsoleBridge.run(ConsoleBridge.scala:81)
at sbt.internal.inc.AnalyzingCompiler.console(AnalyzingCompiler.scala:208)
at sbt.Console.console0$1(Console.scala:65)
at sbt.Console.$anonfun$apply$5(Console.scala:75)
at sbt.Run$.executeSuccess(Run.scala:187)
at sbt.Console.$anonfun$apply$4(Console.scala:75)
at sbt.internal.util.Terminal.withRawInput(Terminal.scala:146)
at sbt.internal.util.Terminal.withRawInput$(Terminal.scala:144)
at sbt.internal.util.Terminal$ProxyTerminal$.withRawInput(Terminal.scala:424)
at sbt.Console.$anonfun$apply$3(Console.scala:75)
at sbt.internal.util.Terminal$DefaultTerminal.withRawOutput(Terminal.scala:1074)
at sbt.internal.util.Terminal$ProxyTerminal$.withRawOutput(Terminal.scala:463)
at sbt.Console.apply(Console.scala:72)
at sbt.Console.apply(Console.scala:50)
at sbt.Console.apply(Console.scala:42)
at sbt.Defaults$.$anonfun$consoleTask$1(Defaults.scala:2237)
at sbt.Defaults$.$anonfun$consoleTask$1$adapted(Defaults.scala:2223)
at scala.Function1.$anonfun$compose$1(Function1.scala:49)
at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
at sbt.std.Transform$$anon$4.work(Transform.scala:69)
at sbt.Execute.$anonfun$submit$2(Execute.scala:283)
at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
at sbt.Execute.work(Execute.scala:292)
at sbt.Execute.$anonfun$submit$1(Execute.scala:283)
at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
[success] Total time: 7 s, completed Feb 23, 2024 2:32:40 AM bad news is that
|
same result with sbt 1.5.7 😢 |
@eed3si9n do you know how the mechanics are working here? Why isn't the newer jline version being used as the runtime classpath? This can't be the scala version "mediator". It could just be selectively picking the scala jars to pull in, ignoring the other transitive dependencies metadata, like jline version. Or could it be some classloader or classloading layering issue. Do you know? |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [sbt/sbt](https://togithub.com/sbt/sbt) | patch | `1.9.8` -> `1.9.9` | --- ### Release Notes <details> <summary>sbt/sbt (sbt/sbt)</summary> ### [`v1.9.9`](https://togithub.com/sbt/sbt/releases/tag/v1.9.9): 1.9.9 [Compare Source](https://togithub.com/sbt/sbt/compare/v1.9.8...v1.9.9) #### Bug fixes - To fix `console` task on Scala 2.13.13, sbt 1.9.9 backports updates to JLine 3.24.1 and JAnsi 2.4.0 by [@​hvesalai](https://togithub.com/hvesalai) in [sbt/sbt#7503 / [sbt/sbt#7502 - To fix sbt 1.9.8's `UnsatisfiedLinkError` with `stat`, sbt 1.9.9 removes native code that was used to get the millisecond-precision timestamp that was broken ([JDK-8177809](https://bugs.openjdk.org/browse/JDK-8177809)) on JDK 8 prior to [OpenJDK 8u302](https://mail.openjdk.org/pipermail/jdk8u-dev/2021-July/014118.html) by [@​eed3si9n](https://togithub.com/eed3si9n) in [sbt/io#367 **Full Changelog**: sbt/sbt@v1.9.8...v1.9.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/slick/slick). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Yea. We exclude JLine from the layered classloader unless sbt/main/src/main/scala/sbt/Defaults.scala Lines 669 to 672 in 48c2376
This is because JLine and JAnsi basically loads native libraries, and unlike other JVM libraries we haven't have multiple versions in one process space. My mental model of sbtn is like what I imagine the way telnet works, in a sense that the client program captures all keyboard inputs like There's further complication that happened for Scala 3, I think because they use compiler-interface, so #6199 changed the layered Classloader further, but the idea is the same. Maybe a better solution would be to let sbtn fork its own |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [sbt/sbt](https://togithub.com/sbt/sbt) | patch | `1.9.8` -> `1.9.9` | --- ### Release Notes <details> <summary>sbt/sbt (sbt/sbt)</summary> ### [`v1.9.9`](https://togithub.com/sbt/sbt/releases/tag/v1.9.9): 1.9.9 [Compare Source](https://togithub.com/sbt/sbt/compare/v1.9.8...v1.9.9) #### Bug fixes - To fix `console` task on Scala 2.13.13, sbt 1.9.9 backports updates to JLine 3.24.1 and JAnsi 2.4.0 by [@​hvesalai](https://togithub.com/hvesalai) in [sbt/sbt#7503 / [sbt/sbt#7502 - To fix sbt 1.9.8's `UnsatisfiedLinkError` with `stat`, sbt 1.9.9 removes native code that was used to get the millisecond-precision timestamp that was broken ([JDK-8177809](https://bugs.openjdk.org/browse/JDK-8177809)) on JDK 8 prior to [OpenJDK 8u302](https://mail.openjdk.org/pipermail/jdk8u-dev/2021-July/014118.html) by [@​eed3si9n](https://togithub.com/eed3si9n) in [sbt/io#367 **Full Changelog**: sbt/sbt@v1.9.8...v1.9.9 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cwienberg/spark-sorting-helpers). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI2MS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
steps
build.sbt
run
sbt console
problem
expectation
notes
The text was updated successfully, but these errors were encountered: