"Live Share" in vscode (pantherx-extra)

Hi,

I use vscode in pantherx-extra from my Guix OS.
It works great except for its “Live Share” feature.

Upon examination, it looks like it fails due to missing libraries for vsls-agent. (I am not too familiar with Linux though…)

$ ldd -d /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent
	linux-vdso.so.1 (0x00007ffce05e8000)
	libpthread.so.0 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0 (0x00007facb7848000)
	libdl.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl.so.2 (0x00007facb7843000)
	libstdc++.so.6 => not found
	libm.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6 (0x00007facb7702000)
	libgcc_s.so.1 => not found
	libc.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6 (0x00007facb753e000)
	/lib64/ld-linux-x86-64.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007facb786a000)
undefined symbol: _ZTVN10__cxxabiv116__enum_type_infoE, version CXXABI_1.3	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZTTSt18basic_stringstreamIcSt11char_traitsIcESaIcEE, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZNSt8ios_base4InitD1Ev, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZNSs4_Rep11_S_terminalE, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZTTSt13basic_fstreamIcSt11char_traitsIcEE, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZTVSt15basic_streambufIcSt11char_traitsIcEE, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)
undefined symbol: _ZNSs4_Rep20_S_empty_rep_storageE, version GLIBCXX_3.4	(/home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent)

Upon looking at a few pages, I found:

So I copied a section of it that didn’t seem to depend on Nix.

~$ cat a.sh
# patch ELF loaders where needed
GCCLIB=$(dirname $(gcc -print-file-name=libstdc++.so.6))
LOADER=$(dirname $(gcc -print-file-name=ld-linux-x86-64.so.2))
find ~/.vscode/extensions/ ~/.config/Code -type f -perm -100 -print0 | xargs -0 file \
| grep 'interpreter /lib' | cut -d: -f1 | while read f; do
	echo "Patching $f" >&2
	patchelf --set-interpreter "$LOADER" "$f"
	RPATH=$(patchelf --print-rpath "$f")
	patchelf --set-rpath "${RPATH+RPATH:}$GCCLIB" "$f"
done

It did something, but it still doesn’t work - I get ‘Permission denied’ error.

~$ bash a.sh
Patching /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/node_modules/clipboardy/fallbacks/linux/xsel
Patching /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent
Patching /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/Microsoft.VisualStudio.LiveShare.Debugger.VSCodeAdapter
Patching /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/Microsoft.VisualStudio.LiveShare.Debugger.VSCodeHostAdapter
Patching /home/yasu/.config/Code/User/globalStorage/ms-vsliveshare.vsliveshare/dotnet-3.1.14/dotnet
Patching /home/yasu/.config/Code/User/globalStorage/ms-vsliveshare.vsliveshare/dotnet-3.1.14/shared/Microsoft.NETCore.App/3.1.14/createdump
~$ ldd -d /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent
	linux-vdso.so.1 (0x00007ffdac9a2000)
	libpthread.so.0 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0 (0x00007f06d110a000)
	libdl.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl.so.2 (0x00007f06d1105000)
	libstdc++.so.6 => /gnu/store/sz3yhray6kzgp7d0k4pvxmpnzdpd69rk-gcc-11.2.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.2.0/../../../libstdc++.so.6 (0x00007f06d0ef1000)
	libm.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6 (0x00007f06d0db0000)
	libgcc_s.so.1 => /gnu/store/sz3yhray6kzgp7d0k4pvxmpnzdpd69rk-gcc-11.2.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.2.0/../../../libgcc_s.so.1 (0x00007f06d0d96000)
	libc.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6 (0x00007f06d0bd2000)
	/home/yasu/.guix-profile/lib => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007f06d112c000)
~$ /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent
bash: /home/yasu/.vscode/extensions/ms-vsliveshare.vsliveshare-1.0.5273/dotnet_modules/vsls-agent: Permission denied

Does anyone know how to make this work? :smile: :smile: :smile:

1 Like

@yasu hello and welcome! Thanks for sharing your findings. We’ll have a look at it and get back to you soon :slight_smile:

1 Like

@yasu we didn’t have time to look into it yet but it’s on the roadmap.
In the meantime, if you discover anything, do share your findings. Cheers

1 Like

will do and please keep this open - I will very much appreciate this feature!!!

1 Like

Curious how did you manage to add pantherx-extra to Guix SD?

I keep getting a derivation failed error, after adding the channel:

Building from these channels:
  pantherx  https://channels.pantherx.org/git/pantherx-extra.git	b04a874
  nongnu    https://channels.pantherx.org/git/nongnu.git	3fab9e0
  flat      https://github.com/flatwhatson/guix-channel.git	e57424b
  nonguix   https://gitlab.com/nonguix/nonguix	354b152
  guix      https://git.savannah.gnu.org/git/guix.git	b79bdbe
Computing Guix derivation for 'x86_64-linux'... |
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
substitute: updating substitutes from 'https://mirror.brielmaier.net'...   0.0%guix substitute: warning: mirror.brielmaier.net: host not found: Name or service not known
substitute: 
The following derivations will be built:
  /gnu/store/a84hxwpfp2w0nwzkcs0d4f7g7vhqhis9-profile.drv
  /gnu/store/grzr8r8740asi2z2d6gq7bw3kbh26sql-pantherx.drv
  /gnu/store/0kwa7ip74zphzrhiz250crycl3g6f06b-inferior-script.scm.drv
  /gnu/store/f6m2xjdhnjj28vzv5iymqfg47815078y-profile.drv

substitute: updating substitutes from 'https://mirror.brielmaier.net'...   0.0%
substitute: updating substitutes from 'https://mirror.brielmaier.net'...   0.0%
building /gnu/store/grzr8r8740asi2z2d6gq7bw3kbh26sql-pantherx.drv...
/builder for `/gnu/store/grzr8r8740asi2z2d6gq7bw3kbh26sql-pantherx.drv' failed to produce output path `/gnu/store/c597kjga2vwc2vimw3kixnw0j0pdkdkn-pantherx'
build of /gnu/store/grzr8r8740asi2z2d6gq7bw3kbh26sql-pantherx.drv failed
View build log at '/var/log/guix/drvs/gr/zr8r8740asi2z2d6gq7bw3kbh26sql-pantherx.drv.gz'.
cannot build derivation `/gnu/store/a84hxwpfp2w0nwzkcs0d4f7g7vhqhis9-profile.drv': 1 dependencies couldn't be built
guix pull: error: build of `/gnu/store/a84hxwpfp2w0nwzkcs0d4f7g7vhqhis9-profile.drv' failed

And the referenced .drv log file contains only:

(repl-version 0 1 1)
WARNING: (px system install): imported module (gnu services) overrides core binding `delete'
(exception syntax-error (value image) (value "missing field initializers (operating-system)") (value ((filename . "/gnu/store/bn1naczaj7r8y2fmsr5c3jfskhirpsx0-pantherx-extra-b04a874/px/system/install/raspberry.scm") (line . 94) (column . 22))) (value (image (format (quote disk-image)) (partitions (list %raspberrypi-boot-partition %raspberrypi-root-partition)))) (value #f))