VirtusLab / scala-cli

Scala CLI is a command-line tool to interact with the Scala language. It lets you compile, run, test, and package your Scala code (and more!)
https://scala-cli.virtuslab.org
Apache License 2.0
541 stars 128 forks source link

Add extra logging for `--cross` #3026

Open WojciechMazur opened 1 month ago

WojciechMazur commented 1 month ago

Version(s) 1.4.0

Describe the bug Based on https://github.com/scala/scala3/issues/21194 the scala-cli does not detect multiple versions in the using scala directive.

To Reproduce Compile following file

//> using scala 3.5.0-RC3, 3.nightly

def Test = ()

Expected behaviour There should be a warning or error reported when parsing directives

kavedaa commented 1 month ago

Multiple versions are detected when run with e.g. scala-cli compile --power --cross test.scala.

(For the issue you are referring to, I only pasted the output from the first version, as the second was identical.)

Multiple versions are very useful when investigating which version(s) a particular bug/behaviour appears in, so I don't quite understand why it should be a warning/error.

Gedochao commented 1 month ago

As said in the comment above, the way it currently work is actually intentional. We could, however, have a log message informing which version has been used for running/compilation (as Scala CLI will always use the first version passed in the directive)... and maybe another informing that multiple versions have been passed, but --cross was not enabled.