Skip to content

Commit ab7f6e5

Browse files
authored
Pass --verbosity=error to the Dart front-end (#104020)
1 parent 02c4bd8 commit ab7f6e5

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

packages/flutter_tools/lib/src/compile.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ class KernelCompiler {
329329
'package:flutter/src/dart_plugin_registrant.dart',
330330
'-Dflutter.dart_plugin_registrant=${dartPluginRegistrant.uri}',
331331
],
332+
// See: https://github.com/flutter/flutter/issues/103994
333+
'--verbosity=error',
332334
...?extraFrontEndOptions,
333335
mainUri,
334336
];
@@ -795,6 +797,8 @@ class DefaultResidentCompiler implements ResidentCompiler {
795797
platformDill!,
796798
],
797799
if (unsafePackageSerialization == true) '--unsafe-package-serialization',
800+
// See: https://github.com/flutter/flutter/issues/103994
801+
'--verbosity=error',
798802
...?extraFrontEndOptions,
799803
];
800804
_logger.printTrace(command.join(' '));

packages/flutter_tools/test/general.shard/build_system/targets/common_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ void main() {
102102
'$build/app.dill',
103103
'--depfile',
104104
'$build/kernel_snapshot.d',
105+
'--verbosity=error',
105106
'file:///lib/main.dart',
106107
], exitCode: 1),
107108
]);
@@ -139,6 +140,7 @@ void main() {
139140
'$build/app.dill',
140141
'--depfile',
141142
'$build/kernel_snapshot.d',
143+
'--verbosity=error',
142144
'file:///lib/main.dart',
143145
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
144146
]);
@@ -177,6 +179,7 @@ void main() {
177179
'$build/app.dill',
178180
'--depfile',
179181
'$build/kernel_snapshot.d',
182+
'--verbosity=error',
180183
'file:///lib/main.dart',
181184
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
182185
]);
@@ -216,6 +219,7 @@ void main() {
216219
'$build/app.dill',
217220
'--depfile',
218221
'$build/kernel_snapshot.d',
222+
'--verbosity=error',
219223
'foo',
220224
'bar',
221225
'file:///lib/main.dart',
@@ -255,6 +259,7 @@ void main() {
255259
'$build/app.dill',
256260
'--depfile',
257261
'$build/kernel_snapshot.d',
262+
'--verbosity=error',
258263
'file:///lib/main.dart',
259264
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
260265
]);
@@ -292,6 +297,7 @@ void main() {
292297
'$build/app.dill',
293298
'--depfile',
294299
'$build/kernel_snapshot.d',
300+
'--verbosity=error',
295301
'file:///lib/main.dart',
296302
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey $build/app.dill 0\n'),
297303
]);
@@ -344,6 +350,7 @@ void main() {
344350
'$build/app.dill',
345351
'--depfile',
346352
'$build/kernel_snapshot.d',
353+
'--verbosity=error',
347354
'file:///lib/main.dart',
348355
], stdout: 'result $kBoundaryKey\n$kBoundaryKey\n$kBoundaryKey /build/653e11a8e6908714056a57cd6b4f602a/app.dill 0\n'),
349356
]);

packages/flutter_tools/test/general.shard/compile_batch_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ void main() {
6666
'--no-link-platform',
6767
'--packages',
6868
'.packages',
69+
'--verbosity=error',
6970
'file:///path/to/main.dart',
7071
], completer: completer),
7172
]),
@@ -111,6 +112,7 @@ void main() {
111112
'--no-link-platform',
112113
'--packages',
113114
'.packages',
115+
'--verbosity=error',
114116
'file:///path/to/main.dart',
115117
], completer: completer),
116118
]),
@@ -156,6 +158,7 @@ void main() {
156158
'--no-link-platform',
157159
'--packages',
158160
'.packages',
161+
'--verbosity=error',
159162
'file:///path/to/main.dart',
160163
], completer: completer, exitCode: 127),
161164
]),
@@ -203,6 +206,7 @@ void main() {
203206
'--tfa',
204207
'--packages',
205208
'.packages',
209+
'--verbosity=error',
206210
'file:///path/to/main.dart',
207211
], completer: completer),
208212
]),
@@ -251,6 +255,7 @@ void main() {
251255
'--tfa',
252256
'--packages',
253257
'.packages',
258+
'--verbosity=error',
254259
'file:///path/to/main.dart',
255260
], completer: completer),
256261
]),
@@ -299,6 +304,7 @@ void main() {
299304
'--no-link-platform',
300305
'--packages',
301306
'.packages',
307+
'--verbosity=error',
302308
'file:///path/to/main.dart',
303309
], completer: completer),
304310
]),
@@ -348,6 +354,7 @@ void main() {
348354
'--no-link-platform',
349355
'--packages',
350356
'.packages',
357+
'--verbosity=error',
351358
'scheme:///main.dart',
352359
], completer: completer),
353360
]),
@@ -402,6 +409,7 @@ void main() {
402409
'--source',
403410
'package:flutter/src/dart_plugin_registrant.dart',
404411
'-Dflutter.dart_plugin_registrant=.dart_tools/flutter_build/dart_plugin_registrant.dart',
412+
'--verbosity=error',
405413
'scheme:///main.dart',
406414
], completer: completer),
407415
]),

