Skip to content

Use get_python_lib to look for lldb python lib dir. #7685

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 2 commits into from
Feb 23, 2017
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
8 changes: 8 additions & 0 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import tempfile
import socket
import glob
import pipes
from distutils.sysconfig import get_python_lib

import lit
import lit.formats
Expand Down Expand Up @@ -1068,3 +1069,10 @@ if os.path.exists(libswiftCore_path):
config.available_features.add("static_stdlib")
config.substitutions.append(('%target-static-stdlib-path', static_stdlib_path))
lit_config.note('using static stdlib path: %s' % static_stdlib_path)

if config.lldb_build_root != "":
config.available_features.add('lldb')
# Note: using the same approach to locating the lib dir as in
# finishSwigPythonLLDB.py in the lldb repo
python_lib_dir = get_python_lib(True, False, config.lldb_build_root)
config.substitutions.append(('%lldb-python-path', python_lib_dir))
8 changes: 1 addition & 7 deletions test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ config.android_ndk_path = "@SWIFT_ANDROID_NDK_PATH@"
config.android_ndk_gcc_version = "@SWIFT_ANDROID_NDK_GCC_VERSION@"

config.coverage_mode = "@SWIFT_ANALYZE_CODE_COVERAGE@"
config.lldb_build_root = "@LLDB_BUILD_DIR@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we need this line in validation-test/lit.site.cfg.in too. Otherwise,

  File "/home/rintaro/Documents/swift-oss/swift/test/lit.cfg", line 1073, in <module>
    if config.lldb_build_root != "":
AttributeError: TestingConfig instance has no attribute 'lldb_build_root'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, fixed that already, thanks.


if "@SWIFT_ASAN_BUILD@" == "TRUE":
config.available_features.add("asan")
Expand Down Expand Up @@ -79,13 +80,6 @@ if "@CMAKE_GENERATOR@" == "Xcode":

config.available_features.add("CMAKE_GENERATOR=@CMAKE_GENERATOR@")

if "@LLDB_ENABLE@" == "TRUE":
config.available_features.add('lldb')
for root, dirs, files in os.walk("@LLDB_BUILD_DIR@"):
if root.endswith("site-packages"):
config.substitutions.append(('%lldb-python-path', root))
break

# Let the main config do the real work.
if config.test_exec_root is None:
config.test_exec_root = os.path.dirname(os.path.realpath(__file__))
Expand Down
1 change: 1 addition & 0 deletions validation-test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ config.android_ndk_path = "@SWIFT_ANDROID_NDK_PATH@"
config.android_ndk_gcc_version = "@SWIFT_ANDROID_NDK_GCC_VERSION@"

config.coverage_mode = "@SWIFT_ANALYZE_CODE_COVERAGE@"
config.lldb_build_root = "@LLDB_BUILD_DIR@"

if "@SWIFT_ASAN_BUILD@" == "TRUE":
config.available_features.add("asan")
Expand Down