[Lldb-commits] [lldb] 60dbe3f - [lldb] Fix has_lldb_codesign check (#194412)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 27 10:48:08 PDT 2026
Author: Sergei Druzhkov
Date: 2026-04-27T20:48:03+03:00
New Revision: 60dbe3fe4051f30ac12f0de56116faf2c516c313
URL: https://github.com/llvm/llvm-project/commit/60dbe3fe4051f30ac12f0de56116faf2c516c313
DIFF: https://github.com/llvm/llvm-project/commit/60dbe3fe4051f30ac12f0de56116faf2c516c313.diff
LOG: [lldb] Fix has_lldb_codesign check (#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
```
Added:
Modified:
lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
Removed:
################################################################################
diff --git a/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py b/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
index 002343ab8c8ff..bceef9ee27ea6 100644
--- a/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
+++ b/lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py
@@ -1,6 +1,7 @@
import os
import shutil
import subprocess
+import sys
import lldb
from lldbsuite.test.decorators import *
@@ -10,6 +11,8 @@
def has_lldb_codesign():
"""Check if the lldb_codesign certificate is available."""
try:
+ if sys.platform != "darwin":
+ return False
result = subprocess.run(
[
"security",
More information about the lldb-commits
mailing list