VSCode extension binary fails with symbol lookup error

My home-manager config includes

vscode = {
      enable = true;
      package = pkgs.vscode-fhsWithPackages (ps: with pkgs; [ rustup zlib fuse fontconfig lldb xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libxcb glibc ]);
      #package = pkgs.vscodium;    # You can skip this if you want to use the unfree version
      extensions = with pkgs.vscode-extensions; [
        vscodevim.vim
        yzhang.markdown-all-in-one
        svelte.svelte-vscode
        eamodio.gitlens
        ms-vscode.cpptools
      ];
    };

It fixes some VSCode extensions, but breaks a Nix Language Server, which fails with the following error:

rnix-lsp: symbol lookup error: /usr/lib/libc.so.6: undefined symbol: _dl_catch_error_ptr, version GLIBC_PRIVATE

My internet searches failed to find anything remotely useful. How would I go about fixing this?

I’m not sure where pkgs is coming from. but you probably want ps: with pkgs; to be ps: with ps;, so that you’re inheriting the same package as vscode.

pkgs is declared at the beginning of the file:

{ pkgs, lib, ... }:
...

Replacing ps: with pkgs to ps: with ps didn’t change anything, so I’m pretty sure they reference the same thing.

Looks like that symbol is provided by the elf interpreter. Which should never error unless you’re downloading binaries off the internet. Can you do ldd on the rnix-lsp executable?

It turns out rnix-lsp is a nix-provided executable that works in a normal shell, but not in a FHS environment. However, adding it to the said environment fixed the issue.