Skip to content

Include stdout in codesign failure output #115115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/flutter_tools/lib/src/build_system/targets/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,16 @@ void _signFramework(Environment environment, String binaryPath, BuildMode buildM
binaryPath,
]);
if (result.exitCode != 0) {
throw Exception('Failed to codesign $binaryPath with identity $codesignIdentity.\n${result.stderr}');
final String stdout = (result.stdout as String).trim();
final String stderr = (result.stderr as String).trim();
final StringBuffer output = StringBuffer();
output.writeln('Failed to codesign $binaryPath with identity $codesignIdentity.');
if (stdout.isNotEmpty) {
output.writeln(stdout);
}
if (stderr.isNotEmpty) {
output.writeln(stderr);
}
throw Exception(output.toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -836,21 +836,25 @@ void main() {
lipoCommandNonFatResult,
lipoVerifyArm64Command,
FakeCommand(command: <String>[
'codesign',
'--force',
'--sign',
'ABC123',
'--timestamp=none',
binary.path,
], exitCode: 1, stderr: 'codesign error'),
'codesign',
'--force',
'--sign',
'ABC123',
'--timestamp=none',
binary.path,
],
exitCode: 1,
stderr: 'codesign error',
stdout: 'codesign info',
),
]);

await expectLater(
const DebugUnpackIOS().build(environment),
throwsA(isException.having(
(Exception exception) => exception.toString(),
'description',
contains('Failed to codesign output/Flutter.framework/Flutter with identity ABC123.\ncodesign error'),
contains('Failed to codesign output/Flutter.framework/Flutter with identity ABC123.\ncodesign info\ncodesign error'),
)),
);

Expand Down