Skip to content

Commit 7b70797

Browse files
sstricklCommit Queue
authored andcommitted
[dartdev] Limit signed executable check in compile_test to ARM64 macOS.
On X64, executables are not required to be signed, and we only sign the appended executable if the original dartaotruntime used for appending was signed. TEST=pkg/dartdev/test/commands/compile_test Issue: #55455 Change-Id: Iec8f866423a76b93bb3a3cb9befce009bbdc78ef Cq-Include-Trybots: luci.dart.try:pkg-mac-release-arm64-try,pkg-mac-release-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443100 Commit-Queue: Tess Strickland <[email protected]> Reviewed-by: Daco Harkes <[email protected]>
1 parent 21f7ffc commit 7b70797

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

pkg/dartdev/test/commands/compile_test.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,17 +292,11 @@ void defineCompileTests() {
292292
expect(File(outFile).existsSync(), true,
293293
reason: 'File not found: $outFile');
294294

295-
result = Process.runSync(
296-
outFile,
297-
[],
298-
);
299-
300-
expect(result.stderr, isEmpty);
301-
expect(result.exitCode, 0);
302-
expect(result.stdout, contains('I love executables'));
303-
304-
if (Platform.isMacOS) {
305-
// Also check that the resulting executable is properly signed.
295+
if (Platform.isMacOS && Target.current.architecture == Architecture.arm64) {
296+
// Also check that the resulting executable is properly signed on ARM64
297+
// macOS, since executables are required to be signed there and checking
298+
// this prior to running the executable gives us a clearer test failure
299+
// message if for some reason the generated signature was invalid.
306300
result = await Process.run('codesign', [
307301
'-v',
308302
outFile,
@@ -314,6 +308,15 @@ void defineCompileTests() {
314308
printOnFailure('Subcommand stderr:\n${result.stderr}');
315309
expect(result.exitCode, 0);
316310
}
311+
312+
result = Process.runSync(
313+
outFile,
314+
[],
315+
);
316+
317+
expect(result.stderr, isEmpty);
318+
expect(result.exitCode, 0);
319+
expect(result.stdout, contains('I love executables'));
317320
}
318321

319322
test('Compile and run executable', basicCompileTest, skip: isRunningOnIA32);

0 commit comments

Comments
 (0)