[Lldb-commits] [lldb] [lldb][test] Use a fake dsymForUUID in tests (PR #201547)

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Thu Jun 4 04:08:49 PDT 2026


https://github.com/Teemperor created https://github.com/llvm/llvm-project/pull/201547

Our test should not invoke dsymForUUID as it creates an unnecessary dependency on the OS and is also incredibly slow. For example, all Crashlog tests on my system run for more than 30s and all of this is just spent waiting for dsymForUUID to return "not found".

This patch provides a simple dummy dsymForUUID script we set for all tests. This is automatically picked up by LLDB with the existing dsymForUUID environment variable. As a result, all crashlog tests which previously run in total for about 4 minutes with one job, now run in about 10s.

assisted-by: claude

>From ea0730cb5ae870e060375209c23a946661534ed3 Mon Sep 17 00:00:00 2001
From: Raphael Isemann <rise at apple.com>
Date: Thu, 4 Jun 2026 11:26:02 +0100
Subject: [PATCH] [lldb][test] Use a fake dsymForUUID in tests

Our test should not invoke dsymForUUID as it creates an unnecessary
dependency on the OS and is also incredibly slow. For example, all
Crashlog tests on my system run for more than 30s and all of this
is just spent waiting for dsymForUUID to return "not found".

This patch provides a simple dummy dsymForUUID script we set for all
tests. This is automatically picked up by LLDB with the existing
dsymForUUID environment variable. As a result, all crashlog tests
which previously run in total for about 4 minutes with one job,
now run in about 10s.

assisted-by: claude
---
 lldb/test/API/lit.cfg.py                               | 10 ++++++++++
 .../ScriptInterpreter/Python/Crashlog/lit.local.cfg    |  2 --
 lldb/test/Shell/lit.cfg.py                             |  7 +++++++
 lldb/test/Utils/fake-dsymForUUID.sh                    |  9 +++++++++
 4 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100755 lldb/test/Utils/fake-dsymForUUID.sh

diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 2662a77199641..3ae8d743ed7a4 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -221,6 +221,16 @@ def delete_module_cache(path):
 if is_configured("llvm_tools_dir"):
     dotest_cmd += ["--env", "LLVM_TOOLS_DIR=" + config.llvm_tools_dir]
 
+# Prevent tests from accidentally invoking the real dsymForUUID, which can
+# make slow network requests. Tests that need a working dsymForUUID mock
+# should override this with their own script.
+if platform.system() == "Darwin":
+    dotest_cmd += [
+        "--env",
+        "LLDB_APPLE_DSYMFORUUID_EXECUTABLE="
+        + os.path.join(config.lldb_src_root, "test", "Utils", "fake-dsymForUUID.sh"),
+    ]
+
 # If we have a just-built libcxx, prefer it over the system one.
 if is_configured("has_libcxx") and config.has_libcxx:
     if platform.system() != "Windows":
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg
index 52bffaeac372b..1bf6d3432f688 100644
--- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg
+++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg
@@ -1,7 +1,5 @@
 if 'system-darwin' not in config.available_features:
   config.unsupported = True
 
-config.environment["LLDB_APPLE_DSYMFORUUID_EXECUTABLE"] = ""
-
 # Temporary parallel image loading deadlock workaround
 config.environment["NO_PARALLEL_IMG_LOADING"] = ""
diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 1b7532d12ce4a..c2a89a763a5e8 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -221,6 +221,13 @@ def calculate_arch_features(arch_string):
     except:
         pass
 
+    # Prevent tests from accidentally invoking the real dsymForUUID, which can
+    # make slow network requests. Tests that need a working dsymForUUID mock
+    # should override this.
+    config.environment["LLDB_APPLE_DSYMFORUUID_EXECUTABLE"] = os.path.join(
+        os.path.dirname(config.test_source_root), "Utils", "fake-dsymForUUID.sh"
+    )
+
 # Some shell tests dynamically link with python.dll and need to know the
 # location of the Python libraries. This ensures that we use the same
 # version of Python that was used to build lldb to run our tests.
diff --git a/lldb/test/Utils/fake-dsymForUUID.sh b/lldb/test/Utils/fake-dsymForUUID.sh
new file mode 100755
index 0000000000000..7e5cbe15a8cf8
--- /dev/null
+++ b/lldb/test/Utils/fake-dsymForUUID.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Dummy dsymForUUID for the LLDB test suite.
+# Returns an empty plist to indicate that no dSYM was found, without making
+# any network requests or slow filesystem searches.
+echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+echo "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"
+echo "<plist version=\"1.0\">"
+echo "<dict/>"
+echo "</plist>"



More information about the lldb-commits mailing list