Fix flutter doctor usage of eglinfo in failure cases. (#164334)

Ignore return value from eglinfo - it doesn't indicate failure.
Discovered when using an X11 system where Wayland is not available. It
returns 1 in this case, but the output is still valid. Confirmed by
looking at the eglinfo source - we should parse the output regardless of
what it returns.

Catch exception correctly when eglinfo is not installed.

Fixes for https://github.com/flutter/flutter/pull/163980
This commit is contained in:
Robert Ancell
2025-03-01 02:07:55 +13:00
committed by GitHub
parent 45b21ec3bb
commit 887d5dd9c2
2 changed files with 10 additions and 2 deletions

View File

@@ -160,7 +160,11 @@ Configurations:
// A command that will failure when running 'eglinfo'.
FakeCommand _eglinfoMissingCommand() {
return const FakeCommand(command: <String>['eglinfo'], exitCode: 1);
return const FakeCommand(
command: <String>['eglinfo'],
exitCode: 1,
exception: ProcessException('eglinfo', <String>[]),
);
}
// Commands that give some failures for the GTK library pkg-config queries.