Closed jvican closed 6 years ago
This deprecated flag was specific for just optimizing libraries which actually made it really convenient (see release notes for http://www.scala-lang.org/news/2.12.0/#new-optimizer). I actually asked in scalac and reddit what an equivalent new flag would be and I never got an answer.
I am actually not entirely sure what I should be using as a replacement?
@lrytz?
You can get the same behavior with -opt-inline-from:<sources>
$ scalac -opt-inline-from:help
...
<sources> Classes defined in source files compiled in the current compilation, either
passed explicitly to the compiler or picked up from the `-sourcepath`
...
And, using that option is safe with respect to binary compatibility.
@lrytz Which are the options that can affect bincompat? I was registered to a ticket that discussed it, but cannot find it.
@jvican The -opt:l:classpath
(if it still exists) can effect binary compatibility since it uses all files from the class path (hence why its only recommended for applications/fatjars and not libraries)
Ah, alright, it was l:classpath
. There's a wip bincompat guide that will be merged into the official website, so I'll suggest the author to elaborate on how the optimizer affects bincompat. /cc @jatcwang
@jvican I have done this in master, feel free to merge into your branch if you want to do so
Sure, will do.
2.12 introduced a new inliner and the previous
-opt:l:project
flag has been deprecated. See:On an aside, I'm curious, what is the original motivation to enable the optimizer? It is important to be careful with it because
-optimize
can break binary compatibility. It is best enabled in the leaf projects (applications) rather than libraries.