scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bloop compilation seems to fail

andyczerwonka opened this issue · comments

Describe the bug

I've been having a lot more issues with the latest version of Metals, and I think it could be something related to Bloop. The bloop compiler seems to hang, so to test that theory, I installed the Bloop CLI and tried to compile. Sure enough, it hangs on one of the projects. Metals eventually loses it's connection to the Bloop server, and when I reconnect, it starts again.

2024.05.05 12:43:22 INFO  Disconnecting from Bloop session...
2024.05.05 12:43:22 INFO  Shut down connection with build server.

When I run it manually, I get the following:

bloop compile datasvc                                                                                                                                                                                                                                                                                                         
Deduplicating compilation of datasvc from bsp client 'Metals 1.3.0' (since 2m 50.149s)
Compiling datasvc (4 Scala sources)
[W] Disconnecting from deduplication of ongoing compilation for 'datasvc'
[W] No progress update for 30 seconds caused bloop to cancel compilation and schedule a new compile.
[W]
Compiling datasvc (4 Scala sources)

I've attached the reports, which will hopefully give some insight.

reports.zip

Expected behavior

I unfortunately have to move to the sbt server to get to a point where I can run a test. Under bloop, compilation never really completes and I'm therefor in a broken state. The sbt server is very slow, but at least I can compile and run tests.

I would like Bloop as my server because it used to work well, but it no longer does.

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.3

Extra context or search terms

No response

Thanks for the report, you can explicitly choose bloop version in metals settings and downgrade to previous version as a temporary solution.

Deduplicating compilation of datasvc from bsp client 'Metals 1.3.0' (since 2m 50.149s)
Compiling datasvc (4 Scala sources)

Looks like maybe it's an issue we could reproduce with a minimal amount of files? Would you be able to share those that cause the compilation to hang? Also does downgrading to previous bloop help.

I did get it to finish... it seems to take a very long time.

Compiling datasvc (4 Scala sources)
Compiled datasvc (1126729ms)

~18 minutes

Tested using Bloop 1.5.16... no change. I colleague is using JDK 17 and getting better results - I'll try that.

After more research, we introduced a defect that caused the compilation to slow down significantly. While it was exaggerated under Bloop, the defect was local to our code and not a defect in either Bloop or Metals. Apologies for the false alarm.

No worries, it's better to report even if it turns out the problem lays elsewhere. Any idea why the problem was worse in Bloop?

No worries, it's better to report even if it turns out the problem lays elsewhere. Any idea why the problem was worse in Bloop?

I don't yet know what part of the PR (not mine) created the problem, but once I find out I will post it here.