DerekSelander/LLDB

error when `ex -l swift -- import Foundation`

TomKaminski opened this issue · 2 comments

Hey,

I've just started this book and got an error while trying to import Foundation into lldb.

(lldb) ex -l swift -- import Foundation

Cannot create Swift scratch context (couldn't load the Swift stdlib)Cannot create Swift scratch context (couldn't load the Swift stdlib)Shared Swift state for Xcode could not be initialized.
The REPL and expressions are unavailable.

What is going on here?

Command line tools are set in Xcode preferences:
Screenshot 2019-10-26 at 13 49 58

Regards,
Tom

Hi Tom!

If your goal is simply to import foundation, I'd recommend running e @import Foundation, assuming you've stopped in Obj-C land.

Hope that helps!

This seems to be a known bug. See this Twitter thread: https://twitter.com/davidecci/status/1190028084508012549

Fortunately, Apple developers are aware and are on it.