scalacenter / bloop

Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool.
https://scalacenter.github.io/bloop/
Apache License 2.0
909 stars 201 forks source link

sbt bloopCompile doesn't work after bloopInstall on a new project #1403

Open jgogstad opened 4 years ago

jgogstad commented 4 years ago

Running the task bloopCompile doesn't work on a new sbt project according to scala/scala-seed.g8, it fails with

[error] (Global / bloopSessionInternal) java.lang.IllegalStateException: Fatal programming error: bloop session task state is accessed even though the compile state is empty, please report this error upstream.

This happens on macOS Catalina, but it's also reproducible in the docker image eed3si9n/sbt:

docker run --rm -it --entrypoint bash eed3si9n/sbt
bash-5.0# sbt new scala/scala-seed.g8
[snip]
A minimal Scala project.

name [Scala Seed Project]: trybloop

Template applied in /opt/workspace/./trybloop

bash-5.0# cd trybloop/
bash-5.0# echo 'addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.5")' > project/plugins.sbt
bash-5.0# sbt
[info] [launcher] getting org.scala-sbt sbt 1.4.1  (this may take some time)...
downloading https://repo1.maven.org/maven2/org/scala-sbt/sbt/1.4.1/sbt-1.4.1.jar ...
[snip]
sbt:trybloop> bloopInstall
[snip]
[success] Generated .bloop/root.json
[success] Generated .bloop/root-test.json
[success] Total time: 5 s, completed Nov 19, 2020 10:17:22 PM
sbt:trybloop> bloopCompile
[error] (Global / bloopSessionInternal) java.lang.IllegalStateException: Fatal programming error: bloop session task state is accessed even though the compile state is empty, please report this error upstream.
[error] Total time: 0 s, completed Nov 19, 2020 10:17:26 PM
sbt:trybloop>
tgodzik commented 4 years ago

Thanks for reporting! bloopCompile is part of an experimental feature and is currently disabled by default. I wouldn't recommend using it currently.

tgodzik commented 3 years ago

Closing this, since bloopCompile is not supposed to work currently. Please use the CLI, Metals or Intellij with BSP. More info about the CLI can be found on the Bloop webpage here.

ckipp01 commented 3 years ago

Popping in here. I really don't think we should close this without some type of action signifying that this isn't supported. I'm trying to do some work on the plugin atm, and running through the commands trying to get a better understanding of what is all happening. When playing around with this one, I don't actually think we should just leave it as is in its current state.

Being accessible to users, but also knowingly not working can be frustrating to users. What do you think of either opening this back up as an issue that bloopCompile doesn't work, somewhere documenting it clearly that it's not to be used, or simply removing it from the plugin if it truly isn't ready to be used. Let me know how I can help with this.

tgodzik commented 3 years ago

@ckipp01 you are right, I would opt for throwing that setting out for now, but I am not exactly sure about the reasons for including it.