Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode-extensions.ms-vscode-remote.remote-ssh fails on vscode insiders #371686

Open
sliedes opened this issue Jan 7, 2025 · 1 comment
Open
Labels
0.kind: bug Something is broken

Comments

@sliedes
Copy link

sliedes commented Jan 7, 2025

Describe the bug

I have installed vscode-insiders on my NixOS machine using home manager (I do not believe this issue is HM-related; see below):

  programs.vscode = {
    enable = true;
    package = pkgs.vscode-insiders.overrideAttrs (oldAttrs: {
      nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [
        pkgs.makeWrapper
      ];
      # The password store is not detected correctly on non-mainstream desktop environments
      postInstall =
        (oldAttrs.postInstall or "")
        + ''
          wrapProgram $out/bin/code-insiders --add-flags "--password-store=gnome-keystore"
        '';
    });
    mutableExtensionsDir = false;

    extensions =
      [
        pkgs.vscode-extensions.ms-vscode-remote.remote-ssh-edit
        pkgs.vscode-extensions.ms-vscode-remote.remote-ssh
      ]
      ++ (with pkgs.vscode-marketplace; [
          # ... stuff from nix-vscode-extensions flake
      ];
# ...

I am trying to connect from a NixOS machine to a NixOS remote. This fails to work, I believe because of a hard-coded path that is different on insiders:

[05:39:22.576] Creating bash subshell inside "bash"
[05:39:22.639] > bash version:  5.2.37(1)-release
[05:39:22.700] > bash version:  5.2.37(1)-release
[05:39:22.792] > 763198c593ad: running
> Warning: Can't find libstdc++.so or ldconfig, can't verify libstdc++ version
> Acquiring lock on /home/sliedes/.vscode-server-insiders/bin/8cc255e03ac7c51804cea1194b1ea864bbe2ccb6/vscode-remote-lock.sliedes.8cc255e03ac7c51804cea1194b1ea864bbe2ccb6
> Found existing installation at /home/sliedes/.vscode-server-insiders/bin/8cc255e03ac7c51804cea1194b1ea864bbe2ccb6...
> VS Code Node: /home/sliedes/.vscode-server/bin/8cc255e03ac7c51804cea1194b1ea864bbe2ccb6/node
> VS Code Node Version: 
[05:39:22.793] stderr> main: line 510: /home/sliedes/.vscode-server/bin/8cc255e03ac7c51804cea1194b1ea864bbe2ccb6/node: No such file or directory
[05:39:23.150] > /nix/store/9q63d382x7k2h6cc2pfsb39ar3n6f9wg-patchelf-0.15.0
> patchelf 0.15.0
[05:39:23.151] stderr> cp: cannot stat '/home/sliedes/.vscode-server/bin/8cc255e03ac7c51804cea1194b1ea864bbe2ccb6/node': No such file or directory
[05:39:23.362] > /nix/store/yf25jkzfc4cl2hf02cv0vz93yd5z2xq0-binutils-wrapper-2.43.1
[05:39:23.364] > Interpreter from bintools: /nix/store/wn7v2vhyyyi6clcyn0s9ixvl7d4d87ic-glibc-2.40-36/lib/ld-linux-x86-64.so.2
[05:39:23.624] > /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib
[05:39:23.631] > Failed to patch Node binary
[05:39:23.632] stderr> patchelf: getting info about '/home/sliedes/.vscode-server/bin/8cc255e03ac7c51804cea1194b1ea864bbe2ccb6/node': No such file or directory
[05:39:23.635] > VS Code Node Version: 
> Unable to fix Node binary, quitting

Observe that the patch tries to find the node binary in ~/.vscode-server/bin/.../node, but the log says Found existing installation at ~/.vscode-server-insiders/.....

Metadata

Local machine running vscode:

  • system: "x86_64-linux"
  • host os: Linux 6.12.8, NixOS, 25.05 (Warbler), 25.05.20250104.8f3e1f8
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • nixpkgs: /nix/store/khbvilmsrv4l69nwd52h27j1mp44a0xi-source

Remote:

  • system: "x86_64-linux"
  • host os: Linux 6.6.64, NixOS, 25.05 (Warbler), 25.05.20241219.d70bd19
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.24.11
  • channels(root): "nixos"
  • nixpkgs: /nix/store/8fwsiv0hd7nw1brkvka0jf1frk3m7qkr-source

Notify maintainers

@tbenst


Note for maintainers: Please tag this issue in your PR.


Add a 👍 reaction to issues you find important.

@sliedes sliedes added the 0.kind: bug Something is broken label Jan 7, 2025
@sliedes
Copy link
Author

sliedes commented Jan 7, 2025

This might be a fix, but I need to sleep before testing it and sending a PR:

-    serverDir="$HOME/.vscode-server/bin/$COMMIT_ID"
+    serverDir="$VSCODE_AGENT_FOLDER/bin/$COMMIT_ID"

sliedes added a commit to sliedes/nixpkgs that referenced this issue Jan 7, 2025
This fixes remote ssh on vscode insiders where the path is
~/.vscode-server-insiders instead of ~/.vscode-server. (NixOS#371686)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant