[Lldb-commits] [lldb] [lldb] Fix has_lldb_codesign check (PR #194412)
Sergei Druzhkov via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 27 09:53:57 PDT 2026
https://github.com/DrSergei created https://github.com/llvm/llvm-project/pull/194412
I met a problem with this test on WSL. WSL has access to Windows's files. Windows distribution has `security` dir ( `/mnt/c/Windows/security` from WSL point of view). So when we try to run `security` command we get `PermissionError` instead of `FileNotFoundError`. It is would not be a problem, but Python firstly calls decorators for methods (see example below), so we call `has_lldb_codesign()` not only on Darwin platform. Also I think some Linux distros might have `security` command, so the current check is not robust enough.
```python
import unittest
def checker():
raise Exception("test")
@unittest.skipUnless(False, "")
class Tests(unittest.TestCase):
@unittest.skipUnless(checker(), ())
def test():
pass
```
>From ec5c63c84feadab99ca0876138ad56e8e68a37c6 Mon Sep 17 00:00:00 2001
From: Sergei Druzhkov <serzhdruzhok at gmail.com>
Date: Mon, 27 Apr 2026 19:21:38 +0300
Subject: [PATCH] [lldb] Fix has_lldb_codesign check
---
lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py b/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
index 002343ab8c8ff..e270d3579eea4 100644
--- a/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
+++ b/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
@@ -10,6 +10,8 @@
def has_lldb_codesign():
"""Check if the lldb_codesign certificate is available."""
try:
+ if lldbplatformutil.getPlatform() not in lldbplatformutil.getDarwinOSTriples():
+ return False
result = subprocess.run(
[
"security",
More information about the lldb-commits
mailing list