1

I've been trying to set up Swift development with VS Code, and to do that I've been following this tutorial: Swift Development with Visual Studio Code — On Linux!, however after going through with it I got a problem saying that it can't start SourceKit Language Server. It also said it couldn't start the server using command sourcekit-lsp.

Still not solved, I get the following when executing swift build -Xcxx -I/home/nikko/swift/swift-5.2.4-RELEASE-ubuntu20.04/usr/lib/swift

/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCclibc/process.c:9:12: warning: implicit declaration of function 'posix_spawn_file_actions_addchdir_np' is invalid in C99 [-Wimplicit-function-declaration]
    return posix_spawn_file_actions_addchdir_np(file_actions, path);
           ^
1 warning generated.
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
/home/nikko/Downloads/sourcekit-lsp/.build/checkouts/swift-driver/Sources/SwiftDriver/Utilities/Triple.swift:1637:3: error: unknown attribute '_spi'
  @_spi(Testing) public var isMacCatalyst: Bool {
  ^
[44/52] Compiling SwiftDriver DriverExecutor.swift

(It stops at 44/52 by the way. Each time it doesn't finish)

And the weird thing is, I can't find anything useful about this '_spi' in google (except that it might mean Serial Peripheral Interface).

Nikko
  • 21

1 Answers1

1

After finding and following this guide: https://www.raywenderlich.com/8325890-a-complete-guide-to-swift-development-on-linux

I discovered I had to write rm -rf .build/ when in the project folder, because the sourcekit-lsp fails if this folder exists already.

Not enough, I have problems with unknown attribute '_spi'

Nikko
  • 21