Closed MattBlack85 closed 1 year ago
I guess that .NET eqvivalent of strip would be trim.
You can read about it here: https://ivanderevianko.com/2020/09/make-apps-small-again-trimming-net-5
But as my knowledge currently only trimmode CopyUsed working with AvaloniaUI. See comment in CollimationCircles.csproj file:
More here:
You can try with trimmode CopyUsed but it's not guaranted to work either. You can further limit trimming with adding tags in csproj file as described here: https://ivanderevianko.com/2020/09/make-apps-small-again-trimming-net-5.
In future versions I will try to publish trimmed application. Will addit to TODO list.
Hope that that helps.
Hmm, I guess dotnet trim si not strip eqvivalent: acording to https://github.com/dotnet/runtime/issues/37334
Maybe we should merge multiple files in single executable before strip. This can be done with ILMerge.exe or ILRepack. But I guess both are only available on windows.
I think it's not worth the effort.
Good news Mattia! I have revisited my publish workflow and discovered nice option for C# project file
Im using this command now for publishing:
dotnet publish -c Release -f net7.0 -r linux-arm64 -o d:/Projekti/Publish/linux-arm64 --self-contained true /p:PublishSingleFile=true /p:PublishReadyToRun=true /p:DebugType=None /p:DebugSymbols=false
@sajmons thanks! I will update my build script ASAP :rocket:
@MattBlack85 I have just released new version 2.1.0
yup, already compiling and packaging for archlinux :)
Great! Thank you very much!
Hi @sajmons
I found a weird issue which I am not sure where it originates from since I am a .NET sheep.
So, everything works correctly if I run the commands you gave me and the app starts, but when packaging for Arch the package got broken.
The error:
After some investigations I found out that stripping symbols completely breaks the executable.
strip
is generally used to remove unneeded symbols from libs/bins and it helps making also the program smaller (122MB not stripped VS 21MB stripped)do you know if there is a way to strip safely an executable generated with the .NET sdk?
in the meanwhile I will skip stripping for the ArchLinux package
to replicate:
strip CollimationCircles
CollimationCircles
an error will appear