packages/flutter_tools/test/general.shard/compile_incremental_test.dart

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void main() {
8080

8181
testWithoutContext('incremental compile single dart compile', () async {
8282
fakeProcessManager.addCommand(FakeCommand(
83-
command: frontendServerCommand,
83+
command: const <String>[...frontendServerCommand, '--verbosity=error'],
8484
stdout: 'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0',
8585
stdin: frontendServerStdIn,
8686
));
@@ -107,6 +107,7 @@ void main() {
107107
'/foo/bar/fizz',
108108
'--filesystem-scheme',
109109
'scheme',
110+
'--verbosity=error',
110111
],
111112
stdout: 'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0',
112113
stdin: frontendServerStdIn,
@@ -128,7 +129,7 @@ void main() {
128129

129130
testWithoutContext('incremental compile single dart compile abnormally terminates', () async {
130131
fakeProcessManager.addCommand(FakeCommand(
131-
command: frontendServerCommand,
132+
command: const <String>[...frontendServerCommand, '--verbosity=error'],
132133
stdin: frontendServerStdIn,
133134
));
134135

@@ -144,7 +145,7 @@ void main() {
144145

145146
testWithoutContext('incremental compile single dart compile abnormally terminates via exitCode', () async {
146147
fakeProcessManager.addCommand(FakeCommand(
147-
command: frontendServerCommand,
148+
command: const <String>[...frontendServerCommand, '--verbosity=error'],
148149
stdin: frontendServerStdIn,
149150
exitCode: 1,
150151
));
@@ -162,7 +163,7 @@ void main() {
162163
testWithoutContext('incremental compile and recompile', () async {
163164
final Completer<void> completer = Completer<void>();
164165
fakeProcessManager.addCommand(FakeCommand(
165-
command: frontendServerCommand,
166+
command: const <String>[...frontendServerCommand, '--verbosity=error'],
166167
stdout: 'result abc\nline0\nline1\nabc\nabc /path/to/main.dart.dill 0',
167168
stdin: frontendServerStdIn,
168169
completer: completer,
@@ -211,6 +212,7 @@ void main() {
211212
'/foo/bar/fizz',
212213
'--filesystem-scheme',
213214
'scheme',
215+
'--verbosity=error',
214216
],
215217
stdout: 'result abc\nline0\nline1\nabc\nabc /path/to/main.dart.dill 0',
216218
stdin: frontendServerStdIn,
@@ -274,6 +276,7 @@ void main() {
274276
'/foo/bar/fizz',
275277
'--filesystem-scheme',
276278
'scheme',
279+
'--verbosity=error',
277280
],
278281
stdout: 'result abc\nline0\nline1\nabc\nabc /path/to/main.dart.dill 0',
279282
stdin: frontendServerStdIn,
@@ -324,7 +327,7 @@ void main() {
324327
testWithoutContext('incremental compile can suppress errors', () async {
325328
final Completer<void> completer = Completer<void>();
326329
fakeProcessManager.addCommand(FakeCommand(
327-
command: frontendServerCommand,
330+
command: const <String>[...frontendServerCommand, '--verbosity=error'],
328331
stdout: 'result abc\nline0\nline1\nabc\nabc /path/to/main.dart.dill 0',
329332
stdin: frontendServerStdIn,
330333
completer: completer,
@@ -363,7 +366,7 @@ void main() {
363366
testWithoutContext('incremental compile and recompile twice', () async {
364367
final Completer<void> completer = Completer<void>();
365368
fakeProcessManager.addCommand(FakeCommand(
366-
command: frontendServerCommand,
369+
command: const <String>[...frontendServerCommand, '--verbosity=error'],
367370
stdout: 'result abc\nline0\nline1\nabc\nabc /path/to/main.dart.dill 0',
368371
stdin: frontendServerStdIn,
369372
completer: completer,

0 commit comments

Comments
 (0)