Skip to content

Commit 17798ad

Browse files
authored
[lldb] Use get-task-allow entitlement on macOS too (#71112)
Running the LLDB test suite in a GUI-less macOS environment (say, ssh) requires that the debugged tasks be signed with the get-task-allow entitlement.
1 parent a6c8e27 commit 17798ad

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,18 @@ def getExtraMakeArgs(self):
8888
args["FRAMEWORK_INCLUDES"] = "-F{}".format(private_frameworks)
8989

9090
operating_system, env = get_os_and_env()
91-
if operating_system and operating_system != "macosx":
92-
builder_dir = os.path.dirname(os.path.abspath(__file__))
93-
test_dir = os.path.dirname(builder_dir)
91+
92+
builder_dir = os.path.dirname(os.path.abspath(__file__))
93+
test_dir = os.path.dirname(builder_dir)
94+
if not operating_system:
95+
entitlements_file = "entitlements-macos.plist"
96+
else:
9497
if env == "simulator":
9598
entitlements_file = "entitlements-simulator.plist"
9699
else:
97100
entitlements_file = "entitlements.plist"
98-
entitlements = os.path.join(test_dir, "make", entitlements_file)
99-
args["CODESIGN"] = "codesign --entitlements {}".format(entitlements)
100-
else:
101-
args["CODESIGN"] = "codesign"
101+
entitlements = os.path.join(test_dir, "make", entitlements_file)
102+
args["CODESIGN"] = "codesign --entitlements {}".format(entitlements)
102103

103104
# Return extra args as a formatted string.
104105
return ["{}={}".format(key, value) for key, value in args.items()]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.get-task-allow</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)