Skip to content

Support Include3rdPartyDLLForSelfExtract for NativeAoT #39202

Open
@ALIENQuake

Description

@ALIENQuake

Describe the solution you'd like

I want to achieve a NativeAoT, true single-file Avalonia. Avalonia supports AoT just fine, the problem lies with the 3 additional native DLLs:

av_libglesv2.dll
libHarfBuzzSharp.dll
libSkiaSharp.dll

which are native libraries. When compiling with Include3rdPartyDLLForSelfExtract, the resulting exe would be still AoT but all those extra DLLs would be extracted in the same manner as pre-NET6 IncludeNativeLibrariesForSelfExtract did for clrcompression.dll, clrjit.dll, coreclr.dll, mscordaccore.dll aka "during exe launch, extract those required dlls and load them".

Include any alternative solutions you've considered.

  • IncludeAllContentForSelfExtract - no AoT, also it creates double exe, and slowdowns startup, I want only DLLs to be extracted.
  • Foddy>Costura - it works but only on Windows, maintenance mode
  • ILRepack, ILMerge, custom solution for adding dll as resources and extract during startup
  • Statically link those DLLs into the main exe by using DirectPInvoke, NativeLibrary - works only for Windows, it's impossible to statically compile those libs with glibc

Additional context

The true single-file apps are way, way better when it comes to distribution and auto-updating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-NativeAOTNative AOT compilationuntriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions