[dartdevc] Retry ddc incremental compile on crash

Change-Id: I00c2eb1b3bc6d9153fd2e88a8074e5670a0e082e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99442
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
This commit is contained in:
Vijay Menon 2019-04-16 20:06:05 +00:00 committed by commit-bot@chromium.org
parent 6dc209e858
commit ecdbdf00b8

View file

@ -56,6 +56,18 @@ class _CompilerWorker extends AsyncWorkerLoop {
ZoneSpecification(print: (self, parent, zone, message) {
output.writeln(message.toString());
}));
if (lastResult.crashed && context != null) {
// TODO(vsm): See https://github.com/dart-lang/sdk/issues/36644.
// If the CFE is crashing with previous state, then clear compilation
// state and try again.
output.clear();
lastResult = await runZoned(() => compile(args, previousResult: null),
zoneSpecification:
ZoneSpecification(print: (self, parent, zone, message) {
output.writeln(message.toString());
}));
}
return WorkResponse()
..exitCode = lastResult.success ? 0 : 1
..output = output.toString();