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

Compiler output passed wrongly from Bloop #1023

Open
prolativ opened this issue May 19, 2022 · 7 comments
Open

Compiler output passed wrongly from Bloop #1023

prolativ opened this issue May 19, 2022 · 7 comments
Assignees
Labels
Bloop Issues tied with Bloop integration. bug Something isn't working

Comments

@prolativ
Copy link

prolativ commented May 19, 2022

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
}
@lwronski lwronski added the bug Something isn't working label May 19, 2022
@lwronski
Copy link
Contributor

lwronski commented May 19, 2022

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
}

@Gedochao Gedochao added the requires scoping Issue requires a spike to revalidate it and assign an up-to date scope for its requirements. label Dec 13, 2023
@SethTisue
Copy link
Contributor

Could this be considered a blocker for promoting scala-cli to be scala? I feel (rather strongly) that it should be.

@tgodzik
Copy link
Member

tgodzik commented Mar 8, 2024

Makes sense, I will need to take a look at it.

@Gedochao Gedochao added the Bloop Issues tied with Bloop integration. label Jun 26, 2024
@Gedochao Gedochao changed the title -O not working for scala 2 Compiler output passed wrongly from Bloop Jun 26, 2024
tgodzik added a commit to tgodzik/bloop that referenced this issue Jun 28, 2024
@tgodzik
Copy link
Member

tgodzik commented Jun 28, 2024

Fixing it in scalacenter/bloop#2361

tgodzik added a commit to tgodzik/bloop that referenced this issue Jul 3, 2024
@tgodzik
Copy link
Member

tgodzik commented Jul 4, 2024

@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.

@SethTisue
Copy link
Contributor

where else would or could it be printed?

@tgodzik
Copy link
Member

tgodzik commented Jul 8, 2024

where else would or could it be printed?

I was thinking that it could go via info diagnostics for example? Since, I guess there is no sensible way to pass a custom output stream to the compiler

tgodzik added a commit to tgodzik/bloop that referenced this issue Jul 16, 2024
tgodzik added a commit to tgodzik/bloop that referenced this issue Jul 16, 2024
tgodzik added a commit to tgodzik/bloop that referenced this issue Jul 16, 2024
tgodzik added a commit to tgodzik/bloop that referenced this issue Jul 16, 2024
@Gedochao Gedochao removed the requires scoping Issue requires a spike to revalidate it and assign an up-to date scope for its requirements. label Jul 17, 2024
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
Status: In progress
Development

No branches or pull requests

5 participants