Open
Description
https://docs.scala-lang.org/overviews/compiler-options/index.html
mentions;
-optimize or -optimise Enables optimizations.
This option is now deprecated.
(probably need to check all others, too.)
https://docs.scala-lang.org/overviews/compiler-options/index.html
mentions;
-optimize or -optimise Enables optimizations.
This option is now deprecated.
(probably need to check all others, too.)
Activity
gavinbaumanis commentedon Jan 21, 2020
I'm actually happy to help with this.
Without "actually" knowing, I can use each of the options in turns and see if they give any deprecation warnings.
But how shall I update the docs?
Also "I" am not going to know if there are any available options that are currently missing from the page, without some help to where I might find an authoritative list.
SethTisue commentedon Jan 25, 2020
@gavinbaumanis thanks for taking an interest in this!
over in the scala/scala repo, running
sbt
followed bygenerateDocsData
generates acompiler-options.yml
file, and then the web page is generated from thatI think that's probably the key piece of information you were missing in order to dig deeper into this...?
gavinbaumanis commentedon Jan 26, 2020
@SethTisue : Awesome - thanks very much!
gavinbaumanis commentedon Jan 26, 2020
In the -opt section of compiler-options.yml is the following;
They DO NOT appear in the page;
https://docs.scala-lang.org/overviews/compiler-options/index.html
Is the [deprecated text in the YML automatically handled?
Could we use this same string to flag other deprecated directives - to be left off the page?
Or are these 2 options manually removed - after the fact?
gavinbaumanis commentedon Jan 26, 2020
Also, please, I have found a discrepancy between the YML and the documentation page;
The YML has for the "-target" directive, choices in the form;
jvm-1.5
through tojvm-1.8
But the documentation page has;
-target:8
. through to-target:12
Not only is the text different, but the JVM values don't line-up either.
Is one actually wrong?
Do I flag these differences too - while I am looking for deprecated values?
(And do I do that here - or should they have their own issue?)
Thanks!
SethTisue commentedon Jan 31, 2020
I don't know. You might need to look at the code that processes compiler-options.yml
I don't know. I certainly hope we aren't manually altering things. We shouldn't be, having it be automatic is the only sustainable approach.
it appears to me from https://github.com/scala/scala/blob/2.13.x/src/compiler/scala/tools/nsc/settings/StandardScalaSettings.scala#L58-L64 that
-target:8
is the standard form and the other form is legacy that we needn't documentI would say the ambition level here is up to you — any amount of forward progress on this that you make is good. The more accurate the page gets the better, but as they say, the perfect is the enemy of the good.
(If you end up with some undone work, an additional ticket with a list would be welcome; perhaps someone else would choose to tackle it.)
gavinbaumanis commentedon Feb 5, 2020
@SethTisue : Thanks Seth.
I am happy to go through all the options (that I can) and;
gavinbaumanis commentedon Feb 6, 2020
@SethTisue
In
scala/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
@ line 497 is the following;
Which would seem to be saying that it should produce the documentation of;
Which it does do for sbt.
However the documentation;
Only has the text;
In
/scala/project/GenerateDocsData.scala
@ 66 is;```def mergeChoice(labels: Seq[String], descriptions: Seq[String]): Seq[Choice] =
labels.zipAll(descriptions, "", "").map {
case (choice, d) => Choice(
choice,
description = Option(d).map(markdownifyBackquote).map(dehtmlfy).filter(.nonEmpty),
// FIXME
deprecated = Some("EXPLAIN_ALTERNATIVE").filter( => d.toLowerCase.contains("deprecated"))
)
}
If I am reading this correctly - I THINK the deprecation warning is missing from the HTML docs because the word "deprecated" is NOT is the description : and test used in the compiler / sbt is supplied via;
.withDeprecationMessage("Since 2.12, enables -opt:l:inline -opt-inline-from:**. See -opt:help.")
fromscala/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala
Do I have this right / am I missing something?
(I note the TODO / FIXME comments - so perhaps "I" am wasting my time at the moment?)
And; is there a way I can locally produce the documentation for testing locally?
Thanks.
SethTisue commentedon Feb 6, 2020
I haven't seen this code before, but your reasoning seems plausible to me.
I'm pretty sure nobody is working on any TODOs or FIXMEs in this area, it hasn't been touched in a while.
I'll @-mention @exoego in case he wants to add anything.
in the scala/scala repo,
build.sbt
has:so running
sbt
then doinggenerateDocsData
should do itSethTisue commentedon Feb 6, 2020
relevant ticket I happened across: scala/bug#11642
it seems to indicate that perhaps the
generateDocsData
task doesn't work at all on 2.13 (as in, seems to work, but is actually using the 2.12 compiler flags info) — does what you're seeing confirm or contradict that?som-snytt commentedon Feb 6, 2020
Yes, the tool was supposed to make yml reflect
scalac -help
,-X
,-Y
,-V
,-W
.Another bug in flight is scala/bug#11873 to optimise the optimiser groups.
SethTisue commentedon May 12, 2020
@gavinbaumanis interested in returning to this...?
som-snytt commentedon May 14, 2020
Someone asked on SO how do I see options for 2.11? It would nice to have a fancy drop-down.
SethTisue commentedon May 14, 2020
(a low-tech solution could be to add a section to the current version that links to the source on GitHub for the last 2.11.x and 2.12.x versions that existed. or even link to Wayback Machine versions)
19 remaining items
Shorla commentedon Mar 30, 2022
How can I get started on it?
SethTisue commentedon Mar 31, 2022
@Shorla are you able to run
generateDocsData
?Shorla commentedon Mar 31, 2022
@SethTissue I tried running it with docs/mdoc, it said commamd not found.
How do I run it?
som-snytt commentedon Mar 31, 2022
Responding to an old comment about
-target
,-target
and-release
are normalized in a recent PR. They accept thejvm-1.8
style values for compatibility only. Should the doc page show all aliases for options and values? I'd suggest a separate curated page to show variants, which may be ad-hoc. Also,-release
has upper limit that is the spec version of the running JVM, so some care is required when generating doc automatically. I'm not sure automation is still a goal.som-snytt commentedon Mar 31, 2022
The PR for optimizer flags has landed, so at least there is no need to republish the options page.
But that would be another example of a canonical form with variants (which may or may not be deprecated).
@Shorla there is a "task" under sbt in the scala/scala build. I think it was mentioned in the long thread above. Ideal case is just to run it and ... does it update the file in this sibling repo? Something like that.
som-snytt commentedon Mar 31, 2022
Old volunteers also welcome. The Scala project is not "newist".
SethTisue commentedon Mar 31, 2022
clone the scala/scala repo, then start sbt, then enter
generateDocsData
there's a little bit of code for it in
build.sbt
, and then the main part of the code is inproject/GenerateDocsData.scala
som-snytt commentedon Jun 10, 2022
Another idea at scala/scala3#15406 (comment) is to automate help doc for options.
Maybe a widget to reveal per-option help. That would let you add an option, add help text, and not touch markdown.
-opt
has a dedicated page; it wouldn't be terrible to link to it directly, but not sure where to provide the link.[-]Scala compiler Options needs updating[/-][+]Scala 2 compiler options page needs updating[/+]SethTisue commentedon Mar 25, 2024
I think so, yes. Visually deemphasized, but present so they show up in searches (whether via Google, or when searching within the page).
-release
to make it clear it accepts recent Java versions #3009