diff options
| author | Adrian Wang <86359799+0xDamn@users.noreply.github.com> | 2026-03-23 17:32:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-23 10:32:51 +0100 |
| commit | 6620ae1c44dfa8623b22d0cbf873a9e8d073b849 (patch) | |
| tree | 4e6fa421158fa0eb2aeafa351f663e1bf4b14fa0 /lua | |
| parent | fix(parsers): track default branch for perl, pod (#8605) (diff) | |
| download | nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.tar nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.tar.gz nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.tar.bz2 nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.tar.lz nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.tar.xz nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.tar.zst nvim-treesitter-6620ae1c44dfa8623b22d0cbf873a9e8d073b849.zip | |
fix(install): use rename-before-unlink on all platforms
Problem: On macOS Apple Silicon, a plain unlink can leave stale code
signature metadata in the kernel cache, causing SIGKILL on next page
fault after `TSUpdate`.
Solution: Apply the rename-then-unlink strategy unconditionally instead
of only on Windows.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index 2c564b9ab..893f95361 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -322,13 +322,9 @@ end local function do_install(logger, compile_location, target_location) logger:info(string.format('Installing parser')) - if uv.os_uname().sysname == 'Windows_NT' then -- why can't you just be normal?! - local tempfile = target_location .. tostring(uv.hrtime()) - uv_rename(target_location, tempfile) -- parser may be in use: rename... - uv_unlink(tempfile) -- ...and mark for garbage collection - else - uv_unlink(target_location) -- don't disturb existing memory-mapped content - end + local tempfile = target_location .. tostring(uv.hrtime()) + uv_rename(target_location, tempfile) -- parser may be in use: rename... + uv_unlink(tempfile) -- ...and mark for garbage collection local err = uv_copyfile(compile_location, target_location) a.schedule() |
