Building Sourcekit-LSP on a Raspberry Pi

Dear Swift Community,

I'm trying to build Sourcekit-LSP on a Raspberry Pi 3 (Model B V1.2).

I'm using Swift 5.1.5, which was installed from https://github.com/uraimo/buildSwiftOnARM.

I'm having trouble resolving the following errors.

What I Did

First I cloned the Sourcekit-LSP repository using git clone git@github.com:apple/sourcekit-lsp.git && cd sourcekit-lsp, then resolved/updated the packages using swift package resolve, then, after reading the sourcekit-lsp instructions, ran swift build -Xcxx -I/home/lebje/swift/usr/lib/swift -Xcxx -I/home/lebje/swift/usr/lib/swift/Block -j 1 # -j 1 reduces the CPU and memory load on my Raspberry Pi.

What Happened

Build Log

path-to-sourcekit-lsp $ swift build -Xcxx -I/home/lebje/swift/usr/lib/swift -Xcxx -I/home/lebje/swift/usr/lib/swift/Block -j 1 # -j 1 reduces the CPU and memory load on my Raspberry Pi

[1/213] Merging module LSPLogging
[2/214] Merging module LanguageServerProtocol
[3/215] Merging module ISDBTibs
[4/216] Merging module LanguageServerProtocolJSONRPC
[5/217] Merging module LSPTestSupport
[6/218] Merging module tibs
[7/219] Merging module BuildServerProtocol
[8/219] Wrapping AST for tibs for debugging
[9/219] Compiling llvmSupport raw_ostream.cpp
...
[57/219] Compiling llvmSupport APFloat.cpp
[58/219] Compiling llvmDemangle MicrosoftDemangle.cpp
[59/219] Compiling llvmDemangle ItaniumDemangle.cpp
[60/219] Compiling llbuildCore SQLiteBuildDB.cpp
[61/219] Compiling llbuildCore MakefileDepsParser.cpp
[62/219] Compiling llbuildCore DependencyInfoParser.cpp
[63/219] Compiling llbuildCore BuildEngineTrace.cpp
[64/219] Compiling llbuildCore BuildEngine.cpp
[65/219] Compiling llbuildCore BuildDB.cpp
[66/219] Compiling llbuildBuildSystem ShellCommand.cpp
[67/219] Compiling llbuildBuildSystem ExternalCommand.cpp
[68/219] Compiling llbuildBuildSystem BuildValue.cpp
[69/219] Compiling llbuildBuildSystem BuildSystemFrontend.cpp
[70/219] Compiling llbuildBuildSystem BuildSystemExtensionManager.cpp
[71/219] Compiling llbuildBuildSystem BuildSystem.cpp
[72/219] Compiling llbuildBuildSystem BuildNode.cpp
[73/219] Compiling llbuildBuildSystem BuildKey.cpp
[74/219] Compiling llbuildBuildSystem BuildFile.cpp
[75/219] Compiling llbuildBuildSystem BuildDescription.cpp
[76/219] Compiling llbuildBasic Version.cpp
[77/219] Compiling llbuildBasic Tracing.cpp
[78/219] Compiling llbuildBasic Subprocess.cpp
[79/219] Compiling llbuildBasic ShellUtility.cpp
[80/219] Compiling llbuildBasic SerialQueue.cpp
[81/219] Compiling llbuildBasic PlatformUtility.cpp
[82/219] Compiling llbuildBasic LaneBasedExecutionQueue.cpp
[83/219] Compiling llbuildBasic Hashing.cpp
[84/219] Compiling llbuildBasic FileSystem.cpp
[85/219] Compiling llbuildBasic FileInfo.cpp
[86/219] Compiling llbuildBasic ExecutionQueue.cpp
[87/219] Compiling libllbuild Core-C-API.cpp
[88/219] Compiling libllbuild C-API.cpp
[89/219] Compiling libllbuild BuildValue-C-API.cpp
[90/219] Compiling libllbuild BuildSystem-C-API.cpp
[91/219] Compiling libllbuild BuildKey-C-API.cpp
[92/219] Compiling libllbuild BuildDB-C-API.cpp
[93/225] Compiling llbuildSwift Internals.swift
[94/225] Compiling llbuildSwift CoreBindings.swift
[95/225] Compiling llbuildSwift BuildDBBindings.swift
[96/225] Compiling llbuildSwift BuildKey.swift
[97/225] Compiling llbuildSwift BuildSystemBindings.swift
[98/225] Compiling llbuildSwift BuildValue.swift
[99/226] Merging module llbuildSwift
[100/226] Compiling TSCclibc process.c
[101/226] Wrapping AST for llbuildSwift for debugging
[102/226] Compiling TSCclibc libc.c
[103/227] Compiling TSCLibc libc.swift
[104/228] Merging module TSCLibc
[105/271] Compiling TSCBasic RegEx.swift
...
[147/271] Compiling TSCBasic LazyCache.swift
[148/272] Merging module TSCBasic
[149/272] Wrapping AST for TSCLibc for debugging
[150/299] Compiling TSCUtility FSWatch.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[151/299] Compiling TSCUtility FloatingPointExtensions.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[152/299] Compiling TSCUtility Git.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[153/299] Compiling TSCUtility IndexStore.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[154/299] Compiling TSCUtility InterruptHandler.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[155/299] Compiling TSCUtility JSONMessageStreamingParser.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[156/299] Compiling TSCUtility OSLog.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[157/299] Compiling TSCUtility URL.swift
...
[176/299] Compiling TSCUtility Downloader.swift

