[Lldb-commits] [lldb] 0e5c28d - [lldb][test] Remove LLDB_TEST_USE_VENDOR_PACKAGES (#89260)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 18 11:17:44 PDT 2024


Author: Jordan Rupprecht
Date: 2024-04-18T13:17:39-05:00
New Revision: 0e5c28d1930e7210f0f293312382c54d298dda06

URL: https://github.com/llvm/llvm-project/commit/0e5c28d1930e7210f0f293312382c54d298dda06
DIFF: https://github.com/llvm/llvm-project/commit/0e5c28d1930e7210f0f293312382c54d298dda06.diff

LOG: [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.

Added: 
    

Modified: 
    clang/cmake/caches/Fuchsia.cmake
    lldb/cmake/modules/LLDBConfig.cmake
    lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
    lldb/test/API/lit.cfg.py
    lldb/test/API/lit.site.cfg.py.in
    lldb/test/CMakeLists.txt
    lldb/use_lldb_suite_root.py
    lldb/utils/lldb-dotest/CMakeLists.txt
    lldb/utils/lldb-dotest/lldb-dotest.in
    llvm/utils/gn/secondary/lldb/test/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/clang/cmake/caches/Fuchsia.cmake b/clang/cmake/caches/Fuchsia.cmake
index 393d97a4cf1a33..30a3b9116a461f 100644
--- a/clang/cmake/caches/Fuchsia.cmake
+++ b/clang/cmake/caches/Fuchsia.cmake
@@ -65,7 +65,6 @@ set(_FUCHSIA_BOOTSTRAP_PASSTHROUGH
   LLDB_EMBED_PYTHON_HOME
   LLDB_PYTHON_HOME
   LLDB_PYTHON_RELATIVE_PATH
-  LLDB_TEST_USE_VENDOR_PACKAGES
   LLDB_TEST_USER_ARGS
   Python3_EXECUTABLE
   Python3_LIBRARIES

diff  --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index 5d62213c3f5838..a758261073ac57 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -67,8 +67,6 @@ option(LLDB_SKIP_STRIP "Whether to skip stripping of binaries when installing ll
 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/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py b/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
index 3b746c3f9242df..2558be1364d9be 100644
--- a/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
+++ b/lldb/packages/Python/lldbsuite/test/lldb_pylint_helper.py
@@ -157,14 +157,6 @@ def child_dirs(parent_dir):
                 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/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index 9ea389c639a013..9d6775917e1370 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -310,6 +310,3 @@ def delete_module_cache(path):
 # 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/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index c2602acd2ef85a..053331dc4881f7 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -38,7 +38,6 @@ config.libcxx_include_target_dir = "@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@"
 # 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/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index b6ec5bc4d819e3..6a9ca59f96b0f8 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -245,8 +245,7 @@ llvm_canonicalize_cmake_booleans(
   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/lldb/use_lldb_suite_root.py b/lldb/use_lldb_suite_root.py
index b8f8acf5dd94a4..9c3dd56a0e815a 100644
--- a/lldb/use_lldb_suite_root.py
+++ b/lldb/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 @@ def add_lldbsuite_packages_dir(lldb_root):
 
 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/lldb/utils/lldb-dotest/CMakeLists.txt b/lldb/utils/lldb-dotest/CMakeLists.txt
index 2ba40f009cc92a..09f41dbce421ec 100644
--- a/lldb/utils/lldb-dotest/CMakeLists.txt
+++ b/lldb/utils/lldb-dotest/CMakeLists.txt
@@ -10,7 +10,6 @@ set(LLDB_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
 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/lldb/utils/lldb-dotest/lldb-dotest.in b/lldb/utils/lldb-dotest/lldb-dotest.in
index 9291f59b41982d..022425591f4513 100755
--- a/lldb/utils/lldb-dotest/lldb-dotest.in
+++ b/lldb/utils/lldb-dotest/lldb-dotest.in
@@ -18,12 +18,8 @@ has_libcxx = @LLDB_HAS_LIBCXX@
 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

diff  --git a/llvm/utils/gn/secondary/lldb/test/BUILD.gn b/llvm/utils/gn/secondary/lldb/test/BUILD.gn
index c8245739842d9e..e903d16e338c93 100644
--- a/llvm/utils/gn/secondary/lldb/test/BUILD.gn
+++ b/llvm/utils/gn/secondary/lldb/test/BUILD.gn
@@ -61,7 +61,6 @@ write_lit_cfg("lit_api_site_cfg") {
     "LLDB_TEST_USER_ARGS=",
     "LLDB_ENABLE_PYTHON=0",
     "LLDB_HAS_LIBCXX=False",  # FIXME: support this (?)
-    "LLDB_TEST_USE_VENDOR_PACKAGES=False",
     "LLDB_LIBS_DIR=",  # FIXME: for shared builds only (?)
     "LLDB_TEST_ARCH=$current_cpu",
     "LLDB_TEST_COMPILER=" + rebase_path("$root_build_dir/bin/clang"),


        


More information about the lldb-commits mailing list