[Lldb-commits] [lldb] [lldb] Fix has_lldb_codesign check (PR #194412)
via lldb-commits
lldb-commits at lists.llvm.org
Mon Apr 27 09:54:38 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Sergei Druzhkov (DrSergei)
<details>
<summary>Changes</summary>
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
```
---
Full diff: https://github.com/llvm/llvm-project/pull/194412.diff
1 Files Affected:
- (modified) lldb/test/API/macosx/dsym_codesign/TestdSYMCodesign.py (+2)
``````````diff
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",
``````````
</details>
https://github.com/llvm/llvm-project/pull/194412
More information about the lldb-commits
mailing list