Repository navigation
[audit] treesitter.lua glibc check still blocks the main loop (fixes #237, see closed #297) - #341
Draft
stanfish06 wants to merge 1 commit into
Draft
stanfish06 wants to merge 1 commit into
stanfish06 wants to merge 1 commit into
Conversation
PR #297 swapped vim.fn.system() for vim.system():wait(), which still blocks the main loop synchronously -- it was closed without merging. This converts get_glibc_version()/can_auto_install_parsers() to a real callback-based flow using vim.system()'s async callback, so the check never blocks startup, and caches the result so repeated calls (every :TSSync) don't re-spawn ldd at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LFuDqrXyPqgBPwWcbd6Kr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
get_glibc_version()inlua/config/treesitter.luastill blocks the main loop on every startup and on every:TSSync, viacan_auto_install_parsers()→ts_install()/ts_update().Where
lua/config/treesitter.lua:41-73(new line numbers) —get_glibc_version(),can_auto_install_parsers()ts_install()(module load, line 103/129),build_latest_parsers(), andts_update()(:TSSync)Why it matters
Issue #237 flagged
vim.fn.system("ldd --version 2>&1 | head -n1")as a blocking shell spawn on every startup. PR #297 attempted a fix by swapping it forvim.system({...}):wait(), but:wait()still blocks the calling context synchronously — it doesn't address the actual complaint (startup pays for a subprocess spawn every time, synchronously), which is presumably why it was closed without merging.In addition, the check was re-run from scratch on every
:TSSynceven though the host's glibc version never changes within a session.Fix
get_glibc_version()now takes a callback and usesvim.system()'s async callback form (no:wait()anywhere in the check), so it never blocks the main loop.glibc_version_cache) after the first successful/failed check, so subsequent calls (every:TSSync) don't spawnlddagain at all.can_auto_install_parsers(),ts_install(),build_latest_parsers(), andts_update()are all converted to the matching callback shape. Behavior (notifications, order of operations, the final "restart neovim" message) is preserved exactly, just asynchronously gated.build_latest_parsers()'s own internalmod_async...:wait()(tracked separately by [audit] build_latest_parsers() intends parallel parser builds but :wait() blocks the whole UI serially #325) is untouched — this PR only removes the blocking glibc probe, not the parallel-build serialization.No nerd font / icon strings were touched.
Generated by Claude Code