Skip to content

fix(loader): randomized AppImage path pollutes luac cache #31165#36908

Merged
github-actions[bot] merged 1 commit intorelease-0.11from
backport-35636-to-release-0.11
Dec 10, 2025
Merged

fix(loader): randomized AppImage path pollutes luac cache #31165#36908
github-actions[bot] merged 1 commit intorelease-0.11from
backport-35636-to-release-0.11

Conversation

@neovim-backports
Copy link

Description

Backport of #35636 to release-0.11.

Problem:
When using the Nvim appimage, `~/.cache/nvim/luac` directory can grow to
250,000+ files.

Example of 2 identical files in `./luac/`:

    %2ftmp%2f.mount_nvim.a65Rja0%2fusr%2fshare%2fnvim%2fruntime%2flua%2fvim%2ftreesitter.luac
    %2ftmp%2f.mount_nvim.aNpxXgo%2fusr%2fshare%2fnvim%2fruntime%2flua%2fvim%2ftreesitter.luac

Analysis:
The `nvim.appimage` mounts nvim at a different temporary path each time
it is invoked. The naming scheme of these cache files is random, which
defats the purpose of the cache creates N new files on every launch of
nvim.

Steps to reproduce:
1. install `nvim.appimage`
2. `mv ~/.cache/nvim/luac ~/.cache/nvim/luac.backup`
3. `nvim`
4. Observe contents of `~/.cache/nvim/luac/`
5. Close nvim and run `nvim` again
6. Observe contents of `~/.cache/nvim/luac/` and see that new identical
   files have been added with a different mount prefix

Solution:
When running from an appimage, trim the random part of the filepaths.

(cherry picked from commit 78bbe53)
@github-actions github-actions bot enabled auto-merge (rebase) December 10, 2025 18:33
@github-actions github-actions bot merged commit 91fd4d1 into release-0.11 Dec 10, 2025
31 checks passed
@github-actions github-actions bot deleted the backport-35636-to-release-0.11 branch December 10, 2025 19:01
@alexaandru
Copy link

alexaandru commented Dec 12, 2025

Sorry for the noise, I just realized I commented on the backport instead of the original issue. Moved my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants