Skip to content

SWBBuildServer returns -32001 "No build description" for requests in the post-handshake window before async build description generation completes #1509

Description

@shawnshi75

Description

SWBBuildServer.initialize() kicks off build description generation as fire-and-forget work, then immediately returns the InitializeBuildResponse. Any BSP request that requires buildDescriptionID and arrives after the handshake completes but before generation finishes fails with ResponseError(-32001, "No build description") instead of being queued or awaited.

Steps to reproduce

We hit this with sourcekit-xcode-bsp without pre-warminng the build description. The current workaround requests a build description before starting the actual build server.

  1. Bring up the bridge so sourcekit-lsp completes the BSP handshake with SWBBuildServer (build/initialize -> build/initialized).
  2. As soon as the handshake completes, sourcekit-lsp issues workspace/buildTargets (it does not call workspace/waitForBuildSystemUpdates first on this path).
  3. Because initialize() only scheduled build description generation and buildDescriptionID is still nil, the request fails with ResponseError(-32001, "No build description").
  4. No recovery was possible after the initial failure

The race is timing-dependent on how long generation takes, so it reproduces more reliably on larger workspaces (longer generation window).

Expected behavior

A request arriving in the natural post-handshake window should not fail.

Notes

The generation duration depends on workspace size, which widens the window for larger projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions