scala-dev icon indicating copy to clipboard operation
scala-dev copied to clipboard

REPL: `scala` task in scala/scala repo broken in recent sbt versions

Open SethTisue opened this issue 4 years ago • 12 comments
trafficstars

the usual workaround is dist/mkQuick, then go out to the shell and ./build/quick/bin/scala

of course you can also publishLocal and then use the published version from sbt or scala-cli or whatever

~Dotty is in the same boat~ (not anymore)

see https://github.com/sbt/sbt/pull/6185

there is a suggestion in 6185 I can try to see if it helps

UPDATE: in February 2024 we merged a PR that greatly improved the situation, but things aren't always quite right yet; see below

SethTisue avatar Dec 08 '20 23:12 SethTisue

workaround is dist/mkQuick, then go out to the shell and ./build/quick/bin/scala

SethTisue avatar Dec 09 '20 21:12 SethTisue

The current status on 2.13.x is that it works but without most JLine features.

You get:

WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)

That's with sbt 1.4.9, and the situation is the same with 1.5.0-RC1.

That's tons better than "doesn't work", but still tons worse than actually fully working.

See also the inconclusive experiment/discussion at https://github.com/scala/scala/pull/9380

SethTisue avatar Mar 17 '21 18:03 SethTisue

In practice, what I do to test REPL changes is dist/mkQuick (in sbt) followed by ./build/quick/bin/scala (from the shell).

SethTisue avatar Oct 27 '21 00:10 SethTisue

unassigning myself since I don't seem sufficiently motivated to dig into it

SethTisue avatar Sep 08 '22 00:09 SethTisue

The current status on 2.13.x is that it works but without most JLine features.

I thought upgrading to sbt 1.10.0-M1 might fix that, since sbt version upgrades their own JLine from 3.19 to 3.24.1... but no, it doesn't help.

SethTisue avatar Feb 21 '24 01:02 SethTisue

https://github.com/jline/jline3/commit/d4bf37c75641b6a1d10135611b169d555e0b9e55 suggests that-Dorg.jline.terminal.output=forced-out might help

SethTisue avatar Feb 21 '24 01:02 SethTisue

scala/scala#10695 does hugely improve the situation, but I notice that paren and brace matching is messed up — when you type the closing brace, both braces disappear 😭

so I think the ticket should remain open even after we merge that PR

SethTisue avatar Feb 21 '24 02:02 SethTisue

Braceless syntax arrives in Scala 2.

som-snytt avatar Feb 21 '24 02:02 som-snytt

Another fine reason not to mention tickets in commits. They act at a distance.

som-snytt avatar Feb 21 '24 08:02 som-snytt

What the hell happened? 🤔

joroKr21 avatar Feb 21 '24 08:02 joroKr21

Ahh, rebase and push to my fork?

joroKr21 avatar Feb 21 '24 08:02 joroKr21

Braceless syntax arrives in Scala 2.

Better brace ourselves.

Jasper-M avatar Feb 21 '24 12:02 Jasper-M

upgrading JLine from 3.24.1 to 3.25.1 in Scala 2 itself (https://github.com/scala/scala/pull/10717) did not improve the situation in my testing, but it's conceivable that once https://github.com/sbt/sbt/pull/7500 also lands something might change 🤷

SethTisue avatar Mar 16 '24 11:03 SethTisue

image

som-snytt avatar Mar 16 '24 21:03 som-snytt