fix: fall back to AppImage when tarball neovim requires newer glibc#18
Open
YASoftwareDev wants to merge 9 commits intomasterfrom
Open
fix: fall back to AppImage when tarball neovim requires newer glibc#18YASoftwareDev wants to merge 9 commits intomasterfrom
YASoftwareDev wants to merge 9 commits intomasterfrom
Conversation
Ubuntu 20.04 ships glibc 2.31; neovim ≥ 0.10 tarballs require ≥ 2.32. The binary installs silently but crashes on first run. Two changes: - _neovim_try_appimage(): downloads the .appimage release asset and extracts it with --appimage-extract (no FUSE required); the resulting squashfs-root/usr/ tree maps cleanly onto both /usr/local and ~/.local. Falls through to apt if the AppImage asset is absent or extraction fails. - install_neovim(): after copying the tarball, verifies the binary actually executes before declaring success; if it does not, calls the AppImage fallback. Also tightens the idempotency skip guard so a version-matching but glibc-broken binary is not silently skipped on subsequent runs.
AppImages use the same binary compiled against the same glibc ABI — they provide no relief for glibc version incompatibility. The fallback was silently installing a broken binary and reporting success. Rework the glibc-incompatibility path: - Test the extracted binary IN tmpdir BEFORE copying to the install prefix, so an incompatible new binary never overwrites a working older install. - On glibc failure, fall directly to apt (the correct fallback), with a clear message including the detected system glibc version. - Improve _neovim_apt nosudo message to explain options when apt is also unavailable (no sudo + old glibc = must upgrade OS or build from source). - Remove _neovim_try_appimage entirely — the appimage asset shares the same binary and offers no improvement over the tarball for this failure mode.
A prior failed install could leave an incompatible binary at $prefix/bin/nvim. Subsequent runs correctly detect and skip the install but leave the crashing binary in place. Remove it during the glibc fallback path so nvim is simply absent rather than crashing on every invocation.
For Ubuntu 20.04 (glibc 2.31) where prebuilt GitHub binaries require glibc >= 2.32 and the PPA has dropped focal support, build from source. scripts/install-neovim-src.sh: - Installs build deps (git, ninja, cmake, gettext, build-essential) - Resolves latest stable tag via GitHub API (or accepts NEOVIM_TAG env) - Shallow-clones the tagged commit; CMake FetchContent handles all C deps - Tests binary before logging success; cleans up build dir on EXIT - Env vars: NEOVIM_TAG (pin version), NEOVIM_PREFIX (install prefix)
modules/neovim.sh:
- Early glibc detection before download: systems with glibc < 2.32 skip
the ~100 MB latest tarball entirely and go straight to the legacy path
- _neovim_legacy_binary(): downloads v0.9.5 (built on Ubuntu 18.04 CI,
glibc 2.17 baseline — runs on glibc 2.31). x86_64 only; ARM64 falls
back to apt. Verifies binary in tmpdir before copying to prefix.
- Idempotent: keeps any existing working compatible binary on re-runs
nvim/.config/nvim/init.lua:
- blink.cmp: cond = nvim-0.10 (uses vim.snippet built-in, added in 0.10)
- LSP capabilities: blink on nvim≥0.10, protocol default on older
- vim.diagnostic.jump(): guarded; falls back to goto_prev/next on nvim<0.10
- Server registration: vim.lsp.config/enable on nvim≥0.11,
lspconfig.server.setup() on nvim 0.9–0.10 (automatic_enable only in
the 0.11+ path where it is a known option)
- servers{} table is single source of truth for ensure_installed,
enable(), and the lspconfig loop
nvim-lspconfig itself (not just the API) now enforces nvim >= 0.10 at load time. nvim-treesitter-context uses the LspRequest autocmd event added in nvim 0.10. Both crash on nvim 0.9.5 before config() runs, so version guards in config() alone are insufficient — cond is needed.
replace `require('nvim-treesitter.install').ensure_installed` (does not
exist in the post-2024 refactored API) with the correct
`require('nvim-treesitter').install({...})` call which triggers async
parser download on first launch.
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.
Summary
GLIBC_2.32/2.33/2.34 not found_neovim_try_appimage()which downloads the.appimagerelease asset and extracts it with--appimage-extract(no FUSE required);squashfs-root/usr/maps cleanly onto both/usr/localand~/.localinstall_neovimnow verifies the binary executes before declaring success; if not, calls the AppImage fallback → apt as last resortTest plan
install.sh workstation— should install via AppImage,nvim --versionworksinstall.sh workstation— tarball path unchanged, no regression🤖 Generated with Claude Code