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 <<a href="mailto:swift-corelibs-dev@swift.org">swift-corelibs-dev@swift.org</a>>:<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'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'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'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"><<a href="javascript:_e(%7B%7D,'cvml','BAILEYC@uk.ibm.com');" target="_blank">BAILEYC@uk.ibm.com</a>></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 'pthread_workqueue_signal_np()'
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'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 <<a href="javascript:_e(%7B%7D,'cvml','modocache@gmail.com');" target="_blank">modocache@gmail.com</a>></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 <<a href="javascript:_e(%7B%7D,'cvml','rob@akrabat.com');" target="_blank">rob@akrabat.com</a>>,
Swift Core Libs <<a href="javascript:_e(%7B%7D,'cvml','swift-corelibs-dev@swift.org');" target="_blank">swift-corelibs-dev@swift.org</a>></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'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'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'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 <</font><a href="javascript:_e(%7B%7D,'cvml','BAILEYC@uk.ibm.com');" target="_blank"><font size="3" color="blue"><u>BAILEYC@uk.ibm.com</u></font></a><font size="3">>
wrote:</font>
<br><font size="2" face="sans-serif">I'd certainly recommend picking up the
experimental/foundation branch as Rob recommends. Its where we'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'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'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 'make distclean' from your libdispatch
source directory.</font><font size="3"> <br>
</font><font size="2" face="sans-serif"><br>
FYI, we'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'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 <</font><a href="javascript:_e(%7B%7D,'cvml','swift-corelibs-dev@swift.org');" 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">></font><font size="3">
</font><font size="1" color="#5f5f5f" face="sans-serif"><br>
To: </font><font size="1" face="sans-serif">Brian
Gesiak <</font><a href="javascript:_e(%7B%7D,'cvml','modocache@gmail.com');" target="_blank"><font size="1" color="blue" face="sans-serif"><u>modocache@gmail.com</u></font></a><font size="1" face="sans-serif">></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 <</font><a href="javascript:_e(%7B%7D,'cvml','swift-corelibs-dev@swift.org');" 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">></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,'cvml','swift-corelibs-dev-bounces@swift.org');" 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's worth, I can'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 <</font><a href="javascript:_e(%7B%7D,'cvml','swift-corelibs-dev@swift.org');" target="_blank"><font size="3" color="blue"><u>swift-corelibs-dev@swift.org</u></font></a><font size="3">>
wrote: <br>
<br>
Hello all! <br>
<br>
I'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'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't know much about C++, but from what I understand the C++ stdlib
provides tools for asynchronous programming. I list SourceKit'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'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,'cvml','swift-corelibs-dev@swift.org');" 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>