Skip to content
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

SDL2 not found on ubuntu 20.04 with dotnet-sdk installed from snap #6

Open
madsobitsoe opened this issue Sep 8, 2022 · 2 comments
Open
Labels
documentation Improvements or additions to documentation

Comments

@madsobitsoe
Copy link
Contributor

When running dotnet fsi someFile.fsx on ubuntu 20.04 with dotnet-sdk installed via snap, SDL2 is not found. Neither the shipped SDL2.so or a user-installed SDL2, through libsdl2-dev.

The problem seems to be related to ld not finding GLIBC. The system were the issue was discovered has glibc-2.35, confirmed by ldd --version.

An abbreviated output from LD_DEBUG=libs dotnet fis someFile.fsx is seen below:

> grep SDL2 lddebug\ \(1\).log
     50390:	find library=SDL2.so [0]; searching
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../lib/x86_64-linux-gnu/SDL2.so
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../usr/lib/x86_64-linux-gnu/SDL2.so
     50390:	  trying file=/snap/dotnet-sdk/177/usr/lib/x86_64-linux-gnu/SDL2.so
     50390:	  trying file=/snap/dotnet-sdk/177/lib/x86_64-linux-gnu/SDL2.so
     50390:	  trying file=/lib/x86_64-linux-gnu/SDL2.so
     50390:	  trying file=/usr/lib/x86_64-linux-gnu/SDL2.so
     50390:	  trying file=/lib/SDL2.so
     50390:	  trying file=/usr/lib/SDL2.so
     50390:	find library=libSDL2.so [0]; searching
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../lib/x86_64-linux-gnu/libSDL2.so
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../usr/lib/x86_64-linux-gnu/libSDL2.so
     50390:	  trying file=/snap/dotnet-sdk/177/usr/lib/x86_64-linux-gnu/libSDL2.so
     50390:	  trying file=/snap/dotnet-sdk/177/lib/x86_64-linux-gnu/libSDL2.so
     50390:	  trying file=/lib/x86_64-linux-gnu/libSDL2.so
     50390:	/snap/dotnet-sdk/177/lib/x86_64-linux-gnu/libm.so.6: error: version lookup error: version `GLIBC_2.29' not found (required by /lib/x86_64-linux-gnu/libSDL2.so) (fatal)
     50390:	find library=SDL2 [0]; searching
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../lib/x86_64-linux-gnu/SDL2
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../usr/lib/x86_64-linux-gnu/SDL2
     50390:	  trying file=/snap/dotnet-sdk/177/usr/lib/x86_64-linux-gnu/SDL2
     50390:	  trying file=/snap/dotnet-sdk/177/lib/x86_64-linux-gnu/SDL2
     50390:	  trying file=/lib/x86_64-linux-gnu/SDL2
     50390:	  trying file=/usr/lib/x86_64-linux-gnu/SDL2
     50390:	  trying file=/lib/SDL2
     50390:	  trying file=/usr/lib/SDL2
     50390:	find library=libSDL2 [0]; searching
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../lib/x86_64-linux-gnu/libSDL2
     50390:	  trying file=/snap/dotnet-sdk/177/shared/Microsoft.NETCore.App/6.0.8/../../../usr/lib/x86_64-linux-gnu/libSDL2
     50390:	  trying file=/snap/dotnet-sdk/177/usr/lib/x86_64-linux-gnu/libSDL2
     50390:	  trying file=/snap/dotnet-sdk/177/lib/x86_64-linux-gnu/libSDL2
     50390:	  trying file=/lib/x86_64-linux-gnu/libSDL2
     50390:	  trying file=/usr/lib/x86_64-linux-gnu/libSDL2
     50390:	  trying file=/lib/libSDL2
     50390:	  trying file=/usr/lib/libSDL2
     50390:	/snap/dotnet-sdk/177/lib/x86_64-linux-gnu/libc.so.6: error: version lookup error: version `GLIBC_2.33' not found (required by /home/peter/.nuget/packages/diku.canvas/1.0.0/runtimes/linux-x64/native/libSDL2.so) (fatal)
System.DllNotFoundException: Unable to load shared library 'SDL2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libSDL2: cannot open shared object file: No such file or directory
@madsobitsoe
Copy link
Contributor Author

Uninstalling the snap-distribution of dotnet-sdk and reinstalling with good ol' sudo apt install dotnet-sdk the issue vanishes.

My proposed "fix" for this is to lecture people on not to use snap, and not waste any time on fixing problems caused by projects that wants to change the way(s) software works.

@kfl
Copy link
Member

kfl commented Sep 19, 2022

I'm a big proponent of not wasting time.

However, since it is one of the officially supported ways of installing dotnet, see Install the .NET SDK or the .NET Runtime with Snap, it might be useful to understand what goes wrong.

My current hypothesis is that the above installation guide have not be followed to the dot. Maybe the DOTNET_ROOT environment variable isn't set, or maybe it is something like: dotnet/sdk#10403.

@kfl kfl added the documentation Improvements or additions to documentation label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants