<div dir="ltr"><b>Problem solved:</b> On Linux you need to add the swift 3.1 tool chain clang include directory to your import path. It wasn't needed for the previous version. So add this to your swift build options and lldb will start working again.<div><br></div><div>-Xswiftc -I${SWIFT_HOME}/usr/lib/swift/clang/include</div><div><br></div><div>Ed</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 14, 2017 at 12:52 PM, Edward Connell <span dir="ltr"><<a href="mailto:ewconnell@gmail.com" target="_blank">ewconnell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What version of clang does Swift 3.1 expect?<div><br></div><div>My version is:</div><div><br></div><div><div>clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)</div><div>Target: x86_64-pc-linux-gnu</div><div>Thread model: posix</div><div>InstalledDir: /usr/bin</div></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 14, 2017 at 12:23 PM, Edward Connell <span dir="ltr"><<a href="mailto:ewconnell@gmail.com" target="_blank">ewconnell@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I didn't see anything in the log that offered an obvious clue to the problem. However I made a test case of only a few lines that demonstrates the problem. Importing Foundation seems to be part of the problem.<div><br></div><div><ol><li>set a breakpoint on the print statement</li><li>start debugging</li><li>on break, at the lldb prompt "p someText", you will get the output below complaining about SwiftGlibc</li></ol><div><div><br class="m_5547263196164382373m_-4702953251602105295gmail-Apple-interchange-newline">If you comment out "import Foundation" and do the same thing, it works correctly.</div><div>I've attached this linux test project</div><div><br></div></div><div>// main.swift -----------------------------</div><div><div>import Foundation</div><div><br></div><div>var someText = "hey there"</div><div><br></div><div>for i in 0..<10 {</div><div><span class="m_5547263196164382373m_-4702953251602105295gmail-Apple-tab-span" style="white-space:pre-wrap">        </span>print("Hello, World!")</div><div>}</div></div><div><br></div></div><div>// output ------------------------------<wbr>----</div><div><i><font size="1">e</font></i><font size="1"><i>rror: in auto-import:</i></font></div><div><font size="1"><i>failed to get module 'HelloWorld' from AST context:</i></font></div><div><font size="1"><i>/home/ed/swift/usr/lib/swift/C<wbr>oreFoundation/CoreFoundation.h<wbr>:25:10: note: while building module 'SwiftGlibc' imported from /home/ed/swift/usr/lib/swift/C<wbr>oreFoundation/CoreFoundation.h<wbr>:25:</i></font></div><div><font size="1"><i>#include <sys/types.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i><module-includes>:3:10: note: in file included from <module-includes>:3:</i></font></div><div><font size="1"><i>#include "///usr/include/utmp.h"</i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>///usr/include/utmp.h:23:10: note: in file included from ///usr/include/utmp.h:23:</i></font></div><div><font size="1"><i>#include <sys/types.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>error: /usr/include/x86_64-linux-gnu/<wbr>sys/types.h:146:10: error: 'stddef.h' file not found</i></font></div><div><font size="1"><i>#include <stddef.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i><module-includes>:1:10: note: in file included from <module-includes>:1:</i></font></div><div><font size="1"><i>#include "CoreFoundation.h"</i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>error: /home/ed/swift/usr/lib/swift/C<wbr>oreFoundation/CoreFoundation.h<wbr>:25:10: error: could not build module 'SwiftGlibc'</i></font></div><div><font size="1"><i>#include <sys/types.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>/home/ed/swift/usr/lib/swift/C<wbr>oreFoundation/CFStream.h:20:10<wbr>: note: while building module 'CDispatch' imported from /home/ed/swift/usr/lib/swift/C<wbr>oreFoundation/CFStream.h:20:</i></font></div><div><font size="1"><i>#include <dispatch/dispatch.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i><module-includes>:1:10: note: in file included from <module-includes>:1:</i></font></div><div><font size="1"><i>#include "dispatch.h"</i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>/home/ed/swift/usr/lib/swift/d<wbr>ispatch/dispatch.h:42:10: note: in file included from /home/ed/swift/usr/lib/swift/d<wbr>ispatch/dispatch.h:42:</i></font></div><div><font size="1"><i>#include <sys/cdefs.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>error: /usr/include/x86_64-linux-gnu/<wbr>sys/cdefs.h:23:11: error: could not build module 'SwiftGlibc'</i></font></div><div><font size="1"><i># include <features.h></i></font></div><div><font size="1"><i> ^</i></font></div><div><font size="1"><i><br></i></font></div><div><font size="1"><i>error: could not build Objective-C module 'CoreFoundation'</i></font></div><div><br></div><div><br></div></div><div class="m_5547263196164382373HOEnZb"><div class="m_5547263196164382373h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 14, 2017 at 11:24 AM, Jim Ingham <span dir="ltr"><<a href="mailto:jingham@apple.com" target="_blank">jingham@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The lldb "types" log is the place where detailed info about what's going on gets dumped. Turn that on with:<br>
<br>
(lldb) log enable -f /tmp/lldb-types-log.txt lldb types<br>
<br>
Jim<br>
<div><div class="m_5547263196164382373m_-4702953251602105295h5"><br>
> On Apr 14, 2017, at 9:33 AM, Edward Connell via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> wrote:<br>
><br>
> Groan... I just tried to update to Swift 3.1 on ubuntu 16.04. Everything builds fine, but when I try to debug I get the dreaded:<br>
><br>
> error in auto-import: failed to get module 'XYZ' from AST context<br>
><br>
> Everything built and debugged just fine with the previous Swift release.<br>
> I assume LLDB is unhappy about either failing to find an import, or somehow thinking there is a duplicate.<br>
><br>
> How do we get LLDB to disclose the reason that it's failing?<br>
><br>
> Thanks, Ed<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> swift-users mailing list<br>
> <a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-users</a><br>
<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>