[Lldb-commits] [lldb] [lldb] Remove .noindex suffix from test output directory for non-Darwin (PR #197237)
Leonard Grey via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 11 09:07:51 PDT 2026
https://github.com/speednoisemovement updated https://github.com/llvm/llvm-project/pull/197237
>From 9cc0e0a9cf4f1b06974f7f0a3e7d81427fd0f20c Mon Sep 17 00:00:00 2001
From: Leonard Grey <leonard at leonardgrey.com>
Date: Tue, 12 May 2026 12:29:49 -0400
Subject: [PATCH 1/5] [lldb][Windows] Remove .noindex suffix from test output
directory
.noindex doesn't prevent indexing on Windows. Given that Windows
limits path length to 260 by default, there's a benefit to omitting
it.
---
lldb/packages/Python/lldbsuite/test/dotest_args.py | 4 +++-
lldb/test/API/sanity/TestModuleCacheSanity.py | 9 ++++++++-
lldb/test/CMakeLists.txt | 7 ++++++-
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index f3b0837bdc4ab..626b9b7046619 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -234,7 +234,9 @@ def create_parser():
"--build-dir",
dest="test_build_dir",
metavar="Test build directory",
- default="lldb-test-build.noindex",
+ default=(
+ "lldb-test-build" if sys.platform == "win32" else "lldb-test-build.noindex"
+ ),
help="The root build directory for the tests. It will be removed before running.",
)
group.add_argument(
diff --git a/lldb/test/API/sanity/TestModuleCacheSanity.py b/lldb/test/API/sanity/TestModuleCacheSanity.py
index 1d3a6b3158898..7e214fa9b7440 100644
--- a/lldb/test/API/sanity/TestModuleCacheSanity.py
+++ b/lldb/test/API/sanity/TestModuleCacheSanity.py
@@ -4,6 +4,8 @@
"""
+import sys
+
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
@@ -13,7 +15,12 @@ class ModuleCacheSanityTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test(self):
+ build_dir_name = (
+ "lldb-test-build"
+ if sys.platform == "win32"
+ else "lldb-test-build.noindex"
+ )
self.expect(
"settings show symbols.clang-modules-cache-path",
- substrs=["lldb-test-build.noindex", "module-cache-lldb"],
+ substrs=[build_dir_name, "module-cache-lldb"],
)
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 86974d86bbec6..81ae17a57ad0e 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -47,7 +47,12 @@ endif()
# based on the UUID embedded in a binary, and because the UUID is a
# hash of filename and .text section, there *will* be conflicts inside
# the build directory.
-set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build root for building tests.")
+# Omit it for Windows since it's a no-op and exacerbates path-length issues.
+if(WIN32)
+ set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build" CACHE PATH "The build root for building tests.")
+else()
+ set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build root for building tests.")
+endif()
# Configure and create module cache directories.
set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.")
>From 1f95c5b863ef587e3edeb45dd13562cf1114f984 Mon Sep 17 00:00:00 2001
From: Leonard Grey <leonard at leonardgrey.com>
Date: Tue, 12 May 2026 16:18:01 -0400
Subject: [PATCH 2/5] Fix expectation
---
lldb/test/Shell/Settings/TestModuleCacheSanity.test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/test/Shell/Settings/TestModuleCacheSanity.test b/lldb/test/Shell/Settings/TestModuleCacheSanity.test
index f16f40d47a6bf..37ce87da50e19 100644
--- a/lldb/test/Shell/Settings/TestModuleCacheSanity.test
+++ b/lldb/test/Shell/Settings/TestModuleCacheSanity.test
@@ -1,4 +1,4 @@
# This is a sanity check that verifies that the module cache path is set
# correctly and points inside the default test build directory.
RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck %s
-CHECK: lldb-test-build.noindex{{.*}}module-cache-lldb
+CHECK: lldb-test-build{{(\.noindex)?}}{{.*}}module-cache-lldb
>From 06945827f916d2db9728ec991d5c488791702b88 Mon Sep 17 00:00:00 2001
From: Leonard Grey <leonard at leonardgrey.com>
Date: Tue, 19 May 2026 17:03:41 -0400
Subject: [PATCH 3/5] Format
---
lldb/test/API/sanity/TestModuleCacheSanity.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lldb/test/API/sanity/TestModuleCacheSanity.py b/lldb/test/API/sanity/TestModuleCacheSanity.py
index 7e214fa9b7440..42baf2968cfc8 100644
--- a/lldb/test/API/sanity/TestModuleCacheSanity.py
+++ b/lldb/test/API/sanity/TestModuleCacheSanity.py
@@ -16,9 +16,7 @@ class ModuleCacheSanityTestCase(TestBase):
def test(self):
build_dir_name = (
- "lldb-test-build"
- if sys.platform == "win32"
- else "lldb-test-build.noindex"
+ "lldb-test-build" if sys.platform == "win32" else "lldb-test-build.noindex"
)
self.expect(
"settings show symbols.clang-modules-cache-path",
>From ea2b5d4dda45bd48c0cb5c6d73b6f68e170d2860 Mon Sep 17 00:00:00 2001
From: Leonard Grey <leonard at leonardgrey.com>
Date: Wed, 20 May 2026 14:17:29 -0400
Subject: [PATCH 4/5] All non-Darwin platforms
---
.../Python/lldbsuite/test/dotest_args.py | 2 +-
lldb/test/API/sanity/TestModuleCacheSanity.py | 2 +-
lldb/test/CMakeLists.txt | 17 ++++++++---------
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 626b9b7046619..3ed50174b97ec 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -235,7 +235,7 @@ def create_parser():
dest="test_build_dir",
metavar="Test build directory",
default=(
- "lldb-test-build" if sys.platform == "win32" else "lldb-test-build.noindex"
+ "lldb-test-build.noindex" if sys.platform == "darwin" else "lldb-test-build"
),
help="The root build directory for the tests. It will be removed before running.",
)
diff --git a/lldb/test/API/sanity/TestModuleCacheSanity.py b/lldb/test/API/sanity/TestModuleCacheSanity.py
index 42baf2968cfc8..3f847b24bf3d6 100644
--- a/lldb/test/API/sanity/TestModuleCacheSanity.py
+++ b/lldb/test/API/sanity/TestModuleCacheSanity.py
@@ -16,7 +16,7 @@ class ModuleCacheSanityTestCase(TestBase):
def test(self):
build_dir_name = (
- "lldb-test-build" if sys.platform == "win32" else "lldb-test-build.noindex"
+ "lldb-test-build.noindex" if sys.platform == "darwin" else "lldb-test-build"
)
self.expect(
"settings show symbols.clang-modules-cache-path",
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 81ae17a57ad0e..4676d1fb0fa74 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -42,16 +42,15 @@ if(LLDB_BUILT_STANDALONE)
endif()
# Configure the build directory.
-# The .noindex suffix is a marker for Spotlight to never index the
-# build directory. LLDB queries Spotlight to locate .dSYM bundles
-# based on the UUID embedded in a binary, and because the UUID is a
-# hash of filename and .text section, there *will* be conflicts inside
-# the build directory.
-# Omit it for Windows since it's a no-op and exacerbates path-length issues.
-if(WIN32)
- set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build" CACHE PATH "The build root for building tests.")
-else()
+if(APPLE)
+ # The .noindex suffix is a marker for Spotlight to never index the
+ # build directory. LLDB queries Spotlight to locate .dSYM bundles
+ # based on the UUID embedded in a binary, and because the UUID is a
+ # hash of filename and .text section, there *will* be conflicts inside
+ # the build directory.
set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build root for building tests.")
+else()
+ set(LLDB_TEST_BUILD_DIRECTORY "${PROJECT_BINARY_DIR}/lldb-test-build" CACHE PATH "The build root for building tests.")
endif()
# Configure and create module cache directories.
>From 712deb51143897c63f3630399c53c6372099aa0e Mon Sep 17 00:00:00 2001
From: Leonard Grey <leonard at leonardgrey.com>
Date: Thu, 11 Jun 2026 12:07:38 -0400
Subject: [PATCH 5/5] @ Simplify test expectations per review
Match on "lldb-test-build" prefix in both module cache sanity tests,
which works whether or not the .noindex suffix is present, instead of
branching on the platform.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply at anthropic.com>
@
---
lldb/test/API/sanity/TestModuleCacheSanity.py | 7 +------
lldb/test/Shell/Settings/TestModuleCacheSanity.test | 2 +-
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/lldb/test/API/sanity/TestModuleCacheSanity.py b/lldb/test/API/sanity/TestModuleCacheSanity.py
index 3f847b24bf3d6..41602c48226b5 100644
--- a/lldb/test/API/sanity/TestModuleCacheSanity.py
+++ b/lldb/test/API/sanity/TestModuleCacheSanity.py
@@ -4,8 +4,6 @@
"""
-import sys
-
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
@@ -15,10 +13,7 @@ class ModuleCacheSanityTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test(self):
- build_dir_name = (
- "lldb-test-build.noindex" if sys.platform == "darwin" else "lldb-test-build"
- )
self.expect(
"settings show symbols.clang-modules-cache-path",
- substrs=[build_dir_name, "module-cache-lldb"],
+ substrs=["lldb-test-build", "module-cache-lldb"],
)
diff --git a/lldb/test/Shell/Settings/TestModuleCacheSanity.test b/lldb/test/Shell/Settings/TestModuleCacheSanity.test
index 37ce87da50e19..e39a3d7bd692f 100644
--- a/lldb/test/Shell/Settings/TestModuleCacheSanity.test
+++ b/lldb/test/Shell/Settings/TestModuleCacheSanity.test
@@ -1,4 +1,4 @@
# This is a sanity check that verifies that the module cache path is set
# correctly and points inside the default test build directory.
RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck %s
-CHECK: lldb-test-build{{(\.noindex)?}}{{.*}}module-cache-lldb
+CHECK: lldb-test-build{{.*}}module-cache-lldb
More information about the lldb-commits
mailing list