diff --git a/packages/flutter_tools/lib/src/commands/build_aot.dart b/packages/flutter_tools/lib/src/commands/build_aot.dart index 37346a0898..f132f0c5aa 100644 --- a/packages/flutter_tools/lib/src/commands/build_aot.dart +++ b/packages/flutter_tools/lib/src/commands/build_aot.dart @@ -342,10 +342,6 @@ Future _buildAotSnapshot( aot : true, strongMode: strongMode, ); - if (mainPath == null) { - printError('Compiler terminated unexpectedly.'); - return null; - } } genSnapshotCmd.add(mainPath); diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index 2ee5f7ee68..3e738f6ecd 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -110,8 +110,8 @@ Future compile( .transform(UTF8.decoder) .transform(const LineSplitter()) .listen(stdoutHandler.handler); - final int exitCode = await server.exitCode; - return exitCode == 0 ? stdoutHandler.outputFilename.future : null; + await server.exitCode; + return stdoutHandler.outputFilename.future; } /// Wrapper around incremental frontend server compiler, that communicates with @@ -175,8 +175,7 @@ class ResidentCompiler { _server.stdin.writeln('compile $scriptFilename'); - final int exitCode = await _server.exitCode; - return exitCode == 0 ? stdoutHandler.outputFilename.future : null; + return stdoutHandler.outputFilename.future; } diff --git a/packages/flutter_tools/lib/src/flx.dart b/packages/flutter_tools/lib/src/flx.dart index 2bc48e46c0..d54ac1b535 100644 --- a/packages/flutter_tools/lib/src/flx.dart +++ b/packages/flutter_tools/lib/src/flx.dart @@ -76,9 +76,6 @@ Future build({ mainPath: fs.file(mainPath).absolute.path, strongMode: strongMode ); - if (kernelBinaryFilename == null) { - throwToolExit('Compiler terminated unexpectedly on $mainPath'); - } kernelContent = new DevFSFileContent(fs.file(kernelBinaryFilename)); } diff --git a/packages/flutter_tools/test/compile_test.dart b/packages/flutter_tools/test/compile_test.dart index f847b6f247..6285eb77d7 100644 --- a/packages/flutter_tools/test/compile_test.dart +++ b/packages/flutter_tools/test/compile_test.dart @@ -74,28 +74,6 @@ void main() { }, overrides: { ProcessManager: () => mockProcessManager, }); - - testUsingContext('single dart abnormal compiler termination', () async { - when(mockFrontendServer.exitCode).thenReturn(255); - - final BufferLogger logger = context[Logger]; - - when(mockFrontendServer.stdout) - .thenAnswer((Invocation invocation) => new Stream>.fromFuture( - new Future>.value(UTF8.encode( - 'result abc\nline1\nline2\nabc' - )) - )); - - final String output = await compile(sdkRoot: '/path/to/sdkroot', - mainPath: '/path/to/main.dart' - ); - expect(mockFrontendServerStdIn.getAndClear(), isEmpty); - expect(logger.errorText, equals('compiler message: line1\ncompiler message: line2\n')); - expect(output, equals(null)); - }, overrides: { - ProcessManager: () => mockProcessManager, - }); }); group('incremental compile', () { @@ -147,27 +125,6 @@ void main() { ProcessManager: () => mockProcessManager, }); - testUsingContext('single dart compile abnormally terminates', () async { - when(mockFrontendServer.exitCode).thenReturn(255); - - final BufferLogger logger = context[Logger]; - - when(mockFrontendServer.stdout) - .thenAnswer((Invocation invocation) => new Stream>.fromFuture( - new Future>.value(UTF8.encode( - 'result abc\nline1\nline2\nabc /path/to/main.dart.dill' - )) - )); - - final String output = await generator.recompile( - '/path/to/main.dart', null /* invalidatedFiles */ - ); - expect(logger.errorText, equals('compiler message: line1\ncompiler message: line2\n')); - expect(output, equals(null)); - }, overrides: { - ProcessManager: () => mockProcessManager, - }); - testUsingContext('compile and recompile', () async { final BufferLogger logger = context[Logger];