Commit 188d9a4
committed
Introduce best-effort compilation for IDEs
2 new experimental options are introduces for the compiler:
`-Ybest-effort` and `-Ywith-best-effort-tasty`. A related
Best Effort TASTy (.betasty) format, a TASTy aligned file format able
to hold some errored trees was also added. Behaviour of the options and
the format is documented as part of this commit in the
`best-effort-compilation.md` docs file.
`-Ybest-effort` is used to produce `.betasty` files in the
`<output>/META-INF/best-effort`. `-Ywith-best-effort-tasty` allows to
use them during compilation, limiting it to the frontend phases if such
file is used. If any .betasty is used, transparent inline macros also
cease to be expanded by the compiler.
Since best-effort compilation can fail (e.g. due to cyclic reference
errors which sometimes are not able to be pickled or unpickled),
the crashes caused by it are wrapped into an additional descriptive
error message in the aim to fail more gracefully (and not pollute our
issue tracker with known problems).
The feature is tested in two ways:
* with a set of pairs of dependent projects, one of which is
meant to produce .betasty by using `-Ybest-effort`, and the other
tries to consume it using `-Ywith-best-effort-tasty`.
* by reusing the compiler nonbootstrapped neg tests, first by running
them with `-Ybest-effort` option, and then by running read-tasty tests
on the produced betasty files to thest best-effort tastt unpickling
Additionally, `-Ywith-best-effort-tasty` allows to print `.betasty` via
`-print-tasty`.1 parent c0eae68 commit 188d9a4
File tree
56 files changed
+1014
-197
lines changed- compiler
- src/dotty/tools
- backend
- jvm
- sjs
- dotc
- ast
- classpath
- config
- core
- tasty
- fromtasty
- inlines
- semanticdb
- transform
- typer
- test
- dotc
- dotty/tools
- dotc
- vulpix
- docs
- _docs/internals
- project
- tasty/src/dotty/tools/tasty
- besteffort
- tests/best-effort
- broken-macro-executed-in-dependency
- err
- main
- broken-macro-executed-in-dependent
- err
- main
- mirrors-in-dependency
- err
- main
- simple-type-error
- err
- main
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
56 files changed
+1014
-197
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
103 | | - | |
104 | | - | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
242 | | - | |
| 246 | + | |
243 | 247 | | |
244 | 248 | | |
245 | 249 | | |
| |||
250 | 254 | | |
251 | 255 | | |
252 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
253 | 264 | | |
254 | 265 | | |
255 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
932 | | - | |
| 932 | + | |
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
466 | 478 | | |
467 | 479 | | |
468 | 480 | | |
| |||
949 | 961 | | |
950 | 962 | | |
951 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
952 | 967 | | |
953 | 968 | | |
954 | 969 | | |
| |||
0 commit comments