SourceKitten icon indicating copy to clipboard operation
SourceKitten copied to clipboard

Troubleshooting SourceKitten on Linux

Open mikolasstuchlik opened this issue 4 years ago • 2 comments

Hello,

I am having hard time troubleshooting SourceKitten module-info command on Linux.

I would like to read module info of a C (system library) module, Swift module and Foundation module on both macOS and Linux. I have no issues on macOS. It also works on one Ubuntu 21.04 machine but I don't know why. I was unable to get it working on any other Ubuntu 21.04 machine. (Commands I use are listed here: https://github.com/rhx/gir2swift/issues/21#issuecomment-916032763 )

YAML machine produced by SourceKitten was the same on both working and not-working Ubuntu machines. The error from SourceKit has kind sourcekitd_error_t.SOURCEKITD_ERROR_REQUEST_FAILED but carries no message.

At this point I need an advice on how to troubleshoot the sourcekitd. Is there a possibility to get some log? Should I try to build and run the sourcekitd in a debugger?

mikolasstuchlik avatar Sep 18 '21 12:09 mikolasstuchlik

I have successfuly resolved the issue. The underlying question (how to troubleshoot) remains imho open.


I have been playing with the SourceKit before and I have left a symbolic link to the .so in /usr/lib. SourceKitten attempted to load the library using the symbolic link first and was successful. Therefore it didn't even try to load the path in the LINUX_SOURCEKIT_LIB_PATH variable. However library loaded using the symbolic link was causing the issue (I don't know why, I would guess it requires some other things in the toolchain).

mikolasstuchlik avatar Sep 21 '21 16:09 mikolasstuchlik

You can set a SOURCEKIT_LOGGING=3 environment variable to get more logging from SourceKit itself.

jpsim avatar Oct 05 '21 20:10 jpsim