Open ivanjx opened 1 year ago
It should be optional, as it works only with native AOT. I suppose ideal plan would be something like:
no need for another static linking configuration in the csproj. DirectPInvoke
and NativeLibrary
is smart enough to ignore themselves if it is not being published. native aot will only kick in dotnet publish
command.
@maxkatz6 are there any static library files .lib
for those 2 dlls? if there arent how to create one? thanks
you will need to look for them here, possibly compile Skia manually https://github.com/mono/SkiaSharp
Is there a workaround to achieve this?
My software is distributed as singlefile, it is quite impractical to use AOT when 3 more dlls are added on the side.
For the SingleFile deployment it's possible to include native dependencies: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#include-native-libraries
I don't think it's applicable for the NativeAOT, that's more a question to the .NET runtime team.
For the SingleFile deployment it's possible to include native dependencies: https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli#include-native-libraries
yes, i know, meant for NativeAOT.
I don't think it's applicable for the NativeAOT, that's more a question to the .NET runtime team.
it's not works.
deploying native aot avalonia apps is possible with single exe as long as you have the static libs mentioned above. i have compiled those and works fine
@ivanjx static lib, Where did you get them? So you successfully create a single AOT file?
@danielmayost yes. you need to compile skia and harfbuzz urself. my hands are full right now so cant explain the details but u can search on how to do those.
here is my compiled required libs for avalonia on windows x64 platform if anyone is interested. https://mega.nz/file/z34V3bSZ#boItQx_nLBRGu-biDL3PbKSSG_Ti87JL7KNY7qz2Li8
you can build skia for other platforms if you look inside the cake
files. here is the ones for windows that i use as reference: https://github.com/mono/SkiaSharp/blob/main/native/windows/build.cake
for harfbuzz you can use this and open in visual studio. there is some settings to change to enable static build but i forgot which: https://github.com/mono/SkiaSharp/tree/main/native/windows/libHarfBuzzSharp
reference about the build commands: https://github.com/mono/SkiaSharp/wiki/Building-on-Linux
@ivanjx I downloaded your x64 win native libs and wrote static linking in .csproj:
<ItemGroup>
<DirectPInvoke Include="libHarfBuzzSharp" />
<NativeLibrary Include="native\libHarfBuzzSharp.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<DirectPInvoke Include="libSkiaSharp" />
<NativeLibrary Include="native\libSkiaSharp.lib" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
</ItemGroup>
But I'm getting strange errors that I can't understand. Can you help me?
libHarfBuzzSharp.lib(hb-face.obj) : found .netmodule MSIL or a module compiled with the /GL parameter; the layout is restarted with the /LTCG parameter; add /LTCG to the command line of the layout to improve the performance of the linker
EXEC : fatal error C1900: IL mismatch between "P1", version "20220715" and "P2", version "20220421"
LINK : fatal error LNK1257: failed to generate code
C:\Users\green\.nuget\packages\microsoft.dotnet.ilcompiler\8.0.0-preview.1.23110.8\build\Microsoft.NETCore.Native.targets(354,5): error MSB3073: exiting the "" commandC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\
MSVC\14.33.31629\bin\Hostx64\x64\link.exe " @"obj\Release\net8.0\win-x64\native\link.rsp"" with code 1257.
@Cubody
i only tested this with net 7.0
. maybe try to use that. or you can try to build the static libs with your current visual studio installation.
@ivanjx I also tried with .NET 7.0, but SDK is 8.0. I will be very grateful if you can enlighten a little more in compiling native libraries, because I have never met with this before. The feeling is that the error says that the nuget package(both Skia and second) is a different version instead of that's natives. I am using Avalonia 11 preview 5.
I'm also using Rider and can not download Visual Studio due to stupid region restriction :/
i believe avalonia version is not the problem here as i am using nightly. try the 7.0 sdk
for compiling without visual studio i dont think it is possible as the compilers came from the visual studio installation. maybe you can install the compilers manually but idk how
SDK 7.0 didn't help me =( I will try to install VS, but how to compile natives? Can you provide full instruction for these two libraries if it's not hard for you? I think I can deal with .cake if I'll read docs but it's not clear about HarfBuzzSharp.
in general this is what you have to do at first:
git submodule update --init --recursive
cd externals\skia
python .\tools\git-sync-deps
with skiasharp, you can follow these commands with a few adjustments (it has been a while but it is very similar). for the args required it is all mentioned in the .cake
file for windows.
with harfbuzzsharp it is actually a lot easier. just need to open the .sln
file inside the folder, re-target to latest if prompted, change the configuration type to static library, then build with Release configuration.
in your case @Cubody, i think the problem is only with the harfbuzz static library. so hopefully you can just build that yourself without rebuilding the skiasharp.
so here is the full command that i use for compiling skiasharp
..\depot_tools\gn gen 'out/windows/x64' --args='target_os=\"win\" target_cpu=\"x64\" is_static_skiasharp=true skia_enable_fontmgr_win_gdi=false skia_use_dng_sdk=true skia_use_icu=false skia_use_piex=true skia_use_sfntly=false skia_use_system_expat=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_enable_skottie=true skia_use_vulkan=true skia_enable_gpu=true clang_win=\"C:\Program Files\LLVM\" extra_cflags=[ \"-DSKIA_C_DLL\", \"/MT\", \"/EHsc\", \"/Z7\", \"-D_HAS_AUTO_PTR_ETC=1\" ]'
..\depot_tools\ninja 'SkiaSharp' -C 'out/windows/x64'
externals\skia\out\windows\x64
lib.exe /OUT:libSkiaSharp.lib *.lib
the first 2 commands are run inside the externals\skia
folder.
beware that the 2nd command will use a lot of your cpu!
note: if you encounter issues when running gn
, go inside your python installation path, copy python.exe
into python3.exe
@ivanjx Thanks a lot! I'll try it.
I just tried one more time with your libs and it works as expected! I deleted all .NET packages and installed just .NET 8 preview. Now it's fine.
Its not clear to me where the issue lies, which one(s) of the following is making this occour?
A) SkiaSharp & HarfBuzzSharp don't package static libraries in their NuGet packages so there's nothing to statically link. B) The NativeAOT compilation process in .NET doesn't support automatically statically linking 3rd party libs. C) Both A & B are false and something else is blocking it from building a true published single executable
While its nice that there's a work around of building your own static libraries and configuring your project to use it, I don't consider that to be a fix for the problem. The goal should be that it works out of the box.
If I understand correctly A is the problem. It's really frustrating not being able to publish a single AOT file, try as I might, I couldn't build SkiaSharp by myself.
i think including the static lib in the nuget wont be ideal for skiasharp as it is very big even for a single platform. imagine adding other platforms as well.
i think including the static lib in the nuget wont be ideal for skiasharp as it is very big even for a single platform. imagine adding other platforms as well.
It doesn't have to be in the same NuGet package, they can split it out into:
And then end users can configure their projects to include the relevant packages for specific builds i.e
<ItemGroup>
<PackageReference Include="SkiaSharp.x64Linux.Static" Condition="$(TargetPlatform) = '...'" />
</ItemGroup>
Maybe someone would be so kind as to share the static libraries they managed to create (av_libglesv2 and libSkiaSharp) for the benefit of those who haven't managed to do it yet.
@danielmayost do you have any issues compiling the native libraries by yourself? please try follow this https://github.com/AvaloniaUI/Avalonia/issues/9503#issuecomment-1474233516
I have a problem with the command:
python .\tools\git-sync-deps
probably because of a censored internet problem I'm having.
@danielmayost have you tried this https://github.com/AvaloniaUI/Avalonia/issues/9503#issuecomment-1435511465
Unfortunately that doesn't work for me either. Links from GitHub itself work.
Edit: thank, i downloaded your libs, and it's works.
If you see found .netmodule MSIL or a module compiled with the /GL parameter; the layout is restarted with the /LTCG parameter
that means that something in the LIB was compiled with the /GL
parameter passed to the C++ compiler ("Whole program optimization"). Whole program C++ optimizations require that all the LIB files, link.exe, etc. have a matching version. You'd need to match the version of the C++ compiler used to compile the native parts of the .NET runtime. That might work sometimes, but fail other times. The fix is to not pass /GL
when building your LIB.
@MichalStrehovsky if it works on compile time with wont crash on runtime correct? thank you for the info.
@ivanjx I finally succeeded to compile SkiaSharp
(according to the commands you wrote), the final file I received is about 1GB and in the files you sent it is about 400MB, do you have any idea?
@danielmayost you dont have to worry about the lib size since you dont have to ship it with your application. in my case the output exe is only around 60 MB.
my latest output size of the lib file is also 1 GB. maybe there are some differences between the linker command i used the first time with what i wrote here. forgot what i used the first time.
edit: i got ~400MB size because i use LLVM.
updated build steps for windows
requirements:
desktop development with c++
libSkiaSharp
:
git clone https://github.com/mono/SkiaSharp.git
git checkout release/2.88.6
(or pick according the skiasharp version in the nuget list)git submodule update --init --recursive
cd external/skia
python .\tools\git-sync-deps
python ..\depot_tools\gn.py args .\out\windows\x64\
this is what i put (according to this)
target_os="win"
target_cpu="x64"
is_static_skiasharp=true
skia_enable_fontmgr_win_gdi=false
skia_use_dng_sdk=true
skia_use_icu=false
skia_use_piex=true
skia_use_sfntly=false
skia_use_system_expat=false
skia_use_system_libjpeg_turbo=false
skia_use_system_libpng=false
skia_use_system_libwebp=false
skia_use_system_zlib=false
skia_use_vulkan=true
skia_use_angle=true
skia_enable_skottie=true
skia_enable_gpu=true
clang_win="C:\Program Files\LLVM" <<=== REMOVE IF YOU DONT HAVE LLVM
extra_cflags=[ "-DSKIA_C_DLL", "/MT", "/EHsc", "/Z7", "-D_HAS_AUTO_PTR_ETC=1" ]
..\depot_tools\ninja -C .\out\windows\x64\ SkiaSharp
cd .\out\windows\x64\
lib.exe /OUT:libSkiaSharp.lib *.lib
note:
gn.py args
go to C:\Program Files\LLVM\lib\clang
and rename the folder to be full version (eg: 16.0.0 instead of just 16).python ..\depot_tools\ninja.py -C .\out\windows\x64\ SkiaSharp
libHarfBuzzSharp
native\windows\libHarfBuzzSharp\libHarfBuzzSharp.sln
.Debug
to Release
.Configuration Type
to Static library
.c/c++
-> All Options
.Whole Program Optimization
. change to No
.c/c++
-> Command Line
. add /bigobj
.native\windows\libHarfBuzzSharp\bin\x64\Release
.I have created two github actions to build these static libs.
libSkiaSharp and libHarfBuzzSharp https://github.com/2ndlab/SkiaSharp.Static
ANGLE static https://github.com/2ndlab/ANGLE.Static
@peaceshi
Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering.
I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj
To undestand if it works or no you can add options to Build app:
BuildAvaloniaApp()
.With(new Win32PlatformOptions
{RenderingMode = new[] {Win32RenderingMode.AngleEgl}})
.StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash.
Also Avalonia uses it's own fork of ANGLE with some fixes.
@peaceshi
Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering.
I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csprojTo undestand if it works or no you can add options to Build app:
BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash.
Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the all needable dependencies
? Can you explain it further?
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the
all needable dependencies
? Can you explain it further?
I mean if I'll build just angle it'll not work because .dll itself uses many functions from other libs that angle bulk builds.
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the
all needable dependencies
? Can you explain it further?I mean if I'll build just angle it'll not work because .dll itself uses many functions from other libs that angle bulk builds.
No. I think it is just a static lib bug of ANGLE.
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the
all needable dependencies
? Can you explain it further?I mean if I'll build just angle it'll not work because .dll itself uses many functions from other libs that angle bulk builds.
No. I think it is just a static lib bug of ANGLE.
Here is old thread about static lib https://groups.google.com/g/angleproject/c/xKmUgKZFpgY
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the
all needable dependencies
? Can you explain it further?I mean if I'll build just angle it'll not work because .dll itself uses many functions from other libs that angle bulk builds.
No. I think it is just a static lib bug of ANGLE.
Here is old thread about static lib https://groups.google.com/g/angleproject/c/xKmUgKZFpgY
I have linked all missing symbols. It is working now.
Download av_libglesv2.7z
from https://github.com/2ndlab/ANGLE.Static/releases
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the
all needable dependencies
? Can you explain it further?I mean if I'll build just angle it'll not work because .dll itself uses many functions from other libs that angle bulk builds.
No. I think it is just a static lib bug of ANGLE.
Here is old thread about static lib https://groups.google.com/g/angleproject/c/xKmUgKZFpgY
I have linked all missing symbols. It is working now. Download
av_libglesv2.7z
from https://github.com/2ndlab/ANGLE.Static/releases
Nice work, appreciate it! Can you add these instructions to pipeline? It'll be easier for Avalonia to make its own Nuget.
Also I want to ask, is here any way to make my application size smaller? (I'm using some compilation flags) Now it's 70mb.
<PropertyGroup>
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
<AutoreleasePoolSupport>false</AutoreleasePoolSupport>
<EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
<EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
<EventSourceSupport>false</EventSourceSupport>
<HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
<MetadataUpdaterSupport>false</MetadataUpdaterSupport>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
<IlcTrimMetadata>true</IlcTrimMetadata>
<!-- <IlcDisableReflection>true</IlcDisableReflection> -->
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
</PropertyGroup>
<PropertyGroup>
<!--These can help when debugging weird exceptions especially when reflection is involved. See https://github.com/dotnet/corert/blob/master/Documentation/using-corert/optimizing-corert.md -->
<!--RootAllApplicationAssemblies: False -> TrimMode:link See https://github.com/dotnet/runtimelab/issues/597 and https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/optimizing.md -->
<IlcGenerateCompleteTypeMetadata>false</IlcGenerateCompleteTypeMetadata>
<IlcDisableUnhandledExceptionExperience>true</IlcDisableUnhandledExceptionExperience>
</PropertyGroup>
@peaceshi Have you made Avalonia single file native aot to work with static ANGLE? It doesn't work for me. I have a black background instead of transparent - the Avalonia UI uses software rendering. I made
<NativeLibrary Include="Native\av_libglesv2.lib" />
in csproj To undestand if it works or no you can add options to Build app:BuildAvaloniaApp() .With(new Win32PlatformOptions {RenderingMode = new[] {Win32RenderingMode.AngleEgl}}) .StartWithClassicDesktopLifetime(args);
If it'll not find ANGLE lib it'll crash. Also Avalonia uses it's own fork of ANGLE with some fixes.
You can try to build this for yourself. https://github.com/AvaloniaUI/angle/tree/avalonia-fork-master
Btw have you made Avalonia single file native aot to work with this? I already built but it doesn't help. Thats why Katz says that it's main problem to build angle as static library with all needable dependencies.
Emm, what is the
all needable dependencies
? Can you explain it further?I mean if I'll build just angle it'll not work because .dll itself uses many functions from other libs that angle bulk builds.
No. I think it is just a static lib bug of ANGLE.
Here is old thread about static lib https://groups.google.com/g/angleproject/c/xKmUgKZFpgY
I have linked all missing symbols. It is working now. Download
av_libglesv2.7z
from https://github.com/2ndlab/ANGLE.Static/releasesNice work, appreciate it! Can you add these instructions to pipeline? It'll be easier for Avalonia to make its own Nuget.
Also I want to ask, is here any way to make my application size smaller? (I'm using some compilation flags) Now it's 70mb.
<PropertyGroup> <IlcOptimizationPreference>Size</IlcOptimizationPreference> <AutoreleasePoolSupport>false</AutoreleasePoolSupport> <EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization> <EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding> <EventSourceSupport>false</EventSourceSupport> <HttpActivityPropagationSupport>false</HttpActivityPropagationSupport> <MetadataUpdaterSupport>false</MetadataUpdaterSupport> <UseSystemResourceKeys>true</UseSystemResourceKeys> <IlcGenerateStackTraceData>false</IlcGenerateStackTraceData> <IlcTrimMetadata>true</IlcTrimMetadata> <!-- <IlcDisableReflection>true</IlcDisableReflection> --> <IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies> </PropertyGroup> <PropertyGroup> <!--These can help when debugging weird exceptions especially when reflection is involved. See https://github.com/dotnet/corert/blob/master/Documentation/using-corert/optimizing-corert.md --> <!--RootAllApplicationAssemblies: False -> TrimMode:link See https://github.com/dotnet/runtimelab/issues/597 and https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/optimizing.md --> <IlcGenerateCompleteTypeMetadata>false</IlcGenerateCompleteTypeMetadata> <IlcDisableUnhandledExceptionExperience>true</IlcDisableUnhandledExceptionExperience> </PropertyGroup>
I will add these files to actions later. About the file size, you can use upx or sfx to compress it. But for the build trimming, all we can do is wait for .NET team creating a better trimming or other optimizations.
https://github.com/2ndlab/ANGLE.Static/releases/tag/v1.1.0
Everything works well now.
Good
@ivanjx sorry to piggyback off this. I've download all 3 .libs: av_libglesv2.lib
, libHarfBuzzSharp.lib
and libSkiaSharp.lib
. Imported them into my project and referenced them inside the .csproj
. However, when Publishing, the 3 .dll files still get copied over.
Any idea what I am doing wrong? Cheers
Is your feature request related to a problem? Please describe. it is now possible to static link native libraries inside the main binary so it should be possible to do that to the 2 native dlls from avalonia's native aot output, namely
libHarfBuzzSharp.dll
andlibSkiaSharp.dll
.Describe the solution you'd like include the static library files of those 2 dlls instead and use
DirectPInvoke
andNativeLibrary
.Additional context https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/interop.md#linking