Compiler output passed wrongly from Bloop
Version(s)
0.1.4, 0.1.5, possibly earlier ones as well
Describe the bug
Compiler options passed after -O seem to be ignored when compiling with scala 2
To Reproduce
Foo.scala:
trait Foo
Running
scala-cli compile -S 2.13.8 -O -Vprint:typer Foo.scala
prints just
Compiling project (Scala 2.13.8, JVM)
Compiled project (Scala 2.13.8, JVM)
Expected behaviour
Compiler option passed in the command line after -O should be correctly passed to the compiler.
In the example above this should print the program tree after the typer phase similarly to
sdk use scala 2.13.8
scalac -Vprint:typer Foo.scala
printing
[[syntax trees at end of typer]] // Foo.scala
package <empty> {
abstract trait Foo extends scala.AnyRef
}
Hi @prolativ, Thanks for reporting, it seems that is bloop issue that output from scalac is not properly handled.
There is exists a workaround and you have to use plain scalac without bloop. To disable using bloop you should use --server=false flag.
$ scala-cli compile -S 2.13.8 -O -Vprint:typer Foo.scala --server=false
[[syntax trees at end of typer]] // Foo.scala
package <empty> {
abstract trait Foo extends scala.AnyRef
}
Could this be considered a blocker for promoting scala-cli to be scala? I feel (rather strongly) that it should be.
Makes sense, I will need to take a look at it.
Fixing it in https://github.com/scalacenter/bloop/pull/2361
@SethTisue do you know if the output from "-Vprint" is being printed only to standard output? This might not be possible to sensibly fix as we would need to forward Bloop stdout and that could bring in more than we wanted, since it is running multiple compilations.