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

Is AOT supported? #37

Open
kjpgit opened this issue Sep 7, 2023 · 1 comment
Open

Is AOT supported? #37

kjpgit opened this issue Sep 7, 2023 · 1 comment

Comments

@kjpgit
Copy link

kjpgit commented Sep 7, 2023

I did dotnet publish with C# AOT, got no warnings. PublishAot=True in csproj.

At runtime, when I call execve():

Unhandled Exception: System.TypeInitializationException: A type initializer threw an exception. To determine which
type, inspect the InnerException's StackTrace property.
---> System.DllNotFoundException: Unable to load shared library 'MonoPosixHelper' or one of its dependencies. In o
rder to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting
the LD_DEBUG environment variable:
MonoPosixHelper.so: cannot open shared object file: No such file or directory
libMonoPosixHelper.so: cannot open shared object file: No such file or directory
MonoPosixHelper: cannot open shared object file: No such file or directory
libMonoPosixHelper: cannot open shared object file: No such file or directory

@jonpryor
Copy link
Member

jonpryor commented Nov 8, 2023

I think this is less a problem with AOT, and more a problem with dotnet publish integration/support: libMonoPosixHelper.so is a native library, and thus outside the confines of AOT, but it does need to be separately packaged with your application and present in a directory that dlopen() will search for, whether that be some system-wide location or by having environment variables such as LD_LIBRARY_PATH include the directory that contains libMonoPosixHelper.so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants