-
-
Notifications
You must be signed in to change notification settings - Fork 81
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 1.88.0 changed paths => nixos-vscode-server no longer functional #79
Comments
Solution proposal: Scan for all binaries in the |
The script #! /usr/bin/env nix-shell
#! nix-shell -i sh -p file patchelf
libpath=$(nix eval --raw --impure --expr 'with import <nixpkgs> {}; lib.makeLibraryPath [ stdenv.cc.libc stdenv.cc.cc curl icu libunwind libuuid lttng-ust openssl zlib krb5 ]')
files_to_patch=$(find ~/.vscode-server -type f -name '*node' -exec file {} + | grep 'ELF' | grep 'executable' | grep 'interpreter /lib/' | awk -F: '{print $1}')
interpreter="$(cat $(nix eval --raw --impure --expr '(import <nixpkgs> {}).stdenv.cc.outPath')/nix-support/dynamic-linker)"
for elf in $files_to_patch; do
echo "patching $elf"
patchelf --set-interpreter "$interpreter" --add-rpath "$libpath" "$elf"
done succeeds in making the executables runnable, but it's not enough to satisfy VSCode 1.88.0 which is apparently not fooled by my patchelf shenanigans. |
Update: running
along with the above script works. Altogether now, my script is #! /usr/bin/env nix-shell
#! nix-shell -i sh -p file patchelf
# Move the <foo>.staging directories to <foo>. Necessary since VSCode 1.88.0.
find ~/.vscode-server/cli/servers -type d -name '*.staging' -exec bash -c 'for dir; do mv "$dir" "${dir%.staging}"; done' bash {} +
libpath=$(nix eval --raw --impure --expr 'with import <nixpkgs> {}; lib.makeLibraryPath [ stdenv.cc.libc stdenv.cc.cc curl icu libunwind libuuid lttng-ust openssl zlib krb5 ]')
files_to_patch=$(find ~/.vscode-server -type f -name '*node' -exec file {} + | grep 'ELF' | grep 'executable' | grep 'interpreter /lib/' | awk -F: '{print $1}')
interpreter="$(cat $(nix eval --raw --impure --expr '(import <nixpkgs> {}).stdenv.cc.outPath')/nix-support/dynamic-linker)"
for elf in "$files_to_patch"; do
echo "patching $elf"
patchelf --set-interpreter "$interpreter" --add-rpath "$libpath" "$elf"
done |
@samuela, thanks for looking into this. I think I'm running into the same problem. I just booted my little nixos machine last night for the first time in a few months and cannot get Remote Explorer to connect. It seems to be stuck looping the "Downloading VS Code Server." Unfortunately the above script doesn't seem to work. I get a |
Yes, this is exactly the behavior I was experiencing as well.
It should run fine just as a shell script... What version of VSCode are you using? |
thanks for the script @samuela. I changed the |
@n-hass That totally did it. Thanks! One slight typo in the above. The last single quote got "auto-incorrected" to a |
With #78 new binary paths are handled correctly. I've switched few nixos 23.11 machines to it, so far no problems. |
I've upgraded my machine to use a version that I believe includes #78, but I'm still unable to connect on newer versions of VSCode. Downgrading VSCode to 1.86.2 works and I can connect as before. Is there more that needs to be done? The error is:
(note that these files actually exist on my machine when I SSH into it) My configuration is:
and in my lockfile:
|
Can you try removing your |
I am also facing similar issues. When connecting with VS Code Version: 1.93.1 I get the error
Any advise on how to fix? |
This seems like a relatively old version. Are you sure that's the correct version number, and if so, have you tried removing the .vscode-server folder, then restarting the user service ? |
Sorry, i hadn't seen this! Deleting that folder didn't work, but deleting |
I just upgraded to VSCode 1.88.0 and it has broken nixos-vscode-server by moving the installation path of binaries. Logs reveal that there is a failure to execute
/home/skainswo/.vscode-server/cli/servers/Stable-5c3e652f63e798a5ac2f31ffd0d863669328dc4c.staging/server/bin/code-server
, which contains:"$ROOT/node"
resolves to /home/skainswo/.vscode-server/cli/servers/Stable-5c3e652f63e798a5ac2f31ffd0d863669328dc4c.staging/server/node which differs from previous node installation locations AFAICT. This file is not patched:IIUC adjustments to the
installPath
andbin_dir
logic in https://github.com/nix-community/nixos-vscode-server/blob/master/pkgs/auto-fix-vscode-server.nix will be required.The text was updated successfully, but these errors were encountered: