mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
45b21ec3bb
commit
887d5dd9c2
@ -43,8 +43,12 @@ class _DriverInformation {
|
||||
result = await _processManager.run(<String>['eglinfo'], stdoutEncoding: utf8);
|
||||
} on ArgumentError {
|
||||
// ignore error.
|
||||
} on ProcessException {
|
||||
return false;
|
||||
}
|
||||
if (result == null || result.exitCode != 0) {
|
||||
// result.exitCode is ignored, as this is non-zero if some platforms are not avaiable.
|
||||
// The output information is still parsable in all cases.
|
||||
if (result == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user