Unverified Commit b1aff285 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

pass --no-gen-bytecode to aot kernel compiler invocations (#43753)

parent 7e60a65f
...@@ -324,6 +324,8 @@ class KernelCompiler { ...@@ -324,6 +324,8 @@ class KernelCompiler {
if (aot) ...<String>[ if (aot) ...<String>[
'--aot', '--aot',
'--tfa', '--tfa',
// TODO(jonahwilliams): remove when https://github.com/flutter/flutter/issues/43751 is resolved.
'--no-gen-bytecode',
], ],
if (packagesPath != null) ...<String>[ if (packagesPath != null) ...<String>[
'--packages', '--packages',
......
...@@ -66,6 +66,30 @@ void main() { ...@@ -66,6 +66,30 @@ void main() {
Platform: kNoColorTerminalPlatform, Platform: kNoColorTerminalPlatform,
}); });
testUsingContext('passes no-gen-bytecode to kernel compiler in aot/release mode', () async {
when(mockFrontendServer.stdout)
.thenAnswer((Invocation invocation) => Stream<List<int>>.fromFuture(
Future<List<int>>.value(utf8.encode(
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0'
))
));
final KernelCompiler kernelCompiler = await kernelCompilerFactory.create(null);
await kernelCompiler.compile(sdkRoot: '/path/to/sdkroot',
mainPath: '/path/to/main.dart',
buildMode: BuildMode.release,
trackWidgetCreation: false,
aot: true,
);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
final VerificationResult argVerification = verify(mockProcessManager.start(captureAny));
expect(argVerification.captured.single, contains('--no-gen-bytecode'));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
OutputPreferences: () => OutputPreferences(showColor: false),
Platform: kNoColorTerminalPlatform,
});
testUsingContext('batch compile single dart failed compilation', () async { testUsingContext('batch compile single dart failed compilation', () async {
final BufferLogger bufferLogger = logger; final BufferLogger bufferLogger = logger;
when(mockFrontendServer.stdout) when(mockFrontendServer.stdout)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment