jpsim/SourceKitten

Linux Support

Closed this issue · 12 comments

What's the current status of Linux support? :)

Latest swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a for Linux does not contain sourcekitd.

jpsim commented

SourceKit is Darwin-only at the moment. The main limitation is the lack of GCD, but now that swift-corelibs-libdispatch is available on Linux in the Swift distribution, it should be possible to use that to build SourceKit for Linux. There's also the libXPC dependency which needs to be abstracted and use something else in Linux for building the dictionaries.

So... those are the next steps that need to be done.

I see, thanks for the heads up! I'm currently looking for an easy way to parse the swiftc AST - is that part of SourceKitten or is that hidden in SourceKit? Asking for a friend: swiftlang/swift-package-manager#156

jpsim commented

You're probably looking for lib/IDE: https://github.com/apple/swift/tree/master/lib/IDE

Ah nice, thanks!
On Mon, Feb 29, 2016 at 1:55 AM JP Simard notifications@github.com wrote:

You're probably looking for lib/IDE:
https://github.com/apple/swift/tree/master/lib/IDE


Reply to this email directly or view it on GitHub
#179 (comment).

Just as an update: SourceKit now builds on Linux swiftlang/swift#3594 (comment)

jpsim commented

lol, thanks for the update

Possible to build Sourcekitten on Linux?

jpsim commented

@ram0811 work on that is in progress. See #223 and #268

jpsim commented

Merged in #268.

Hey @jpsim, first off thanks for all of your work on SourceKitten and Realm, two great frameworks I depend on!

I'm trying to get SourceKitten to run on Ubuntu 14.04 with Swift 3.0.2 and was hoping you could give me some help. I'm very new to all of this, I'm just an iOS developer 😬

I followed the instructions to build swift on https://github.com/apple/swift (I used the swift-3.0.2-RELEASE tag).

It failed during linking, I'm assuming because of memory requirements. But I got it to run successfully on a 16 CPU 64GB VPS.

I followed your instructions to build twice using the following commands:

$ utils/build-script --libdispatch
$ utils/build-script --libdispatch --extra-cmake-options="-DSWIFT_BUILD_SOURCEKIT:BOOL=TRUE"

At this point I was a little lost, I found the executable and I can successfully compile swift files with swiftc, but the swift repl doesn't work and swift-build is missing. Is this expected?

Since I didn't have swift-build, I installed the latest swift release and used it to build SourceKitten, then removed that version of swift.

I found libsourcekitdInProc.so in the build folder and symlinked it to /usr/lib/libsourcekitdInProc.so but running SourceKitten gives me an error that linking to livsourcekitdInProc.so failed :/

How can I figure out what's going wrong? Is there a way for me to check that libsourcekitdInProc.so was built properly? Thanks for the help!

jpsim commented

Could you please file a new issue? I'm guaranteed to forget about this comment because I don't actively revisit closed issues. Thanks!