Create a marker for Spotlight to never index $BUILD_DIR.

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 $BUILD_DIR.

This should fix the broken green dragon bots.

llvm-svn: 324019
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index 5a2d44e..51f12e3 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -1196,8 +1196,17 @@
 
     # Set up the working directory.
     # Note that it's not dotest's job to clean this directory.
-    try: os.makedirs(configuration.test_build_dir)
-    except: pass
+    import lldbsuite.test.lldbutil as lldbutil
+    build_dir = configuration.test_build_dir
+    lldbutil.mkdir_p(build_dir)
+
+    # Create a marker for Spotlight to never index $BUILD_DIR.  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 $BUILD_DIR.
+    if platform.system() == "Darwin":
+        with open(os.path.join(build_dir, '.metadata_never_index'), 'w+'):
+            pass
 
     target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]