forked from firka/flutter
Handle abnormal termination of frontend compiler. (#13982)
* Check frontend_server exit code. When frontend_server completes abnormally, flutter tools has to stop and let user know. * Add tests
This commit is contained in:
committed by
GitHub
parent
5c88f8f295
commit
9534082fc0
@@ -342,6 +342,10 @@ Future<String> _buildAotSnapshot(
|
||||
aot : true,
|
||||
strongMode: strongMode,
|
||||
);
|
||||
if (mainPath == null) {
|
||||
printError('Compiler terminated unexpectedly.');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
genSnapshotCmd.add(mainPath);
|
||||
|
||||
@@ -110,8 +110,8 @@ Future<String> compile(
|
||||
.transform(UTF8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.listen(stdoutHandler.handler);
|
||||
await server.exitCode;
|
||||
return stdoutHandler.outputFilename.future;
|
||||
final int exitCode = await server.exitCode;
|
||||
return exitCode == 0 ? stdoutHandler.outputFilename.future : null;
|
||||
}
|
||||
|
||||
/// Wrapper around incremental frontend server compiler, that communicates with
|
||||
@@ -175,7 +175,8 @@ class ResidentCompiler {
|
||||
|
||||
_server.stdin.writeln('compile $scriptFilename');
|
||||
|
||||
return stdoutHandler.outputFilename.future;
|
||||
final int exitCode = await _server.exitCode;
|
||||
return exitCode == 0 ? stdoutHandler.outputFilename.future : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -76,6 +76,9 @@ Future<Null> build({
|
||||
mainPath: fs.file(mainPath).absolute.path,
|
||||
strongMode: strongMode
|
||||
);
|
||||
if (kernelBinaryFilename == null) {
|
||||
throwToolExit('Compiler terminated unexpectedly on $mainPath');
|
||||
}
|
||||
kernelContent = new DevFSFileContent(fs.file(kernelBinaryFilename));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user