You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce Best Effort compilation options (#17582)
This PR introduces 2 new experimental options:
`-Ybest-effort` and `-Ywith-best-effort-tasty`. It also introduces the
Best Effort TASTy format (BETASTy), a TASTy aligned file format able to hold some
errored trees. Behaviour of the options and the format is documented as
part of this PR in the `best-effort-compilation.md` docs file.
`-Ybest-effort` allows to create .betasty files in a failing compilation, while
`-Ywith-best-effort-tasty` allows to read them in subsequent compilations,
so that we can get information needed for IDEs from broken modules, and
modules depending on them. It is worth noting that these compilation
depending on Betty will never reach transform phases, and will never produce
any artifacts other then betasty and semanticdb.
My overall aim was to be able to handle as many cases, with little as
little maintainance necessary as possible. This is for example why
pretty much the only required phases are Parser and Typer - they are
enough for, as far as I know, all necessary metals completions and I did
not find any issues with setting their products (best effort tasty
files) as dependencies. Requiring, for example, PostTyper, would require
for the errored trees to be able to somehow pass through that phase,
meaning a large investment from me into working the existing known error
cases through there (muddling the codebase in the process) and possibly
from the maintainers working on both Typer (to be able to produce
„correct” error trees) and PostTyper (to be able to consume „correct”
errored trees), which would obviously make the entire initiative
dreadful.
This is also why any tests are able to be put into a blacklist file, in
case something changes and a neg test will not pass, or a new test will
be added as part of issue fix that does not play well with the
best-effort features.
valYprofileRunGcBetweenPhases:Setting[List[String]] =PhasesSetting(ForkSetting, "Yprofile-run-gc", "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or *", "_")
valYbestEffort:Setting[Boolean] =BooleanSetting(ForkSetting, "Ybest-effort", "Enable best-effort compilation attempting to produce betasty to the META-INF/best-effort directory, regardless of errors, as part of the pickler phase.")
418
+
valYwithBestEffortTasty:Setting[Boolean] =BooleanSetting(ForkSetting, "Ywith-best-effort-tasty", "Allow to compile using best-effort tasty files. If such file is used, the compiler will stop after the pickler phase.")
valYexplicitNulls:Setting[Boolean] =BooleanSetting(ForkSetting, "Yexplicit-nulls", "Make reference types non-nullable. Nullable types can be expressed with unions: e.g. String|Null.")
0 commit comments