Skip to content

Commit

Permalink
Propagate SDKROOT env var in Shell tests on Windows
Browse files Browse the repository at this point in the history
We need the manual lookup in lldb/source/Host/windows/HostInfoWindowsSwift.cpp to succeed.
Otherwise SwiftASTContext::CreateInstance() fails with: Cannot create Swift scratch context (couldn't load the Swift stdlib)
  • Loading branch information
weliveindetail committed Oct 21, 2024
1 parent 266bc21 commit 1dcabd2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lldb/test/Shell/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,16 @@ def use_support_substitutions(config):
sdk_path = lit.util.to_string(out)
llvm_config.lit_config.note("using SDKROOT: %r" % sdk_path)
host_flags += ["-isysroot", sdk_path]
elif sys.platform != "win32":
elif sys.platform == "win32":
# Required in SwiftREPL tests
sdk_path = os.environ.get("SDKROOT")
if sdk_path:
llvm_config.lit_config.note(f"using SDKROOT: {sdk_path}")
llvm_config.with_environment("SDKROOT", sdk_path)
else:
llvm_config.lit_config.warning(
"mandatory environment variable not found: SDKROOT")
else:
host_flags += ["-pthread"]

config.target_shared_library_suffix = (
Expand Down

0 comments on commit 1dcabd2

Please sign in to comment.