[lldb][test] Remove LLDB_TEST_USE_VENDOR_PACKAGES (#89260)

The `LLDB_TEST_USE_VENDOR_PACKAGES` has defaulted to `Off` for a while.
Either installing `pexpect` or skipping those tests with
`-DLLDB_TEST_USER_ARGS=--skip-category=pexpect` seems to be enough that
we can fully remove this option.

This patch removes the `LLDB_TEST_USE_VENDOR_PACKAGES` cmake
configuration as well as the associated code to add
`third_party/Python/module` to the python path. I'll do the actual
deletion of `third_party/Python/module` in a followup PR in the
(unlikely, I hope) event this commit needs to be reverted.

GitOrigin-RevId: 0e5c28d1930e7210f0f293312382c54d298dda06
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
index 5d62213..a758261 100644
--- a/cmake/modules/LLDBConfig.cmake
+++ b/cmake/modules/LLDBConfig.cmake
@@ -67,8 +67,6 @@
 option(LLDB_SKIP_DSYM "Whether to skip generating a dSYM when installing lldb." OFF)
 option(LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS
   "Fail to configure if certain requirements are not met for testing." OFF)
-option(LLDB_TEST_USE_VENDOR_PACKAGES
-  "Use packages from lldb/third_party/Python/module instead of system deps." OFF)
 
 set(LLDB_GLOBAL_INIT_DIRECTORY "" CACHE STRING
   "Path to the global lldbinit directory. Relative paths are resolved relative to the
diff --git a/packages/Python/lldbsuite/test/lldb_pylint_helper.py b/packages/Python/lldbsuite/test/lldb_pylint_helper.py
index 3b746c3..2558be1 100644
--- a/packages/Python/lldbsuite/test/lldb_pylint_helper.py
+++ b/packages/Python/lldbsuite/test/lldb_pylint_helper.py
@@ -157,14 +157,6 @@
                 0, os.path.join(packages_python_child_dir, "test_runner", "lib")
             )
 
-            # Handle third_party module/package directory.
-            third_party_module_dir = os.path.join(
-                check_dir, "third_party", "Python", "module"
-            )
-            for child_dir in child_dirs(third_party_module_dir):
-                # Yes, we embed the module in the module parent dir
-                sys.path.insert(0, child_dir)
-
             # We're done.
             break
 
diff --git a/test/API/lit.cfg.py b/test/API/lit.cfg.py
index 9ea389c..9d67759 100644
--- a/test/API/lit.cfg.py
+++ b/test/API/lit.cfg.py
@@ -310,6 +310,3 @@
 # Propagate XDG_CACHE_HOME
 if "XDG_CACHE_HOME" in os.environ:
     config.environment["XDG_CACHE_HOME"] = os.environ["XDG_CACHE_HOME"]
-
-if is_configured("use_vendor_packages"):
-    config.environment["LLDB_TEST_USE_VENDOR_PACKAGES"] = "1"
diff --git a/test/API/lit.site.cfg.py.in b/test/API/lit.site.cfg.py.in
index c2602ac..053331d 100644
--- a/test/API/lit.site.cfg.py.in
+++ b/test/API/lit.site.cfg.py.in
@@ -38,7 +38,6 @@
 # The API tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api")
-config.use_vendor_packages = @LLDB_TEST_USE_VENDOR_PACKAGES@
 
 # Plugins
 lldb_build_intel_pt = '@LLDB_BUILD_INTEL_PT@'
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index b6ec5bc..6a9ca59 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -245,8 +245,7 @@
   LLDB_HAS_LIBCXX
   LLDB_TOOL_LLDB_SERVER_BUILD
   LLDB_USE_SYSTEM_DEBUGSERVER
-  LLDB_IS_64_BITS
-  LLDB_TEST_USE_VENDOR_PACKAGES)
+  LLDB_IS_64_BITS)
 
 # Configure the individual test suites.
 add_subdirectory(API)
diff --git a/use_lldb_suite_root.py b/use_lldb_suite_root.py
index b8f8acf..9c3dd56 100644
--- a/use_lldb_suite_root.py
+++ b/use_lldb_suite_root.py
@@ -3,17 +3,6 @@
 import sys
 
 
-def add_third_party_module_dirs(lldb_root):
-    third_party_modules_dir = os.path.join(lldb_root, "third_party", "Python", "module")
-    if not os.path.isdir(third_party_modules_dir):
-        return
-
-    module_dirs = os.listdir(third_party_modules_dir)
-    for module_dir in module_dirs:
-        module_dir = os.path.join(third_party_modules_dir, module_dir)
-        sys.path.insert(0, module_dir)
-
-
 def add_lldbsuite_packages_dir(lldb_root):
     packages_dir = os.path.join(lldb_root, "packages", "Python")
     sys.path.insert(0, packages_dir)
@@ -21,7 +10,4 @@
 
 lldb_root = os.path.dirname(inspect.getfile(inspect.currentframe()))
 
-# Use environment variables to avoid plumbing flags, lit configs, etc.
-if os.getenv("LLDB_TEST_USE_VENDOR_PACKAGES"):
-    add_third_party_module_dirs(lldb_root)
 add_lldbsuite_packages_dir(lldb_root)
diff --git a/utils/lldb-dotest/CMakeLists.txt b/utils/lldb-dotest/CMakeLists.txt
index 2ba40f0..09f41db 100644
--- a/utils/lldb-dotest/CMakeLists.txt
+++ b/utils/lldb-dotest/CMakeLists.txt
@@ -10,7 +10,6 @@
 llvm_canonicalize_cmake_booleans(
   LLDB_BUILD_INTEL_PT
   LLDB_HAS_LIBCXX
-  LLDB_TEST_USE_VENDOR_PACKAGES
 )
 
 if ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
diff --git a/utils/lldb-dotest/lldb-dotest.in b/utils/lldb-dotest/lldb-dotest.in
index 9291f59..0224255 100755
--- a/utils/lldb-dotest/lldb-dotest.in
+++ b/utils/lldb-dotest/lldb-dotest.in
@@ -18,12 +18,8 @@
 libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
 libcxx_include_dir = "@LIBCXX_GENERATED_INCLUDE_DIR@"
 libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
-use_vendor_packages = @LLDB_TEST_USE_VENDOR_PACKAGES@
 
 if __name__ == '__main__':
-    if use_vendor_packages:
-        os.putenv("LLDB_TEST_USE_VENDOR_PACKAGES", "1")
-
     wrapper_args = sys.argv[1:]
     dotest_args = []
     # split on an empty string will produce [''] and if you