Open noresttherein opened 4 years ago
Hmm, if it works fine with sbt does that mean it's an Intellij issue? 🤔 Are you using sbt shell within Intellij or not?
I think it's an issue with the compile server implementation. As you can see, there are only scala
packages in the stack trace; IntelliJ is only reporting the error which it got over the network interface from the compile server. While I do not claim to really understand how compile server works and all the options available in IntelliJ, but I'm pretty sure they do not have their own compiler and compile from disk, so I am not sure what can be different.
The -Xss
could be different. What are your SBT_OPTS
or .jvmopts
?
No custom Java/SBT settings in command line environment. I have the following lines in build.sbt:
fork in Compile := true
javaOptions in Compile ++= Seq("-Xmx4G")
The IntelliJ project is directly imported and reimported from sbt, so I would presume it uses sbt to compile, especially that its output looks familiar:
Executing pre-compile tasks...
Running 'before' tasks
Checking sources
Searching for compilable files...
Reading compilation settings...
scalac: instantiating compiler... [oldsql]
scalac: compiling 1 sources... 4% [oldsql]
scalac: compiling 1 sources... 8% [oldsql]
scalac: compiling 1 sources... 13% [oldsql]
I tried without compile server and added Xxs:512k
, the result is the same, after 12 minutes of compilation - while SBT in the command line finishes a clean build in 2m. I reported the issue also to Jetbrains: 253037. In all cases the stack ends with lambdas from AsSeenFromMap.loop
. Doesn't it bring any clues?
In all cases the stack ends with lambdas from AsSeenFromMap.loop. Doesn't it bring any clues?
It probably would if we also had an MCVE.
@SethTisue What's a MCVE? I ran a build with -Xss:4m. Same thing. I'd like to again stress that command line SBT builds correctly and fast with no custom options. I have no idea what the difference may be, as I said I reported it to Jetbrains too. If someone tells me what/how to check, I'll do it.
Any update on this ?
reproduction steps
Scala 2.13.3
The following commit in my project causes the following error when compiling from IntelliJ: oldsql The problem occurs both in incremental and fresh builds. SBT from console seems to work fine. I isolated the problem to the compilerHangup.scala, but didn't even try to extract this as quite a bit is going on in implicits, and three very similar expressions cause different behaviours in the compiler. Sorry. There are a lot of scaladocs though, so the purpose of individual implicits and methods should hopefully be possible to grasp individually.
I'll be looking a bit more into it as the code this uses isn't finished - I wasn't sure it even would compile
I don't know how to do 'spoiler' tags in Markup, sorry.