<div dir="ltr">When I was working this summer on getting SourceKit to build on Linux, one challenge I encountered with getting the build to work cleanly was that SourceKit is in the Swift repo, but it has a dependency on libdispatch. Moving the dispatch overlay code such that libdispatch could always be built before Swift would solve that problem nicely as well.</div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-25 12:26 GMT-07:00 Michael Gottesman via swift-dev <span dir="ltr"><<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Sep 25, 2016, at 11:38 AM, David P Grove via swift-dev <<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>> wrote:</div><br><div><div><p>The order may need to vary by platform. On Linux, the DIspatch Swift overlay code lives in swift-corelibs-libdispatch/<wbr>src/swift. So it works to build (1) Swift (2) libdispatch (both C and Swift) (3) Foundation. <br></p></div></div></blockquote></span><div>Question. Maybe the right thing to do is move the overlay even on OS X into swift. (Just trying to ask obvious questions).</div><blockquote type="cite"><div><div><p><br>--dave<br><br><span><graycol.gif></span><font color="#424282">Jordan Rose ---09/23/2016 06:34:46 PM---I think the right order to build things is: 1. libdispatch (C)</font></p><div><div class="h5"><br><br><font size="2" color="#5F5F5F">From: </font><font size="2">Jordan Rose <<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></font><br><font size="2" color="#5F5F5F">To: </font><font size="2">David P Grove/Watson/IBM@IBMUS</font><br><font size="2" color="#5F5F5F">Cc: </font><font size="2">"Daniel A. Steffen" <<a href="mailto:dsteffen@apple.com" target="_blank">dsteffen@apple.com</a>>, swift-dev <<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>>, swift-corelibs-dev <<a href="mailto:swift-corelibs-dev@swift.org" target="_blank">swift-corelibs-dev@swift.org</a>></font><br><font size="2" color="#5F5F5F">Date: </font><font size="2">09/23/2016 06:34 PM</font><br><font size="2" color="#5F5F5F">Subject: </font><font size="2">Re: [swift-dev] Swift CI PR builder dispatch linux failure</font><br><font size="2" color="#5F5F5F">Sent by: </font><font size="2"><a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a></font><br></div></div><p></p><div><div class="h5"><hr width="100%" size="2" align="left" noshade style="color:#8091a5"><br><br><br><font size="4">I think the right order to build things is:</font><br><br><font size="4">1. libdispatch (C)</font><br><font size="4">2. Swift (compiler + stdlib + Dispatch overlay)</font><br><font size="4">3. Foundation</font><br><br><font size="4">Otherwise we need to build Swift, then build libdispatch, then go back to "Swift" to build the overlay, and only finally get to Foundation.</font><br><br><font size="4">Jordan</font><br><br>
<ul><ul><font size="4">On Sep 23, 2016, at 14:32, David P Grove via swift-dev <</font><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="4" color="#0000FF">swift-dev@swift.org</font></u></a><font size="4">> wrote:</font><br><p><font size="4">I'm playing with something. Should have a PR ready shortly.<br><br>--dave<br><br><br><graycol.gif></font><font size="4" color="#424282">"Daniel A. Steffen via swift-dev" ---09/23/2016 04:45:06 PM---I don’t know how these dependencies are expressed in CMake but it doesn’t seem very difficult to do</font><font size="4"><br></font><font color="#5F5F5F"><br>From: </font>"Daniel A. Steffen via swift-dev" <<a href="mailto:swift-dev@swift.org" target="_blank"><u><font color="#0000FF">swift-dev@swift.org</font></u></a>><font color="#5F5F5F"><br>To: </font>Ted Kremenek <<a href="mailto:kremenek@apple.com" target="_blank"><u><font color="#0000FF">kremenek@apple.com</font></u></a>><font color="#5F5F5F"><br>Cc: </font>swift-dev <<a href="mailto:swift-dev@swift.org" target="_blank"><u><font color="#0000FF">swift-dev@swift.org</font></u></a>><font color="#5F5F5F"><br>Date: </font>09/23/2016 04:45 PM<font color="#5F5F5F"><br>Subject: </font>Re: [swift-dev] Swift CI PR builder dispatch linux failure<font color="#5F5F5F"><br>Sent by: </font><a href="mailto:swift-dev-bounces@swift.org" target="_blank"><u><font color="#0000FF">swift-dev-bounces@swift.org</font></u></a></p><div><br></div><hr width="100%" size="2" align="left" noshade><font size="4"><br><br></font><font size="5"><br>I don’t know how these dependencies are expressed in CMake but it doesn’t seem very difficult to do so in the autotools buildsystem, we have</font><font size="4"><br></font><font size="5"><br>AC_ARG_WITH([swift-toolchain],<br>[AS_HELP_STRING([--with-swift-<wbr>toolchain], [Specify path to Swift toolchain])],<br>[swift_toolchain_path=${<wbr>withval}<br>AC_DEFINE(HAVE_SWIFT, 1, [Define if building for Swift])<br>SWIFTC="$swift_toolchain_path/<wbr>bin/swiftc”</font><font size="4"><br></font><font size="5"><br>in <a href="http://configure.ac" target="_blank">configure.ac</a> which ends up as a SWIFTC makefile variable, so as long as that argument is passed as an absolute path, it should work as a dependency in the build rules</font><font size="4"><br></font><font size="5"><br>$(abs_builddir)/swift/%.o: $(abs_srcdir)/swift/%.swift<br>$(SWIFTC) -frontend -c $(SWIFT_ABS_SRC_FILES) -primary-file $< \</font><font size="4"><br></font><font size="5"><br>Is there a JIRA ticket for this ? the IBM folks should probably be the ones making these changes since we still don’t have the whitelist in place for Apple contributors to do so…</font><font size="4"><br></font><font size="5"><br>Daniel</font><font size="4"><br></font><ul><ul><ul><ul><font size="5">On Sep 23, 2016, at 13:00, Ted Kremenek <</font><a href="mailto:kremenek@apple.com" target="_blank"><u><font size="5" color="#0000FF">kremenek@apple.com</font></u></a><font size="5">> wrote:</font><font size="4"><br></font><font size="5"><br>+ Daniel</font><font size="4"><br></font><b><font size="5"><br>Daniel</font></b><font size="5">: how hard would it be for the Dispatch project to be modified to add the swiftc binary used to build the project as a dependency?</font><ul><ul><ul><ul><font size="5">On Sep 23, 2016, at 12:55 PM, Ted Kremenek via swift-dev <</font><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="5" color="#0000FF">swift-dev@swift.org</font></u></a><font size="5">> wrote:</font><font size="4"><br></font><font size="5"><br>Dispatch is a separate project. There isn’t a dependency in the Dispatch project to tell it is building with a new compiler. The project would need to be modified to add a dependency on the swiftc binary being used to compile this project.</font><ul><ul><ul><ul><font size="5">On Sep 21, 2016, at 9:39 AM, Mishal Shah via swift-dev <</font><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="5" color="#0000FF">swift-dev@swift.org</font></u></a><font size="5">> wrote:</font><font size="4"><br></font><font size="5"><br>We should look into why it's not rebuilding dependencies. Do we need to fix CMake logic? Can you please file a bug?</font><font size="4"><br><br></font><font size="5"><br>Thanks,<br>Mishal Shah<br><br>On Sep 21, 2016, at 9:28 AM, Michael Gottesman <</font><a href="mailto:mgottesman@apple.com" target="_blank"><u><font size="5" color="#0000FF">mgottesman@apple.com</font></u></a><font size="5">> wrote:</font><ul><ul><ul><ul><font size="5">+CC Mishal</font><ul><ul><ul><ul><font size="5">On Sep 21, 2016, at 6:59 AM, David P Grove via swift-dev <</font><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="5" color="#0000FF">swift-dev@swift.org</font></u></a><font size="5">> wrote:</font><p><font face="Helvetica">I don't know how the PR jobs are setup, but the error suggests that they are trying to reuse too much of the workspace of previous runs.</font><font size="6" color="#FFFFFF" face="Helvetica"><br><br><</font><font size="6" face="Helvetica">unknown>:0: error: module file was created by an older version of the compiler; rebuild 'Dispatch' and try again: /home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/build/<wbr>buildbot_linux/libdispatch-<wbr>linux-x86_64/src/swift/<wbr>Dispatch.o.~partial.<wbr>swiftmodule<br><br>--dave</font><font face="Helvetica"><br><br><br><graycol.gif></font><font color="#424282" face="Helvetica">Ankit Aggarwal via swift-dev ---09/21/2016 03:08:58 AM---This has been consistently failing on PRs, can someone look into this: <unknown>:0: error: module fi</font><font size="4" color="#5F5F5F" face="Helvetica"><br><br>From: </font><font size="4" face="Helvetica">Ankit Aggarwal via swift-dev <</font><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="4" color="#0000FF" face="Helvetica">swift-dev@swift.org</font></u></a><font size="4" face="Helvetica">></font><font size="4" color="#5F5F5F" face="Helvetica"><br>To: </font><font size="4" face="Helvetica">swift-dev <</font><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="4" color="#0000FF" face="Helvetica">swift-dev@swift.org</font></u></a><font size="4" face="Helvetica">></font><font size="4" color="#5F5F5F" face="Helvetica"><br>Date: </font><font size="4" face="Helvetica">09/21/2016 03:08 AM</font><font size="4" color="#5F5F5F" face="Helvetica"><br>Subject: </font><font size="4" face="Helvetica">[swift-dev] Swift CI PR builder dispatch linux failure</font><font size="4" color="#5F5F5F" face="Helvetica"><br>Sent by: </font><a href="mailto:swift-dev-bounces@swift.org" target="_blank"><u><font size="4" color="#0000FF" face="Helvetica">swift-dev-bounces@swift.org</font></u></a></p><p><br></p><hr width="100%" size="2" align="left" noshade><font size="5"><br></font><font size="6" face="Helvetica"><br><br>This has been consistently failing on PRs, can someone look into this:</font><tt><font color="#FFFFFF"><br><br><unknown>:0: error: module file was created by an older version of the compiler; rebuild 'Dispatch' and try again: /home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/build/<wbr>buildbot_linux/libdispatch-<wbr>linux-x86_64/src/swift/<wbr>Dispatch.o.~partial.<wbr>swiftmodule</font></tt><tt><font color="#C0C5CE"><br>make[2]: *** [/home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/build/<wbr>buildbot_linux/libdispatch-<wbr>linux-x86_64/src/swift/<wbr>Dispatch.swiftmodule] Error 1<br>make[2]: Leaving directory `/home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/build/<wbr>buildbot_linux/libdispatch-<wbr>linux-x86_64/src'<br>make[1]: *** [all] Error 2<br>make[1]: Leaving directory `/home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/build/<wbr>buildbot_linux/libdispatch-<wbr>linux-x86_64/src'<br>make: *** [all-recursive] Error 1<br>/home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/swift/utils/<wbr>build-script: fatal error: command terminated with a non-zero exit status 2, aborting<br>/home/buildnode/jenkins/<wbr>workspace/swift-package-<wbr>manager-PR-Linux/swift/utils/<wbr>build-script: fatal error: command terminated with a non-zero exit status 1, aborting</font></tt><font size="5"><br></font><u><font color="#0000FF" face="Helvetica"><br></font></u><u><font size="4" color="#0000FF"><br></font></u><a href="https://ci.swift.org/job/swift-package-manager-PR-Linux/497/console" target="_blank"><u><font size="6" color="#0000FF" face="Helvetica">https://ci.swift.org/job/<wbr>swift-package-manager-PR-<wbr>Linux/497/console</font></u></a><font size="4" face="Helvetica"><br><br>- Ankit</font><font size="6" face="Helvetica"> </font><font face="Helvetica"><br>[attachment "signature.asc" deleted by David P Grove/Watson/IBM] </font><tt>______________________________<wbr>_________________<br>swift-dev mailing list</tt><u><font size="4" color="#0000FF"><br></font></u><a href="mailto:swift-dev@swift.org" target="_blank"><tt><u><font color="#0000FF">swift-dev@swift.org</font></u></tt></a><u><font size="4" color="#0000FF"><br></font></u><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank"><tt><u><font color="#0000FF">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</font></u></tt></a><font size="5"><br><br></font><font face="Helvetica"><br><br>______________________________<wbr>_________________<br>swift-dev mailing list</font><u><font size="4" color="#0000FF"><br></font></u><a href="mailto:swift-dev@swift.org" target="_blank"><u><font color="#0000FF" face="Helvetica">swift-dev@swift.org</font></u></a><u><font size="4" color="#0000FF"><br></font></u><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank"><u><font color="#0000FF" face="Helvetica">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</font></u></a></ul></ul></ul></ul></ul></ul></ul></ul><font size="5">______________________________<wbr>_________________<br>swift-dev mailing list</font><u><font size="4" color="#0000FF"><br></font></u><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="5" color="#0000FF">swift-dev@swift.org</font></u></a><u><font size="4" color="#0000FF"><br></font></u><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank"><u><font size="5" color="#0000FF">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</font></u></a></ul></ul></ul></ul><font size="5"><br>______________________________<wbr>_________________<br>swift-dev mailing list</font><u><font size="4" color="#0000FF"><br></font></u><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="5" color="#0000FF">swift-dev@swift.org</font></u></a><u><font size="4" color="#0000FF"><br></font></u><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank"><u><font size="5" color="#0000FF">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</font></u></a></ul></ul></ul></ul></ul></ul></ul></ul><tt><font size="4">______________________________<wbr>_________________<br>swift-dev mailing list</font></tt><tt><u><font size="4" color="#0000FF"><br></font></u></tt><a href="mailto:swift-dev@swift.org" target="_blank"><tt><u><font size="4" color="#0000FF">swift-dev@swift.org</font></u></tt></a><tt><u><font size="4" color="#0000FF"><br></font></u></tt><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank"><tt><u><font size="4" color="#0000FF">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</font></u></tt></a><font size="4"><br><br><br></font><br><font size="4">______________________________<wbr>_________________<br>swift-dev mailing list</font><u><font size="4" color="#0000FF"><br></font></u><a href="mailto:swift-dev@swift.org" target="_blank"><u><font size="4" color="#0000FF">swift-dev@swift.org</font></u></a><font size="4"><br></font><font size="4"><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</a></font></ul></ul><br><br><br>
</div></div></div><div><div class="h5">
______________________________<wbr>_________________<br>swift-dev mailing list<br><a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</a><br></div></div></div></blockquote></div><br></div><br>______________________________<wbr>_________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-dev</a><br>
<br></blockquote></div><br></div>