[llvm] [Dexter] Add basic structured script parsing (PR #193710)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 08:24:48 PDT 2026


================
@@ -110,6 +110,49 @@ def get_required_attr(config, attr_name):
     config.available_features.add("llvm-ar")
 
 
+def check_dexter_requirements():
+    # Determine whether Dexter's dependencies are available, and disable Dexter tests if not.
+    dexter_requirements_path = os.path.join(
+        config.cross_project_tests_src_root,
+        "debuginfo-tests",
+        "dexter",
+        "requirements.txt",
+    )
+    if not os.path.isfile(dexter_requirements_path):
+        print(
+            f"Couldn't find Dexter requirements path at existed path: {dexter_requirements_path}"
+        )
+        return False
+    with open(dexter_requirements_path) as req:
+        requirements_list = [
+            req_str
+            for req_line in req
+            if (req_str := req_line.strip()) and not req_str.startswith("#")
+        ]
+    try:
+        from packaging.requirements import Requirement
+        from importlib.metadata import version
+    except Exception as e:
+        # If we don't have packaging, we can't check requirements - assume false.
+        print(f"Missing required packages to check version: {e}")
+        return False
+    for req_str in requirements_list:
+        req = Requirement(req_str)
+        if req.marker and not req.marker.evaluate():
+            continue
+        try:
+            current_version = version(req.name)
+        except BaseException as e:
+            print(f"Missing required packages for Dexter: {req_str}")
+            return False
+        if req.specifier and current_version not in req.specifier:
+            print(
+                f"Dexter Requirement {req_str} has incorrect installed version {current_version}"
+            )
+            return False
+    return True
----------------
OCHyams wrote:

Are these these sorts of checks anywhere else in LLVM? Just curious if there's prior art or less verbose ways to check

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


More information about the llvm-commits mailing list