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.
- Bring up the bridge so sourcekit-lsp completes the BSP handshake with
SWBBuildServer (build/initialize -> build/initialized).
- As soon as the handshake completes, sourcekit-lsp issues
workspace/buildTargets (it does not call workspace/waitForBuildSystemUpdates first on this path).
- Because
initialize() only scheduled build description generation and buildDescriptionID is still nil, the request fails with ResponseError(-32001, "No build description").
- 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.
Description
SWBBuildServer.initialize()kicks off build description generation as fire-and-forget work, then immediately returns theInitializeBuildResponse. Any BSP request that requiresbuildDescriptionIDand arrives after the handshake completes but before generation finishes fails withResponseError(-32001, "No build description")instead of being queued or awaited.Steps to reproduce
We hit this with
sourcekit-xcode-bspwithout pre-warminng the build description. The current workaround requests a build description before starting the actual build server.SWBBuildServer(build/initialize->build/initialized).workspace/buildTargets(it does not callworkspace/waitForBuildSystemUpdatesfirst on this path).initialize()only scheduled build description generation andbuildDescriptionIDis stillnil, the request fails withResponseError(-32001, "No build description").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.