nix-community / nixos-vscode-server

Visual Studio Code Server support in NixOS
MIT License
383 stars 74 forks source link

node: libstdc++.so.6 => not found despite patching #84

Open steveej opened 1 month ago

steveej commented 1 month ago

according to the user journal the patching of the binary gets executed:

auto-fix-vscode-server[1893066]: VS Code server is being installed in /home/dev/.vscodium-server/bin/0d01a72525276e5e3771fe5851b9c83de0de1e2b...
auto-fix-vscode-server[1893066]: Patching Node.js of VS Code server installation in /home/dev/.vscodium-server/bin/0d01a72525276e5e3771fe5851b9c83de0de1e2b...

however, vscodium cannot to the remote successfully.

upon checking, the node binary is still missing a library:

[dev@x64-linux-dev-01:~]$ ldd /home/dev/.vscodium-server/bin/0d01a72525276e5e3771fe5851b9c83de0de1e2b/node
    linux-vdso.so.1 (0x00007ffc90182000)
    libdl.so.2 => /nix/store/1zy01hjzwvvia6h9dq5xar88v77fgh9x-glibc-2.38-44/lib/libdl.so.2 (0x00007fca9d795000)
    libstdc++.so.6 => not found
    libm.so.6 => /nix/store/1zy01hjzwvvia6h9dq5xar88v77fgh9x-glibc-2.38-44/lib/libm.so.6 (0x00007fca9d6b5000)
    libgcc_s.so.1 => /nix/store/j6n6ky7pidajcc3aaisd5qpni1w1rmya-xgcc-12.3.0-libgcc/lib/libgcc_s.so.1 (0x00007fca9d694000)
    libpthread.so.0 => /nix/store/1zy01hjzwvvia6h9dq5xar88v77fgh9x-glibc-2.38-44/lib/libpthread.so.0 (0x00007fca9d68f000)
    libc.so.6 => /nix/store/1zy01hjzwvvia6h9dq5xar88v77fgh9x-glibc-2.38-44/lib/libc.so.6 (0x00007fca9d4a4000)
    /lib64/ld-linux-x86-64.so.2 => /nix/store/1zy01hjzwvvia6h9dq5xar88v77fgh9x-glibc-2.38-44/lib64/ld-linux-x86-64.so.2 (0x00007fca9d79c000)

i used the following config snippet for the remote machine. i tried omitting the nodejsPackage which hasn't made a difference.

      services.vscode-server = {
        enable = true;
        installPath = "$HOME/.vscodium-server";
        nodejsPackage = pkgs.nodejs-18_x;
      };
steveej commented 1 month ago

this issue occurred because my local vscodium had a setting for for a custom binary name:

"remote.SSH.experimental.serverBinaryName": "openvscode-server"

this it can be worked around by creating a symlink on the remote server.


[dev@x64-linux-dev-01:~/.vscodium-server/bin/0d01a72525276e5e3771fe5851b9c83de0de1e2b/bin]$ ln -s /home/dev/.vscodium-server/bin/0d01a72525276e5e3771fe5851b9c83de0de1e2b/bin/{codium,openvscode}-server

this isn't very convenient as it requires manual intervention on each update. i wonder whether it's worth adding an option for alternative binary names to this module.