tonybaloney/Pyjion

Pyjion doesn't work on x64 Fedora 35 with .NET 6 runtime installed using snap package

Kami opened this issue · 2 comments

Kami commented

Environment info:

$ python --version
Python 3.10.0

$ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.0 [/var/lib/snapd/snap/dotnet-sdk/147/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [/var/lib/snapd/snap/dotnet-sdk/147/shared/Microsoft.NETCore.App]

$ cat /etc/fedora-release 
Fedora release 35 (Thirty Five)

$ pip show pyjion
Name: pyjion
Version: 1.0.0

Dotnet runtime was installed using snap package / method (https://docs.microsoft.com/en-us/dotnet/core/install/linux-snap).

When I try to run code using pyjion, I get the following error:

pyjion libcloud/test/test_http.py 
Traceback (most recent call last):
  File "/home/kami/w/libcloud/libcloud/pyjion/bin/pyjion", line 5, in <module>
    from pyjion.__main__ import main
  File "/home/kami/w/libcloud/libcloud/pyjion/lib64/python3.10/site-packages/pyjion/__init__.py", line 74, in <module>
    lib_path = _which_dotnet()
  File "/home/kami/w/libcloud/libcloud/pyjion/lib64/python3.10/site-packages/pyjion/__init__.py", line 54, in _which_dotnet
    ctypes.cdll.LoadLibrary(clrjitlib)
  File "/usr/lib64/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib64/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /snap/core18/current/lib/x86_64-linux-gnu/libdl.so.2: undefined symbol: _dl_vsym, version GLIBC_PRIVATE

To me it looks like some kind of dotnet error, but I didn't have time to dig deeper in yet. When I get a chance, I will try to dig in some more and also try to install dotnet runtime using non-snap method.

Thanks!

Kami commented

OK, so it looks like the issue is indeed related to precompiled binary and shared libraries in the dotnet snap package.

If I install it using the script method (https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install), it works 🎉

$ ...
$ export DOTNET_ROOT=/home/kami/.dotnet/
$ pyjion libcloud/test/test_http.py 

thanks for the report, I'll make a note of this