Repository: neovim
Issue:  nix shell neovim-developer fails with memory leak
Labels: bug,platform:nix

### Problem

```console
❯ nix shell ./contrib\#neovim-developer
error: builder for '/nix/store/bb9fjc6mc4cxs2lrp38rkgzg604z8fxf-neovim-unwrapped-9a2c980.drv' failed with exit code 2;
       last 10 log lines:
       >
       > Direct leak of 23 byte(s) in 1 object(s) allocated from:
       >     #0 0x555555afba5f  (/build/z66zzwbim1jnh59ski03bnma1g30y7z8-source/build/bin/nvim+0x5a7a5f) (BuildId: 0897c013cbcf7f8a3d74f7b5c8f9c6920a965343)
       >     #1 0x7ffff7d797ca  (/nix/store/p4x3hr44ah240zascb7ygk4m5b6sbrnx-libuv-1.47.0/lib/libuv.so.1+0xd7ca) (BuildId: 775784dd15803baec31a5a676687ce49177f0fb9)
       >
       > SUMMARY: AddressSanitizer: 23 byte(s) leaked in 1 allocation(s).
       > make[2]: *** [runtime/CMakeFiles/runtime.dir/build.make:77: runtime/doc/tags] Error 1
       > make[2]: *** Deleting file 'runtime/doc/tags'
       > make[1]: *** [CMakeFiles/Makefile2:2738: runtime/CMakeFiles/runtime.dir/all] Error 2
       > make: *** [Makefile:156: all] Error 2
       For full logs, run 'nix log /nix/store/bb9fjc6mc4cxs2lrp38rkgzg604z8fxf-neovim-unwrapped-9a2c980.drv'.
```

```
❯  nix log /nix/store/cswm5fp1miargsyxba59wp0i3w8y0bzr-neovim-unwrapped-fbe40ca.drv | tail -n 50
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/cswm5fp1miargsyxba59wp0i3w8y0bzr-neovim-unwrapped-fbe40ca.drv^*'
[ 92%] Building C object src/nvim/CMakeFiles/nvim.dir/__/xdiff/xdiffi.c.o
[ 92%] Building C object src/nvim/CMakeFiles/nvim.dir/__/xdiff/xemit.c.o
[ 92%] Building C object src/nvim/CMakeFiles/nvim.dir/__/xdiff/xhistogram.c.o
[ 92%] Building C object src/nvim/CMakeFiles/nvim.dir/__/xdiff/xpatience.c.o
[ 92%] Building C object src/nvim/CMakeFiles/nvim.dir/__/xdiff/xprepare.c.o
[ 92%] Building C object src/nvim/CMakeFiles/nvim.dir/__/xdiff/xutils.c.o
[ 92%] Linking C executable ../../bin/nvim
clang: warning: argument unused during compilation: '-Wa,--compress-debug-sections' [-Wunused-command-line-argument]
[ 92%] Built target nvim
[ 92%] Generating pack/dist/opt/matchit/doc/tags
[ 92%] Generating doc/tags
[ 92%] Generating syntax/vim/generated.vim
[ 92%] Generating nvim.pot

=================================================================
==3678==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 23 byte(s) in 1 object(s) allocated from:
    #0 0x555555afba5f  (/build/3c6bbg8snfy5frn4wizsmlvh42xy0if9-source/build/bin/nvim+0x5a7a5f) (BuildId: 35c252deba4e852f1be7e8b8840b181dad767784)
    #1 0x7ffff7d797ca  (/nix/store/p4x3hr44ah240zascb7ygk4m5b6sbrnx-libuv-1.47.0/lib/libuv.so.1+0xd7ca) (BuildId: 775784dd15803baec31a5a676687ce49177f0fb9)

SUMMARY: AddressSanitizer: 23 byte(s) leaked in 1 allocation(s).
make[2]: *** [runtime/CMakeFiles/runtime.dir/build.make:82: runtime/pack/dist/opt/matchit/doc/tags] Error 1
make[2]: *** Deleting file 'runtime/pack/dist/opt/matchit/doc/tags'
make[2]: *** Waiting for unfinished jobs....
"optwin.js" "optwin.js" [New] 1294L, 57289B written
=================================================================
==3676==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 23 byte(s) in 1 object(s) allocated from:
    #0 0x555555afba5f  (/build/3c6bbg8snfy5frn4wizsmlvh42xy0if9-source/build/bin/nvim+0x5a7a5f) (BuildId: 35c252deba4e852f1be7e8b8840b181dad767784)
    #1 0x7ffff7d797ca  (/nix/store/p4x3hr44ah240zascb7ygk4m5b6sbrnx-libuv-1.47.0/lib/libuv.so.1+0xd7ca) (BuildId: 775784dd15803baec31a5a676687ce49177f0fb9)

SUMMARY: AddressSanitizer: 23 byte(s) leaked in 1 allocation(s).
make[2]: *** [src/nvim/po/CMakeFiles/translations.dir/build.make:420: src/nvim/po/nvim.pot] Error 1
make[1]: *** [CMakeFiles/Makefile2:2628: src/nvim/po/CMakeFiles/translations.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

=================================================================
==3683==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 23 byte(s) in 1 object(s) allocated from:
    #0 0x555555afba5f  (/build/3c6bbg8snfy5frn4wizsmlvh42xy0if9-source/build/bin/nvim+0x5a7a5f) (BuildId: 35c252deba4e852f1be7e8b8840b181dad767784)
    #1 0x7ffff7d797ca  (/nix/store/p4x3hr44ah240zascb7ygk4m5b6sbrnx-libuv-1.47.0/lib/libuv.so.1+0xd7ca) (BuildId: 775784dd15803baec31a5a676687ce49177f0fb9)

SUMMARY: AddressSanitizer: 23 byte(s) leaked in 1 allocation(s).
make[2]: *** [runtime/CMakeFiles/runtime.dir/build.make:77: runtime/doc/tags] Error 1
make[2]: *** Deleting file 'runtime/doc/tags'
make[1]: *** [CMakeFiles/Makefile2:2738: runtime/CMakeFiles/runtime.dir/all] Error 2
make: *** [Makefile:156: all] Error 2



```

### Steps to reproduce

1. git clone neovim master branch ( commit fbe40ca )
2. cd in neovim directory
3. run `nix shell ./contrib\#neovim-developer`

### Expected behavior

To enter the development shell provided by neovim flake

### Neovim version (nvim -v)

-

### Vim (not Nvim) behaves the same?

-

### Operating system/version

 - system: `"x86_64-linux"`  - host os: `Linux 6.1.69, NixOS, 24.05 (Uakari), 24.05.20240102.bd645e8`  - multi-user?: `yes`  - sandbox: `yes`  - version: `nix-env (Nix) 2.18.1`  - channels(root): `"nixos-23.05"`  - nixpkgs: `/nix/store/m707dys0ykz12vnyfljx62dc6lv0hmx7-source`

### Terminal name/version

kitty 0.31.0 created by Kovid Goyal

### $TERM environment variable

xterm-kitty

### Installation

NIX