From f7b8c8dc3a670c70e5e21f63dc1e8e7cfb682c43 Mon Sep 17 00:00:00 2001 From: kendal Date: Wed, 14 Aug 2024 16:23:37 -0700 Subject: [PATCH] [lldb][dotest] Add an arg to add DLL search paths. In python 3.8 PATH is no longer used to search for DLLs on Windows. When building Swift's patched version of LLDB this prevents LLDB from starting up, because it cannot find DLLs like swiftCore.dll, cmark-gfm.dll, etc.. For context in this change to Python 3.8, see: https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew --- lldb/packages/Python/lldbsuite/test/dotest.py | 4 ++++ lldb/packages/Python/lldbsuite/test/dotest_args.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index f14a00a2394b0..aa9581a0aedc2 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -219,6 +219,10 @@ def parseOptionsAndInitTestdirs(): except: raise + if args.dll_directory: + for dir in args.dll_directory: + os.add_dll_directory(dir) + if args.unset_env_varnames: for env_var in args.unset_env_varnames: if env_var in os.environ: diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py index a80428ebec589..cdcc659df61b1 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest_args.py +++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py @@ -321,6 +321,12 @@ def create_parser(): action="append", help="Specify an environment variable to set to the given value for the inferior.", ) + # See https://docs.python.org/3.8/whatsnew/3.8.html#bpo-36085-whatsnew. + group.add_argument( + "--dll-directory", + action="append", + help="Specify a directory to include when searching for .dll files. This can be passed multiple times.", + ) X( "-v", "Do verbose mode of unittest framework (print out each test case invocation)",