I have no hands-on experience with it itself, but my understanding is that the std::async API in the current standards is pretty severely flawed and makes it awfully easy to shoot yourself in the foot. On the other hand, the libdispatch usage here does appear to be pretty basic. <div><br></div><div>Hopefully someone with more expertise can weigh in still!<br><br>måndag 30 maj 2016 skrev Brian Gesiak via swift-corelibs-dev &lt;<a href="mailto:swift-corelibs-dev@swift.org">swift-corelibs-dev@swift.org</a>&gt;:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Gah, thanks Brian and Chris -- yes, I had forgotten. I initialized it once on a separate development environment and forgot to do so again.<div><br></div><div>Thanks everyone! I managed to build the project. :)<br><br>I&#39;ll try getting SourceKit to link against my built libdispatch. Does anyone have any thoughts on my second question? Would it make sense to move SourceKit over to C++ async features? SourceKit only uses the following libdispatch symbols:<br><br><div>- dispatch_after</div><div>- dispatch_release</div><div>- dispatch_semaphore_create</div><div>- dispatch_semaphore_signal</div><div>- dispatch_semaphore_wait</div><div>- dispatch_time<br><br>As far as I understand, having SourceKit use libdispatch means:<br><br>1. Having libdispatch built as part of all Swift builds that build SourceKit. On OS X, most buildbot presets build SourceKit. I&#39;d like to do the same for Linux.</div><div>2. Building libdispatch prior to building Swift, or at least prior to building Swift tools like SourceKit.</div><div><br></div><div>Moving these build dependencies around seems like more work than using C++ async, but I barely know C++, so I&#39;m not sure. Thoughts?</div><div><br></div><div>- Brian Gesiak</div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 30, 2016 at 12:19 PM, Chris Bailey <span dir="ltr">&lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;BAILEYC@uk.ibm.com&#39;);" target="_blank">BAILEYC@uk.ibm.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">The missing reference is to &#39;pthread_workqueue_signal_np()&#39;
which was added to libpwq via PR #10:</font>
<br><font size="2" face="sans-serif">        </font><a href="https://github.com/mheily/libpwq/pull/10" target="_blank"><font size="2" color="blue" face="sans-serif">https://github.com/mheily/libpwq/pull/10</font></a>
<br>
<br><font size="2" face="sans-serif">I suspect that you don&#39;t have the libpwq
submodule checked out in swift-corelibs-libdispatch. Is there any contents
in swift-corelibs-libdispatch/libpwq?</font>
<br>
<br><font size="2" face="sans-serif">If not, running:</font>
<br><font size="2" face="sans-serif">        git
submodule init</font>
<br><font size="2" face="sans-serif">        git
submodule update</font>
<br><font size="2" face="sans-serif">from the swift-corelibs-libdispatch
directory should fix it.</font>
<br>
<br><font size="2" face="sans-serif">Chris<br>
</font>
<br>
<br>
<br>
<br><font size="1" color="#5f5f5f" face="sans-serif">From:      
 </font><font size="1" face="sans-serif">Brian Gesiak &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;modocache@gmail.com&#39;);" target="_blank">modocache@gmail.com</a>&gt;</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">To:      
 </font><font size="1" face="sans-serif">Chris Bailey/UK/IBM@IBMGB</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Cc:      
 </font><font size="1" face="sans-serif">Rob Allen &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;rob@akrabat.com&#39;);" target="_blank">rob@akrabat.com</a>&gt;,
Swift Core Libs &lt;<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-corelibs-dev@swift.org&#39;);" target="_blank">swift-corelibs-dev@swift.org</a>&gt;</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Date:      
 </font><font size="1" face="sans-serif">30/05/2016 16:51</font>
<br><span><font size="1" color="#5f5f5f" face="sans-serif">Subject:    
   </font><font size="1" face="sans-serif">Re: [swift-corelibs-dev]
