For the mail (so it's easier to find than in a bug tracking system) the fix is
to specify the clang include headers either with an -I on the swift invocation
command line, or via the variables C_INCLUDE_PATH and CPLUS_INCLUDE_PATH
setting the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH environment
Just to update the record, Matthias M. Schneider posted a workaround on
bugs.swift.org.
By setting the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH environment variables to
point to the Clang headers directory, it is possible to both import Foundation
in the REPL (without using -I to pass the header
I'm reviving this somewhat-old thread because it's still the most prominent
search result when googling this issue to debug it (other than the
below-referenced SR-3648).
The workaround of using -I to pass an include path to swift was working for me,
because as noted by Will Stanton below, the
From https://bugs.swift.org/browse/SR-3648, the work-around seems to be passing
-I /path/to/extracted/usr/lib/swift/clang/include when invoking swift (credit
Lukas and others, SR-3794 is more active)
So, ex. `swift -I ~/a-swift/usr/lib/swift/clang/include/`
Fortunately, the issue has only come