<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I have built the Feb 8th snapshot into /usr/local on Linux 64. &nbsp;I have enabled libdispatch, and it's installed to /usr/local as well. &nbsp;Additionally, I cherry-picked the PR&nbsp;<a href="https://github.com/apple/swift/pull/1212" class="">https://github.com/apple/swift/pull/1212</a>. &nbsp;It compiles, installs, everything's fine.<div class=""><br class=""></div><div class="">My /usr/local/include/dispatch directory has</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""># ls /usr/local/include/dispatch/</div><div class="">Dispatch.swiftdoc &nbsp; &nbsp; base.h &nbsp; data.h<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp;group.h<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; io.h<span class="Apple-tab-span" style="white-space:pre">        </span>object.h &nbsp;queue.h &nbsp; &nbsp; &nbsp;source.h</div><div class="">Dispatch.swiftmodule &nbsp;block.h &nbsp;dispatch.h &nbsp;introspection.h &nbsp;module.map<span class="Apple-tab-span" style="white-space:pre">        </span>once.h<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; semaphore.h &nbsp;time.h</div></blockquote><div class=""><div class=""><br class=""></div><div class="">Now I attempt to use Dispatch via</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class="">swift -Xcc -fblocks -L/usr/local/lib -I /usr/local/include/dispatch -lBlocksRuntime -L/usr/lib/x86_64-linux-gnu</div></blockquote><div class=""><div class=""><br class=""></div><div class=""><div class="">This is because:</div></div></div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">-Xcc -fblocks to pick up blocks support</li><li class="">-I /usr/local/include/dispatch to pick up /usr/local/include/dispatch/Dispatch.swiftmodule (as well as module.modulemap etc.)</li><li class="">-lBlocksRuntime -L/usr/lib/x86_64-linux-gnu to pick up blocks runtime</li></ul><div class=""><br class=""></div></div><div class="">Okay. &nbsp;So now I import Dispatch:</div><div class=""><br class=""></div><div class="">Welcome to Swift version 3.0-dev (LLVM a7663bb722, Clang 4ca3c7fa28, Swift 319a912638). Type :help for assistance.<br class="">&nbsp; 1&gt; import Dispatch</div><div class=""><br class=""></div><div class="">What I find is about half the time, this works just fine. &nbsp;The other half the time, I hit an import error:</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">&lt;module-includes&gt;:1:10: note: in file included from &lt;module-includes&gt;:1:<br class="">#include "/usr/local/include/dispatch/dispatch.h"<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^<br class="">/usr/local/include/dispatch/dispatch.h:34:10: note: in file included from /usr/local/include/dispatch/dispatch.h:34:<br class="">#include &lt;fcntl.h&gt;<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^<br class="">/usr/include/fcntl.h:67:11: note: in file included from /usr/include/fcntl.h:67:<br class=""># include &lt;time.h&gt;<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^<br class="">/usr/local/include/dispatch/time.h:25:2: error: "Please #include &lt;dispatch/dispatch.h&gt; instead of this file directly."<br class="">#error "Please #include &lt;dispatch/dispatch.h&gt; instead of this file directly."<br class="">&nbsp;^</blockquote><br class=""></div><div class="">What seems to be happening here is that we interpret /usr/include/fcntl.h's #include &lt;time.h&gt; to be /usr/local/include/dispatch/time.h instead of /usr/include/time.h.</div><div class=""><br class=""></div><div class="">This behavior is puzzling to me.</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">I don't understand why the behavior is nondeterministic. &nbsp;Shouldn't an import failure be deterministic behavior? &nbsp;Or are we just trying imports in random order? &nbsp;That seems like a bad implementation.</li><li class="">I don't understand how to make sure fcntl's `time.h` goes to the right time.h without also losing Dispatch.swiftmodule and module.modulemap in the exchange.</li></ul><div class=""><br class=""></div><div class="">Thanks in advance.</div><div class=""><br class=""></div></div></div></body></html>