-
Notifications
You must be signed in to change notification settings - Fork 140
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
Log scala-cli version when --log-cli-version is enabled #3614
base: main
Are you sure you want to change the base?
Conversation
progress: Option[Boolean] = None, | ||
@Group(HelpGroup.Logging.toString) | ||
@Tag(tags.implementation) | ||
@HelpMessage("Logs scala-cli version on project build") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HelpMessage("Logs scala-cli version on project build") | |
@HelpMessage(s"Logs ${scala.cli.ScalaCli.fullRunnerName} version alongside JVM and Scala versions when the project gets recompiled by the server.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it still feels hyper-granular to have a command line option just for that... wouldn't it be better to print this when verbosity is set to +1? (as in, just a single -v
)
If we can live without this command line option, I guess I'd rather not have it.
tagging @tgodzik for second opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably too less info for a separate flag. I think it is alos fine with -v
. Additionally, it might be good if the scala-cli version is also added to buildinfo, so that in cases such as mine, I can explicitly log this info using the buildinfo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, adding it to BuildInfo
is a good idea, I think.
Feel free to do it in a separate PR (or make a new issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me see if I can create a separate PR with adding this info in the buildinfo. Reg -v, let me know. It would still be nice to see this info without making any code change in the scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val params = value(options0.scalaParams) | ||
|
||
val scopeParams = | ||
if (scope == Scope.Main) Nil | ||
else Seq(scope.name) | ||
|
||
buildClient.setProjectParams(scopeParams ++ value(options0.projectParams)) | ||
val scalaCliVersionLog = | ||
if options0.internal.logCliVersion then Seq(s"scala-cli ${Constants.version}") else Nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use scala-cli
here, as contextually it may be just scala
. What you actually need is scala.cli.ScalaCli.fullRunnerName
... which is unfortunate, since you log it in the build
module.
You could maybe pass it via scala.build.input.ScalaCliInvokeData
... See how it's passed around in the code elsewhere. I wonder if scala.build.input.ScalaCliInvokeData.progName
would be enough...
I'm thinking this would look awkward:
Compiling project (Scala 3.7.0 JVM (17), scala 1.7.1)
We should have the full runner name, so:
Compiling project (Scala 3.7.0 JVM (17), Scala code runner 1.7.1)
Implementation for #3598