flathub / com.visualstudio.code

https://flathub.org/apps/details/com.visualstudio.code
151 stars 72 forks source link

Cannot use pyenv-installed python due to missing library #174

Open valmar opened 4 years ago

valmar commented 4 years ago

On my system, I installed a version of python using pyenv. The version of python is compiled by pyenv from source against libraries in the system, as normal

Visual Studio code cannot find this version of python. Looking at the logs I see:

Error 2020-08-19 01:13:50: Failed to get interpreter information for '/home/valmar/.pyenv/versions/om-py3/bin/python3' [Error: Command failed: "/home/valmar/.pyenv/versions/om-py3/bin/python3" "/home/valmar/.var/app/com.visualstudio.code/data/vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/pyvsc-run-isolated.py" "/home/valmar/.var/app/com.visualstudio.code/data/vscode/extensions/ms-python.python-2020.8.101144/pythonFiles/interpreterInfo.py"
/home/valmar/.pyenv/versions/om-py3/bin/python3: error while loading shared libraries: libcrypt.so.2: cannot open shared object file: No such file or directory

libcrypt is installed in my system, but no in the Flatpak. Pyenv is quite a commonly used program. Would it be possible please to install the library in the flatpak?

valmar commented 4 years ago

Temporary workaround, based on a suggestion from @alexlarsson here: https://github.com/flatpak/flatpak/issues/1277

I copied the libcrypt libraries to $HOME/.var/app/com.visualstudio.code/

cp /usr/lib64/libcrypt.so.2* $HOME/.var/app/com.visualstudio.code/

The used the override command:

flatpak --user override --env=LD_PRELOAD= $HOME/.var/app/com.visualstudio.code/libcrypt.so.2 com.visualstudio.code

This works, but I think libcrypt should be in the flatpak environment

valmar commented 3 years ago

The workaround stopped working on Fedora 33.

The underlying filesystem in the flatpak seems to be based on Fedora 32, which is based on an older version of glib. So, copying the libcrypt library in the container does not work anymore, because it has been build against the glib version in Fedora 33.

For now I have to revert to the rpm version of Visual Studio Code. Would it be possible to updated the underlying system, please?