<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 created a few pull requests regarding SourceKit support on Linux:<div class=""><br class=""></div><div class=""><a href="https://github.com/apple/swift/pull/5861" class="">https://github.com/apple/swift/pull/5861</a>&nbsp;- Update documentation for building on Linux</div><div class=""><a href="https://github.com/apple/swift/pull/5862" class="">https://github.com/apple/swift/pull/5862</a>&nbsp;- Allow SourceKit to be built without errors on Linux</div><div class=""><a href="https://github.com/apple/swift/pull/5903" class="">https://github.com/apple/swift/pull/5903</a>&nbsp;- Allow SourceKit to be built by default on Linux (contains 5862)</div><div class=""><br class=""></div><div class="">Because SourceKit isn't currently built on Linux as part of the build process, it was missing dependencies on lto and coverage, both of which are needed to build successfully.</div><div class=""><br class=""></div><div class="">SourceKit depends on the native libdispatch implementation, which on Darwin is satisfied by the current platform. On Linux, the approach has been to build a two-pass of swift; first without the SourceKit support, and then with the SourceKit support. The second time around, the SourceKit build can pick up the libdispatch library from the previous build.</div><div class=""><br class=""></div><div class="">The fix I've implemented in pull 5903 is to add a dummy dependency when building SourceKit and on Linux that requires the libdispatch library exists, and if it doesn't, to shell out to make it. It's ugly, but it works, and SourceKit can be built in a single pass (though it still compiles libdispatch twice). This would allow SourceKit to be used on Linux for other tools to take advantage of.</div><div class=""><br class=""></div><div class="">More strategic solutions might look like:</div><div class=""><br class=""></div><div class="">* Refactoring the libdispatch build to use CMake - possibly unlikely, since the libdispatch project has dependencies on libkqueue and libpwq, both of which are external projects that use autoconf.</div><div class="">* Splitting out SourceKit to its own repository/project, and then interleaving the dependencies such that SourceKit could depend on the libdispatch project on Linux and not on Darwin.</div><div class="">* Changing the build script such that the libdispatch native library is built first, prior to the main Swift project, but build the libdispatch Swift code subsequently (potentially in a single repository, but may need two steps)</div><div class=""><br class=""></div><div class="">Since these alternatives require more work, and may not be applicable at the current time, I've taken the approach of creating the simplest thing that works (albeit unashamedly ugly) for pull 5903.</div><div class=""><br class=""></div><div class="">Comments welcome.</div><div class=""><br class=""></div><div class="">Alex</div></body></html>