Skip to content

fix(lsp): add timeout to xcrun in find_sourcekit_lsp#14

Merged
asielcabrera merged 1 commit into
mainfrom
fix-checkhealth-hang-v2
May 11, 2026
Merged

fix(lsp): add timeout to xcrun in find_sourcekit_lsp#14
asielcabrera merged 1 commit into
mainfrom
fix-checkhealth-hang-v2

Conversation

@asielcabrera
Copy link
Copy Markdown
Contributor

Closes #2 — deep audit of all shell calls triggered by :checkhealth swift.\n\nThe xcrun --find sourcekit-lsp call in lsp.find_sourcekit_lsp() had no timeout. On macOS, xcrun can block for 5–10 seconds when the Xcode Developer Directory cache is cold or when Xcode CLT is being initialized for the first time.\n\nThis call is triggered by :checkhealth swiftLSP sectionlsp.is_available()find_sourcekit_lsp().\n\nFull audit of all shell calls in checkhealth:\n| Call chain | Timeout | Safe? |\n|---|---|---|\n| swift --version | 5s ✅ | ✅ |\n| xcrun --find sourcekit-lsp | none → now 3s | ✅ |\n| swift-format --version | 5s ✅ | ✅ |\n| target_manager.get_targets() | removed in #13 ✅ | ✅ |\n| swiftly list | removed in #13 ✅ | ✅ |

xcrun without a timeout can hang checkhealth for 5-10s on macOS when the Xcode Developer Directory cache is cold. Adds a 3s timeout.
@asielcabrera asielcabrera merged commit b0c4d47 into main May 11, 2026
6 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: checkhealth hangs without any output

1 participant