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

Option -Xprompt broken within interactive sbt sessions #22239

Open
bracevac opened this issue Dec 18, 2024 · 2 comments
Open

Option -Xprompt broken within interactive sbt sessions #22239

bracevac opened this issue Dec 18, 2024 · 2 comments
Labels
area:dx Issues tied to the developer experience when working on the compiler. area:tooling itype:bug

Comments

@bracevac
Copy link
Contributor

bracevac commented Dec 18, 2024

Compiler version

3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-4c76323

Minimized code

Passing -Xprompt allows us to interactively obtain the stacktrace when the compiler prints an error message (very very useful!). However, that does not work properly from within an sbt session, e.g., when working on the compiler itself. Say we have an erroneous program in foo.scala, and invoke scalac -Xprompt foo.scala:

-- [E103] Syntax Error: foo.scala:1:0 ------------------------------------
1 |"dumb"
  |^
  |Illegal start of toplevel definition
  |
  | longer explanation available when compiling with `-explain`

a)bort, s)tack, r)esume:

Output

With a precompiled scalac binary, it'll work fine (can press a, s, or r and it does its magic), but invoking the sbt task of the same name in the compiler code base will not accept any input.

Bonus: In a "decent" terminal emulator (e.g., iterm2) we can abort with ctrl-c, but using the VSCode builtin terminal (connecting with sbt --client to Metal's sbt instance), not even that will work and we are completely stuck (need to kill VSCode & orphan java processes left behind).

Expectation

It works from within an sbt session just the same as with the precompiled binary.

Edit: + it should also work with scala3-bootstrapped/scalac

@bracevac bracevac added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:dx Issues tied to the developer experience when working on the compiler. and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Dec 18, 2024
@bracevac
Copy link
Contributor Author

cc @hamzaremmal

@hamzaremmal
Copy link
Member

@odersky Here is the ticket for the issue that we discussed earlier today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dx Issues tied to the developer experience when working on the compiler. area:tooling itype:bug
Projects
None yet
Development

No branches or pull requests

3 participants