Skip to content
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

REPL: JLine 3: fix various issues #8848

Merged
merged 7 commits into from Apr 6, 2020
Merged

Conversation

@scala-jenkins scala-jenkins added this to the 2.13.3 milestone Mar 31, 2020
@SethTisue SethTisue modified the milestones: 2.13.3, 2.13.2 Mar 31, 2020
@SethTisue SethTisue added the tool:REPL Changes in the Scala REPL Interpreter label Mar 31, 2020
@dwijnand
Copy link
Member

dwijnand commented Mar 31, 2020

I'm pretty sure I've seen support around REPL replaying (SessionTest iirc). Isn't the fix for scala/scala-dev#705 testable?

@SethTisue
Copy link
Member Author

Isn't the fix for scala/scala-dev#705 testable?

The problem was specifically when connected to an actual terminal.

Whether session replaying is now perfect, I don't know, my ambitions were limited (for now anyway) to fixing the immediate blocker that prevented it from working at all (on a real terminal).

@h-vetinari
Copy link

h-vetinari commented Apr 2, 2020

Has someone reached out to the spark maintainers about the (impact of the) JLine 3 changes / issues? It's 10 month after the release of 2.13.0, and they are still blocked on upgrading to 2.13 (and that despite @martijnhoekstra working tirelessly through the twitter dependency stack). One of the specific blockers is the REPL interaction, so it would IMO be a pity if something that's needed for spark-on-2.13 were to narrowly miss 2.13.2, and it would be another 4-6 month until they'd be unblocked by the following point release.

@lrytz
Copy link
Member

lrytz commented Apr 2, 2020

Example that doesn't work in :paste -raw with the current tip of this PR:

Welcome to Scala 2.13.2-20200402-045016-1060b72 (Java HotSpot(TM) 64-Bit GraalVM EE 19.2.1, Java 1.8.0_231).
Type in expressions for evaluation. Or try :help.

scala> :paste -raw
// Entering paste mode (ctrl-D to finish)

package pa {
  object T
}

package pu {
  object U
}

java.lang.IllegalArgumentException: requirement failed: wordCursor 2 should be in range TokenData(105,51,52,false)
	at scala.tools.nsc.interpreter.jline.Reader$ScalaParsedLine.<init>(Reader.scala:176)

@lrytz
Copy link
Member

lrytz commented Apr 2, 2020

@h-vetinari we haven't done cross-testing with spark because there is no 2.13 spark branch currently that we could use for that, so there is really no good way for us to test this. The only thing I could imagine is back-porting the JLine 3 upgrade to 2.12, but there are older refactorings in the REPL codebase in 2.13 which are much more likely to affect how spark integrates the REPL.

That said, we are eager to work with spark contributors on the 2.13 upgrade as soon as possible. We have chimed in on many of the 2.13-related tickets already. But as you note, the upgrade is currently blocked on issues outside our reach.

@h-vetinari
Copy link

@lrytz
Yeah, I wasn't talking about testing the JLine 3 things on spark yourselves, but maybe someone from the spark-maintainers would be able to immediately identify additional blocking issues among the remaining ones, for example.

It was just a thought; in any case, I think they'd very likely respond to a ping on GH/JIRA.

@SethTisue
Copy link
Member Author

Example that doesn't work in :paste -raw with the current tip of this PR

@lrytz weird... I'm not able to reproduce the problem

@lrytz
Copy link
Member

lrytz commented Apr 2, 2020

@lrytz weird... I'm not able to reproduce the problem

Hah, it seems to be unrelated to the code I posted, instead a trailing space trips it up. When I type class C then return in :paste mode I get

class C
java.lang.IllegalArgumentException: requirement failed: wordCursor 2 should be in range TokenData(10,6,7,true)
	at scala.tools.nsc.interpreter.jline.Reader$ScalaParsedLine.<init>(Reader.scala:176)
	at scala.tools.nsc.interpreter.jline.Reader$ScalaParser.tokenize(Reader.scala:157)

@SethTisue
Copy link
Member Author

@lrytz ah, good catch, fixed.

@SethTisue
Copy link
Member Author

SethTisue commented Apr 5, 2020

This doesn't fix every last blocker, but I think it's about time to get this stuff merged, for wider testing.

@som-snytt do you have the time+inclination to do the review honors...?

(review from others is of course welcome as well!)

@SethTisue
Copy link
Member Author

(rebased, no other changes)

@SethTisue SethTisue merged commit 018d78b into scala:2.13.x Apr 6, 2020
@SethTisue SethTisue deleted the jline3-fixes branch April 6, 2020 20:01
@SethTisue
Copy link
Member Author

SethTisue commented Apr 6, 2020

merging, so we'll all be testing this. review feedback remains welcome

@h-vetinari h-vetinari mentioned this pull request Apr 23, 2020
59 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tool:REPL Changes in the Scala REPL Interpreter
Projects
None yet
5 participants