[Lldb-commits] [lldb] dfc7243 - [lldb] Don't add no-sandbox entitlement when running tests on simulator

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 13 06:09:21 PDT 2020


Author: Raphael Isemann
Date: 2020-10-13T15:08:46+02:00
New Revision: dfc72439529c49e8bfeab9d604b1aa1cac7d89e8

URL: https://github.com/llvm/llvm-project/commit/dfc72439529c49e8bfeab9d604b1aa1cac7d89e8
DIFF: https://github.com/llvm/llvm-project/commit/dfc72439529c49e8bfeab9d604b1aa1cac7d89e8.diff

LOG: [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

Added: 
    lldb/packages/Python/lldbsuite/test/make/entitlements-simulator.plist

Modified: 
    lldb/packages/Python/lldbsuite/test/builders/darwin.py

Removed: 
    


################################################################################
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 @@ def getExtraMakeArgs(self):
         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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>com.apple.security.get-task-allow</key>
+    <true/>
+</dict>
+</plist>


        


More information about the lldb-commits mailing list