From dfc72439529c49e8bfeab9d604b1aa1cac7d89e8 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Tue, 13 Oct 2020 15:08:20 +0200 Subject: [PATCH] [lldb] Don't add no-sandbox entitlement when running tests on simulator It seems that if codesigning the test executables with the `com.apple.private.security.no-sandbox` entitlement then the simulator refuses to launch them and every test fails with `Process launch failed: process exited with status -1 (no such process.)`. This patch checks if we're trying to run the test suite on the simulator and then avoids signing the executable with `no-sandbox`. Reviewed By: JDevlieghere Differential Revision: https://reviews.llvm.org/D89052 --- lldb/packages/Python/lldbsuite/test/builders/darwin.py | 8 ++++++-- .../lldbsuite/test/make/entitlements-simulator.plist | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 lldb/packages/Python/lldbsuite/test/make/entitlements-simulator.plist diff --git a/lldb/packages/Python/lldbsuite/test/builders/darwin.py b/lldb/packages/Python/lldbsuite/test/builders/darwin.py index 236e4fac1368..fd25c0c2f115 100644 --- a/lldb/packages/Python/lldbsuite/test/builders/darwin.py +++ b/lldb/packages/Python/lldbsuite/test/builders/darwin.py @@ -65,11 +65,15 @@ class BuilderDarwin(Builder): if configuration.dsymutil: args['DSYMUTIL'] = configuration.dsymutil - operating_system, _ = get_os_and_env() + operating_system, env = get_os_and_env() if operating_system and operating_system != "macosx": builder_dir = os.path.dirname(os.path.abspath(__file__)) test_dir = os.path.dirname(builder_dir) - entitlements = os.path.join(test_dir, 'make', 'entitlements.plist') + if env == "simulator": + entitlements_file = 'entitlements-simulator.plist' + else: + entitlements_file = 'entitlements.plist' + entitlements = os.path.join(test_dir, 'make', entitlements_file) args['CODESIGN'] = 'codesign --entitlements {}'.format( entitlements) diff --git a/lldb/packages/Python/lldbsuite/test/make/entitlements-simulator.plist b/lldb/packages/Python/lldbsuite/test/make/entitlements-simulator.plist new file mode 100644 index 000000000000..9acd12816c91 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/make/entitlements-simulator.plist @@ -0,0 +1,8 @@ + + + + + com.apple.security.get-task-allow + + +