Skip to content

SourceKit-LSP fails loading the standard library while using Build Server Protocol #2328

@martinez-karina

Description

@martinez-karina

Swift version

swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1) Target: arm64-apple-macosx15.0

Platform

macOS 15.7.1

Editor

Cursor with Swift Extension (1.11.4)

Description

I am using sourcekit-bazel-bsp, the Bazel BSP implementation for SourceKit-LSP. The BSP ←→ LSP integration has been working well with Xcode 16.3 however, after upgrading our Xcode version to Xcode 26.0.1, I am seeing the following error on all Swift files in my project:

Internal SourceKit error: error response (Request Failed): Loading the standard library failed

This is my .sourcekit-lsp/config.json

{
  "backgroundIndexing": true,
  "backgroundPreparationMode": "build",
  "defaultWorkspaceType": "buildServer",
}

And the output of the Swift Output path:

10:27:43: Activating Swift for Visual Studio Code...
10:27:43: Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
Platform: darwin
Swift Path: /Applications/Xcode26.0_17A400.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Toolchain Path: /Applications/Xcode26.0_17A400.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr
Runtime Library Path: /Applications/Xcode26.0_17A400.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx:/usr/lib/swift
Default Target: arm64-apple-macosx15.0
Default SDK: /Applications/Xcode26.0_17A400.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.0.sdk
XCTest Path: /Applications/Xcode26.0_17A400.app/Contents/Developer/usr/bin
10:27:43: SourceKit-LSP setup
10:27:43: focus: undefined

For my project, I am specifically building and indexing against the iOS simulator sdk using the -target arm64-apple-ios14.0-simulator -sdk /Applications/Xcode26.0_17A400.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.0.sdk flags.

So far I have tried the following but no luck:

  • Deleted all Xcodes + caches
  • Re-installed only Xcode 26.0.1
  • Tried setting Swift: SDK workspace setting

The LSP/BSP integration works well with Xcode 16.3 still. I’d appreciate any guidance on how to resolve these Loading the standard library failed errors. Thanks in advance!

Steps to Reproduce

At the moment, it is not reproducible with our Example project for SourceKit-Bazel-BSP. It is happening on our company's codebase.

Logging

Attaching the diagnose bundle. For security I did not enable private/sensitive/extended logging. Let me know if this is of any use!

sourcekit-lsp-diagnose-2025-10-22T11-28-32-07-00.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions