Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubleshooting SourceKitten on Linux #708

Open
mikolasstuchlik opened this issue Sep 18, 2021 · 2 comments
Open

Troubleshooting SourceKitten on Linux #708

mikolasstuchlik opened this issue Sep 18, 2021 · 2 comments

Comments

@mikolasstuchlik
Copy link

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: rhx/gir2swift#21 (comment) )

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 mikolasstuchlik changed the title Troubleshooting SourceKitten on Linu Troubleshooting SourceKitten on Linux Sep 18, 2021
@mikolasstuchlik
Copy link
Author

mikolasstuchlik commented Sep 21, 2021

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).

@jpsim
Copy link
Owner

jpsim commented Oct 5, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants