Skip to content

Commit 9b15320

Browse files
jmagmangspencergoog
authored andcommitted
Include stdout in codesign failure output (flutter#115115)
1 parent 936508f commit 9b15320

File tree

2 files changed

+23
-9
lines changed
  • packages/flutter_tools

2 files changed

+23
-9
lines changed

packages/flutter_tools/lib/src/build_system/targets/ios.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,16 @@ void _signFramework(Environment environment, String binaryPath, BuildMode buildM
711711
binaryPath,
712712
]);
713713
if (result.exitCode != 0) {
714-
throw Exception('Failed to codesign $binaryPath with identity $codesignIdentity.\n${result.stderr}');
714+
final String stdout = (result.stdout as String).trim();
715+
final String stderr = (result.stderr as String).trim();
716+
final StringBuffer output = StringBuffer();
717+
output.writeln('Failed to codesign $binaryPath with identity $codesignIdentity.');
718+
if (stdout.isNotEmpty) {
719+
output.writeln(stdout);
720+
}
721+
if (stderr.isNotEmpty) {
722+
output.writeln(stderr);
723+
}
724+
throw Exception(output.toString());
715725
}
716726
}

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -836,21 +836,25 @@ void main() {
836836
lipoCommandNonFatResult,
837837
lipoVerifyArm64Command,
838838
FakeCommand(command: <String>[
839-
'codesign',
840-
'--force',
841-
'--sign',
842-
'ABC123',
843-
'--timestamp=none',
844-
binary.path,
845-
], exitCode: 1, stderr: 'codesign error'),
839+
'codesign',
840+
'--force',
841+
'--sign',
842+
'ABC123',
843+
'--timestamp=none',
844+
binary.path,
845+
],
846+
exitCode: 1,
847+
stderr: 'codesign error',
848+
stdout: 'codesign info',
849+
),
846850
]);
847851

848852
await expectLater(
849853
const DebugUnpackIOS().build(environment),
850854
throwsA(isException.having(
851855
(Exception exception) => exception.toString(),
852856
'description',
853-
contains('Failed to codesign output/Flutter.framework/Flutter with identity ABC123.\ncodesign error'),
857+
contains('Failed to codesign output/Flutter.framework/Flutter with identity ABC123.\ncodesign info\ncodesign error'),
854858
)),
855859
);
856860

0 commit comments

Comments
 (0)