codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

improve NixOS troubleshooting in wiki

Open sefidel opened this issue 2 years ago • 3 comments

While the first 3 patchelf command makes the binary "start", it immediately quits with error regarding libz. I was able to get it to work after running those 3 commands, so I think it'd be better to add those to the wiki:

$ patchelf --add-needed $LIBZ $VSCODE/extensions/vadimcn.vscode-lldb-1.6.5/adapter/codelldb
$ patchelf --add-needed $LIBZ $VSCODE/extensions/vadimcn.vscode-lldb-1.6.5/lldb/bin/lldb
$ patchelf --add-needed $LIBZ $VSCODE/extensions/vadimcn.vscode-lldb-1.6.5/lldb/bin/lldb-server

where LIBZ is a path to libz.so.1 e.g /nix/store/*zlib*/lib/libz.so.1

sefidel avatar Jul 18 '21 08:07 sefidel

This does not seem to work. Same result before and after patching.

❯ strace ./vadimcn.vscode-lldb-1.6.10/adapter/codelldb
execve("./vadimcn.vscode-lldb-1.6.10/adapter/codelldb", ["./vadimcn.vscode-lldb-1.6.10/ada"...], 0x7ffc66f38c20 /* 88 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++

Also no luck installing and running this extension in nix-shell -p zlib.

Avi-D-coder avatar Dec 06 '21 17:12 Avi-D-coder

vscode-fhs is a workaround.

Avi-D-coder avatar Dec 06 '21 20:12 Avi-D-coder

CODELLDB=~/.vscode-oss/extensions/vadimcn.vscode-lldb-1.10.0-universal/adapter/codelldb
patchelf --set-interpreter /nix/store/9y8pmvk8gdwwznmkzxa6pwyah52xy3nk-glibc-2.38-27/lib/ld-linux-x86-64.so.2 "$CODELLDB"
patchelf --add-rpath /nix/store/lprrvg44cyn9ajpq77lh7rlnp4kzdqzs-zlib-1.3/lib "$CODELLDB"
patchelf --add-needed libz.so.1 "$CODELLDB"
"$CODELLDB" -V

concatime avatar Dec 21 '23 17:12 concatime