Build Error

/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[151/299] Compiling TSCUtility FloatingPointExtensions.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[152/299] Compiling TSCUtility Git.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[153/299] Compiling TSCUtility IndexStore.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[154/299] Compiling TSCUtility InterruptHandler.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[155/299] Compiling TSCUtility JSONMessageStreamingParser.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[156/299] Compiling TSCUtility OSLog.swift
/home/lebje/sourcekit-lsp/.build/checkouts/swift-tools-support-core/Sources/TSCUtility/FSWatch.swift:434:19: error: cannot assign value of type '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)' to type '(__fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask, __fd_mask)' (aka '(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int)')
        set.__fds_bits = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Jeff

Looks like __fds_bits has twice as many entries on this platform compared to the other Linux code.

CC @hartbit @benjamin_herzog

I'm not sure what the right way to conditionalize a fix here is - I wonder if this code should just be written in C so that it can use the portable macros.

Try applying the fix from that repo to that file.

That is really unfortunate. I didn’t write this code, only copied it from SwiftPM. It seems that @Aciid already commented with a radar that Swift should provide shims for FD_ macros. This seems to be the right thing to do here but as long as we don’t have that, we should fix it in TSC. Feel free to open a PR with the proposed fix.

@blangmuir: Thank you, but I don't think the code will need to be rewritten in C because the solution provided by @Finagolfin has removed the errors that I was encountering. There is only one error left now (see "Current Error" below).

@Finagolfin: Thank you for your solution. It has removed the errors I was previously experiencing. There is only one error left now (see "Current Error" below).

@benjamin_herzog: If I'm able to successfully build Sourcekit-LSP, I'll see if I can create a pull request.

Current Error

I'm having trouble resolving the following error:

path-to-sourcekit-lsp $ swift build -Xcxx -I/home/lebje/swift/usr/lib/swift -Xcxx -I/home/lebje/swift/usr/lib/swift/Block -j 1

/home/lebje/sourcekit-lsp/Sources/SourceKitD/SourceKitDImpl.swift:74:81: error: type of expression is ambiguous without more context
      let handlers = self.lock.withLock { self._notificationHandlers.compactMap(\.value) }
                                                                                ^~~~~~~
/home/lebje/sourcekit-lsp/Sources/SourceKitD/SourceKitDImpl.swift:74:81: error: type of expression is ambiguous without more context
      let handlers = self.lock.withLock { self._notificationHandlers.compactMap(\.value) }
                                                                                ^~~~~~~
[484/502] Compiling writer.c


I think this use of keypath is a Swift 5.2 feature. { $0.value } should work instead.

Note that mixing Swift 5.1 with sourcekit-lsp built from master branch is not guaranteed to work (I think it does currently, but not 100% sure). If you run into any issues with compatibility between swiftpm in your toolchain and libswiftpm in sourcekit-lsp you might want to use our swift-5.1 branch of sourcekit-lsp.

@blangmuir: Thank you for the solution. I'm able to successfully build Sourcekit-LSP.