-
Notifications
You must be signed in to change notification settings - Fork 18
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
Emit the warning if the -Vstatistics
option isn't set
#47
Conversation
@@ -294,6 +295,16 @@ class ProfilingPlugin(val global: Global) extends Plugin { | |||
override def run(): Unit = { | |||
super.run() | |||
|
|||
if (!SettingsOps.areStatisticsEnabled(global)) { | |||
val flagName = global.settings.Ystatistics.name.replace("-V", "-Y") |
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.
normally if -V
is supported, it is canonical, and normally if a -Y
form exists as well, it is only a deprecated alias. So unless you want to argue otherwise, I should we be documenting and recommending the -V
form?
cc @som-snytt
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.
normally if -V is supported, it is canonical, and normally if a -Y form exists as well, it is only a deprecated alias.
Thanks! Is this Scala-version-specific logic?
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.
scala> settings.Ystatistics.name
val res1: String = -Vstatistics
scala> settings.Ystatistics.abbreviations
val res2: List[String] = List(-Ystatistics)
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.
But in 2.12,
scala 2.12.18> :power
scala 2.12.18> settings.Ystatistics.name
res0: String = -Ystatistics
scala 2.12.18> settings.Ystatistics.abbreviations
res1: List[String] = List()
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.
So just removing .replace("-V", "-Y")
should give the right flag on all versions
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, perhaps this difference between -Y
and -V
is too subtle for the end users so we can show -V
for 2.13 and -Y
for 2.12. Any objections?
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.
SGTM
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.
-Vstatistics
option isn't set
@danicheg needs rebase, though |
@SethTisue here we go |
Resolves #45.
The following warning will be emitted if the
Ystatistics
option isn't set:By enabling the
-Xfatal-warnings
option, it will be an error:It's convenient to manage fatal behaviour with
-Xfatal-warnings
, but the output contains excessive debug information, causing that warning may go unnoticed.UPD: if users don't enable the
-P:scalac-profiling:show-profiles
option, the output is much consier.WDYT @lolgab @sjrd @SethTisue?