Skip to content

Commit 77850b7

Browse files
sstricklCommit Queue
authored andcommitted
[dartdev] Remove signed dartaotruntime test.
Now that more of dartdev (e.g., generating kernel) uses dartaotruntime, modifying the built dartaotruntime with a adhoc non-linker-signed signature causes this test and other tests following it to fail. Instead, remove this test and just check that the binary generated by `dart compile exe` is signed on MacOS. TEST=pkg/dartdev/test/commands/compile_test Fixes: #55455 Change-Id: If8f645aeccac617a550db7740343327ca8cd1e4a Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/442840 Reviewed-by: Daco Harkes <[email protected]> Auto-Submit: Tess Strickland <[email protected]> Commit-Queue: Tess Strickland <[email protected]>
1 parent 8f3da55 commit 77850b7

File tree

1 file changed

+14
-29
lines changed

1 file changed

+14
-29
lines changed

pkg/dartdev/test/commands/compile_test.dart

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,20 @@ void defineCompileTests() {
300300
expect(result.stderr, isEmpty);
301301
expect(result.exitCode, 0);
302302
expect(result.stdout, contains('I love executables'));
303+
304+
if (Platform.isMacOS) {
305+
// Also check that the resulting executable is properly signed.
306+
result = await Process.run('codesign', [
307+
'-v',
308+
outFile,
309+
]);
310+
311+
printOnFailure(
312+
'Subcommand terminated with exit code ${result.exitCode}.');
313+
printOnFailure('Subcommand stdout:\n${result.stdout}');
314+
printOnFailure('Subcommand stderr:\n${result.stderr}');
315+
expect(result.exitCode, 0);
316+
}
303317
}
304318

305319
test('Compile and run executable', basicCompileTest, skip: isRunningOnIA32);
@@ -1415,35 +1429,6 @@ void main() {
14151429
expect(result.stderr, contains(failedAssertionError));
14161430
});
14171431

1418-
if (Platform.isMacOS) {
1419-
test('Compile and run executable from signed dartaotruntime', () async {
1420-
// Either the locally built dartaotruntime is already linker signed
1421-
// (on M1) or it is unsigned (on X64). For this test, sign the
1422-
// dartaotruntime executable with a non-linker signed adhoc signature,
1423-
// which won't cause issues with any other tests that use it. This
1424-
// ensures the code signing path in dart2native is exercised on X64
1425-
// (macOS <11.0), and also mimics the case for end users that are using
1426-
// the published Dart SDK (which is fully signed, not linker signed).
1427-
final Directory binDir = File(Platform.resolvedExecutable).parent;
1428-
final String originalRuntimePath =
1429-
path.join(binDir.path, 'dartaotruntime');
1430-
final codeSigningProcess = await Process.start('codesign', [
1431-
'-o',
1432-
'runtime',
1433-
'-s',
1434-
'-',
1435-
originalRuntimePath,
1436-
]);
1437-
1438-
final signingResult = await codeSigningProcess.exitCode;
1439-
expect(signingResult, 0);
1440-
1441-
// Now perform the same basic compile and run test with the signed
1442-
// dartaotruntime.
1443-
await basicCompileTest();
1444-
}, skip: isRunningOnIA32);
1445-
}
1446-
14471432
// Tests for --depfile for compiling to AOT snapshots, executables and
14481433
// kernel.
14491434
group('depfiles', () {

0 commit comments

Comments
 (0)