libdispatch on Linux, or C++ std::async?</font>
<br>
</span><hr noshade><div><div>
<br>
<br>
<br><font size="3">Thanks for the quick responses!</font>
<br>
<br><font size="3">I had tried the experimental/foundation branch as well,
with no luck. Here&#39;s the full output from a clean build I just attempted: </font><a href="https://gist.github.com/modocache/fcf0c78908b39834448c73ac3f50c110" target="_blank"><font size="3" color="blue"><u>https://gist.github.com/modocache/fcf0c78908b39834448c73ac3f50c110</u></font></a><font size="3"><br>
<br>
Prior to the build I removed my entire build directory (which included
both libdispatch-linux-x86_64 and swift-linux-x86_64) and removed
all build artifacts from my libdispatch directory (I used `git clean -fxd`
-- Make tells me there&#39;s no target `distclean`).</font>
<br>
<br><font size="3">Looking at the build failure, it appears to be the same
one that was reported in </font><a href="https://bugs.swift.org/browse/SR-1242" target="_blank"><font size="3" color="blue"><u>https://bugs.swift.org/browse/SR-1242</u></font></a><font size="3">.
The author of that report indicates that </font><a href="https://github.com/apple/swift-corelibs-libdispatch/pull/64" target="_blank"><font size="3" color="blue"><u>https://github.com/apple/swift-corelibs-libdispatch/pull/64</u></font></a><font size="3">
fixes the problem. My checkout includes the commits from that pull request,
but the problem remains.</font>
<br><font size="3"><br>
In any case, thanks for all your help! I&#39;ll keep trying. Any and all advice
would be much appreciated!</font>
<br>
<br><font size="3">- Brian Gesiak</font>
<br>
<br>
<br><font size="3">On Mon, May 30, 2016 at 10:22 AM, Chris Bailey &lt;</font><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;BAILEYC@uk.ibm.com&#39;);" target="_blank"><font size="3" color="blue"><u>BAILEYC@uk.ibm.com</u></font></a><font size="3">&gt;
wrote:</font>
<br><font size="2" face="sans-serif">I&#39;d certainly recommend picking up the
experimental/foundation branch as Rob recommends. Its where we&#39;ve been
doing some additional work to get properly built into the Swift toolchain
and to open up some internal APIs needed by Foundation.</font><font size="3">
<br>
</font><font size="2" face="sans-serif"><br>
Whilst I&#39;ve been building Dispatch either independently or as part of a
full toolchain using the buildbot_linux preset (with dispatch and install-dispatch
added), I&#39;ve just checked your build line and its working fine for me.
It might be worth cleaning out any partial build you might have of libdispatch
in your build directory, and running &#39;make distclean&#39; from your libdispatch
source directory.</font><font size="3"> <br>
</font><font size="2" face="sans-serif"><br>
FYI, we&#39;ve got some further changes to the experimental/foundation branch
of libdispatch with should land in the next couple of days. This fixes
some issues with the Swift overlay, and resolves a crash that we&#39;ve found
in the underlying libkqueue implementation.</font><font size="3"> <br>
</font><font size="2" face="sans-serif"><br>
Chris</font><font size="3"><br>
<br>
<br>
<br>
</font><font size="1" color="#5f5f5f" face="sans-serif"><br>
From:        </font><font size="1" face="sans-serif">Rob
Allen via swift-corelibs-dev &lt;</font><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-corelibs-dev@swift.org&#39;);" target="_blank"><font size="1" color="blue" face="sans-serif"><u>swift-corelibs-dev@swift.org</u></font></a><font size="1" face="sans-serif">&gt;</font><font size="3">
</font><font size="1" color="#5f5f5f" face="sans-serif"><br>
To:        </font><font size="1" face="sans-serif">Brian
Gesiak &lt;</font><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;modocache@gmail.com&#39;);" target="_blank"><font size="1" color="blue" face="sans-serif"><u>modocache@gmail.com</u></font></a><font size="1" face="sans-serif">&gt;</font><font size="3">
</font><font size="1" color="#5f5f5f" face="sans-serif"><br>
Cc:        </font><font size="1" face="sans-serif">Swift
Core Libs &lt;</font><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-corelibs-dev@swift.org&#39;);" target="_blank"><font size="1" color="blue" face="sans-serif"><u>swift-corelibs-dev@swift.org</u></font></a><font size="1" face="sans-serif">&gt;</font><font size="3">
</font><font size="1" color="#5f5f5f" face="sans-serif"><br>
Date:        </font><font size="1" face="sans-serif">30/05/2016
08:08</font><font size="3"> </font><font size="1" color="#5f5f5f" face="sans-serif"><br>
Subject:        </font><font size="1" face="sans-serif">Re:
[swift-corelibs-dev] libdispatch on Linux, or C++ std::async?</font><font size="3">
</font><font size="1" color="#5f5f5f" face="sans-serif"><br>
Sent by:        </font><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-corelibs-dev-bounces@swift.org&#39;);" target="_blank"><font size="1" color="blue" face="sans-serif"><u>swift-corelibs-dev-bounces@swift.org</u></font></a><font size="3">
<br>
</font>
<hr noshade>
<br><font size="3"><br>
<br>
<br>
Hi, <br>
<br>
For what it&#39;s worth, I can&#39;t get the master branch to build either, but
I can get the experimental/foundation branch to build. <br>
<br>
Regards, <br>
<br>
Rob.... <br>
<br>
<br>
On 30 May 2016, at 05:28, Brian Gesiak via swift-corelibs-dev &lt;</font><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-corelibs-dev@swift.org&#39;);" target="_blank"><font size="3" color="blue"><u>swift-corelibs-dev@swift.org</u></font></a><font size="3">&gt;
wrote: <br>
<br>
Hello all! <br>
<br>
I&#39;m working on </font><a href="https://bugs.swift.org/browse/SR-710" target="_blank"><font size="3" color="blue"><u>https://bugs.swift.org/browse/SR-710</u></font></a><font size="3">,
which involves porting SourceKit to Linux. SourceKit contains a handful
of references to libdispatch symbols.<br>
<br>
I have two questions:<br>
<br>
1. Could someone share a set of instructions to build swift-corelibs-libdispatch
on Linux? I&#39;m using Ubuntu 15.10 and have installed [the dependencies listed
here](</font><a href="https://lists.swift.org/pipermail/swift-corelibs-dev/Week-of-Mon-20151207/000122.html" target="_blank"><font size="3" color="blue"><u>https://lists.swift.org/pipermail/swift-corelibs-dev/Week-of-Mon-20151207/000122.html</u></font></a><font size="3">).
I have tried using both `swift/utils/build-script --libdispatch` as well
as the instructions in the swift-corelibs-libdispatch `INSTALL` file. Both
fail with the [same errors](</font><a href="https://gist.github.com/modocache/8389d5d64e39ca5a4281500f84e9ce11" target="_blank"><font size="3" color="blue"><u>https://gist.github.com/modocache/8389d5d64e39ca5a4281500f84e9ce11</u></font></a><font size="3">).
Any tips? <br>
<br>
2. I don&#39;t know much about C++, but from what I understand the C++ stdlib
provides tools for asynchronous programming. I list SourceKit&#39;s uses of
libdispatch in a comment on </font><a href="https://bugs.swift.org/browse/SR-1639" target="_blank"><font size="3" color="blue"><u>https://bugs.swift.org/browse/SR-1639</u></font></a><font size="3">.
For those familiar with both C++ and libdispatch: do you think it&#39;s a good
idea to migrate to C++, at least for now? <br>
<br>
Any advice would be appreciated. Thanks!! <br>
<br>
- Brian Gesiak <br>
<br>
<br>
-- <br>
Development thoughts at </font><a href="http://akrabat.com/" target="_blank"><font size="3" color="blue"><u>http://akrabat.com</u></font></a><font size="3"><br>
Daily Jotter for Mac OS X at </font><a href="http://dailyjotter.com/" target="_blank"><font size="3" color="blue"><u>http://dailyjotter.com</u></font></a><font size="3">
</font>
<br><tt><font size="2">_______________________________________________<br>
swift-corelibs-dev mailing list</font></tt><tt><font size="2" color="blue"><u><br>
</u></font></tt><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;swift-corelibs-dev@swift.org&#39;);" target="_blank"><tt><font size="2" color="blue"><u>swift-corelibs-dev@swift.org</u></font></tt></a><font size="3" color="blue"><u><br>
</u></font><a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" target="_blank"><tt><font size="2" color="blue"><u>https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</u></font></tt></a><font size="3"><br>
<br>
</font>
<br>
<br>
<br></div></div></blockquote></div><br></div>
</blockquote></div>