[llvm] [cross-project-tests] Avoid requiring packaging for GDB/LLDB version checks (PR #225126)

Michael Buch via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 02:10:40 PDT 2026


================
@@ -435,10 +438,13 @@ def set_apple_lldb_pre_1000_feature():
 if dwarf_version_string and gdb_version_string:
     if int(dwarf_version_string) >= 5:
         try:
-            from packaging import version
-        except:
-            lit_config.fatal("Running gdb tests requires the packaging package")
-        if version.parse(gdb_version_string) < version.parse("10.1"):
+            gdb_too_old = parse_version(gdb_version_string) < parse_version("10.1")
+        except ValueError as e:
+            lit_config.warning(
+                f"Assuming GDB {gdb_version_string} is incompatible with DWARF v5: {e}"
+            )
+            gdb_too_old = True
+        if gdb_too_old:
----------------
Michael137 wrote:

why can't we put this into the `except` block? Why is `gdb_too_old` needed?

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


More information about the llvm-commits mailing list