Fody / Costura

Embed references as resources
MIT License
2.41k stars 275 forks source link

Make Unmanaged32Assemblies and Unmanaged64Assemblies works for Linux and macOS executables #934

Closed ALIENQuake closed 10 months ago

ALIENQuake commented 10 months ago

Summary

Just so you know, the 'alternatives' from the Costura readme are not applicable because of the usage of NativeAot.

I'm using Net 8.0, the same project for Windows, Linux, and macOS.

When compiling an application with Unmanaged32Assemblies='libHarfBuzzSharp|libSkiaSharp' for Linux executable, the libHarfBuzzSharp.so, and libSkiaSharp.so are not included as resources.

For Windows, the libHarfBuzzSharp.dll, and libSkiaSharp.dll are successfully included as resources, extracted and loaded so the application works.

API Changes

None.

Intended Use Case

Linux and macOS executable using NatoveAoT compilation for net projects that uses dll/so for eg: SkiaSharp or Angle etc.

GeertvanHorrik commented 10 months ago

This project is in maintenance mode. Adding support for such a platform seems like quite some work.

You could look into this, where we implemented a dynamic, Costura supported, assembly loader. You might get some ideas from this on how to extract and load the required files at runtime.

https://github.com/WildGums/Orc.Extensibility/blob/develop/src/Orc.Extensibility/Services/RuntimeAssemblyResolverService.cs