[llvm] [cross-project-tests][formatters] Add a LIT feature that tests for a compatible LLDB version (PR #174812)

David Stenberg via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 5 10:11:28 PST 2026


dstenb wrote:

Hi! Unless I have overlooked something here, I think there are some issues with the version checking, at least on a Ubuntu 22.04.5 machine with Python 3.10.12. I used a commit from today (0fe9454c5672a73594fe71e28987760b7d82e3b7).

```
$ python3 --version
Python 3.10.12
>> packaging.__version__
'21.3'
```

1.) If I have a lldb built from the 21.1.8 release tag with the git revision present in PATH:

```
$ lldb --version
lldb version 21.1.8 (https://github.com/llvm/llvm-project revision 2078da43e25a4623cab2d0d60decddf709aaea28)
  clang revision 2078da43e25a4623cab2d0d60decddf709aaea28
  llvm revision 2078da43e25a4623cab2d0d60decddf709aaea28
```

the `get_lldb_version_string()` function will with the greedy regex return the first digits in the SHA, 2078, not 21.1.8 as the version!

```
>>> re.search(r"lldb.*[ -]((\d|\.)+)", 'lldb version 21.1.8 (https://github.com/llvm/llvm-project revision 2078da43e25a4623cab2d0d60decddf709aaea28)').group(1)
'2078'
```

So, based on what SHA we happen to get the tests may or may not be run.

1.) If I instead have a 21.1.8 release built without the git revision:
    
```
$ lldb version 21.1.8
```

then `get_lldb_version_string()` function will correctly return 21.1.8, but `set_lldb_formatters_compatibility_feature` has a compared version which `packaging.version.parse` will parse as major component 1900:

```
min_required_lldb_version = "1900"
```

```
>> version.parse("1900").major
1900
```

so the tests will still not be run even though the version should be compatible:

```
Marking some LLDB LLVM data-formatter tests as unsupported: using version 21.1.8 whereas a version >= 1900 is required
```

https://github.com/llvm/llvm-project/pull/174812


More information about the llvm-commits mailing list