Skip to content

[lldb] make lit use the same PYTHONHOME for building and testing #143183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler-rt/test/lit.common.configured.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ set_default("gold_executable", "@GOLD_EXECUTABLE@")
set_default("clang", "@COMPILER_RT_RESOLVED_TEST_COMPILER@")
set_default("compiler_id", "@COMPILER_RT_TEST_COMPILER_ID@")
set_default("python_executable", "@Python3_EXECUTABLE@")
set_default("python_root_dir", "@Python3_ROOT_DIR@")
set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@)
set_default("compiler_rt_intercept_libdispatch", @COMPILER_RT_INTERCEPT_LIBDISPATCH_PYBOOL@)
set_default("compiler_rt_output_dir", "@COMPILER_RT_RESOLVED_OUTPUT_DIR@")
Expand Down
5 changes: 5 additions & 0 deletions lldb/test/Shell/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,8 @@ def calculate_arch_features(arch_string):
config.available_features.add("ld_new-bug")
except:
pass

# Some shell tests dynamically link with python.dll and need to know the
# location of the Python libraries. This ensures that we use the same
# version of Python that was used to build lldb to run our tests.
config.environment["PYTHONHOME"] = config.python_root_dir
1 change: 1 addition & 0 deletions lldb/test/Shell/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ config.enable_remote = not @LLDB_TEST_SHELL_DISABLE_REMOTE@
config.libcxx_libs_dir = "@LIBCXX_LIBRARY_DIR@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_executable = "@Python3_EXECUTABLE@"
config.python_root_dir = "@Python3_ROOT_DIR@"
config.have_zlib = @LLVM_ENABLE_ZLIB@
config.objc_gnustep_dir = "@LLDB_TEST_OBJC_GNUSTEP_DIR@"
config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Unit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
]
)
llvm_config.with_environment("PATH", os.path.dirname(sys.executable), append_path=True)
config.environment["PYTHONHOME"] = config.python_root_dir

# Enable sanitizer runtime flags.
if config.llvm_use_sanitizer:
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Unit/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config.lldb_src_root = "@LLDB_SOURCE_DIR@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.python_executable = "@Python3_EXECUTABLE@"
config.python_root_dir = "@Python3_ROOT_DIR@"

import lit.llvm
lit.llvm.initialize(lit_config, config)
Expand Down
Loading