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

Scala-cli run command incorrectly reports Fatal invariant violated. #2829

Closed
dasm0012 opened this issue Mar 30, 2024 · 5 comments · Fixed by #2837
Closed

Scala-cli run command incorrectly reports Fatal invariant violated. #2829

dasm0012 opened this issue Mar 30, 2024 · 5 comments · Fixed by #2837
Labels
Bloop Issues tied with Bloop integration. bug Something isn't working

Comments

@dasm0012
Copy link

Version(s)
Scala CLI version: 1.2.1
Scala version (default): 3.4.1
Scala 3.4.1, JVM (22)
WSL/Ubuntu

Describe the bug
When repeatedly executing scala-cli run command on a file that hasn't changed, scala-cli reports "Error: Fatal invariant violated: reportEndCompilation was called before processEndCompilation" - but still executes the scala file
image

To Reproduce
Create simple scala file (e.g. Hello World in main function)
Execute: scala-cli run ./hello.scala => works as expected
Execute again (no changes in hello.scala file): scala-cli run ./hello.scala => Fatal invariant is reported

Expected behaviour
No fatal invariant is reported

@dasm0012 dasm0012 added the bug Something isn't working label Mar 30, 2024
@spamegg1
Copy link
Contributor

I reported the same to Metals, I guess it belongs here, or to Bloop maybe?

scalameta/metals#6266

@Gedochao
Copy link
Contributor

Gedochao commented Apr 2, 2024

This seems to be the same issue as scalameta/metals#6271
For now the workaround is to revert to using an older version of Bloop (1.5.12-sc-1)

scala-cli clean .
scala-cli --power bloop exit
scala-cli setup-ide . --bloop-version 1.5.12-sc-1

The issue itself is most definitely tied to Bloop and will be fixed upstream.

@spamegg1
Copy link
Contributor

spamegg1 commented Apr 2, 2024

The issue itself is most definitely tied to Bloop and will be fixed upstream.

Shall we open an issue there? I don't see one related. Which Bloop version introduced the problem?

@Gedochao
Copy link
Contributor

Gedochao commented Apr 2, 2024

@spamegg1 No need to introduce an issue, I think, it can be tracked here.
@tgodzik is already working on it in scalacenter/bloop#2306
It will then need to be ported to our fork of Bloop at https://github.com/scala-cli/bloop-core
The version which introduced the problem is 1.5.16-sc-1.

@dasm0012
Copy link
Author

Thank you for the very quick workaround + resolution :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bloop Issues tied with Bloop integration. bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants