Closed ilyahryapko closed 2 years ago
Here's the libraries i've found in container
root@044be08df36e:/app# ldconfig -p | grep 'libwkhtml'
libwkhtmltox.so.0 (libc6,AArch64) => /usr/local/lib/libwkhtmltox.so.0
libwkhtmltox.so (libc6,AArch64) => /usr/local/lib/libwkhtmltox.so
https://drive.google.com/file/d/1HYOUanvInomz5giPibU4q2qUaJy8A3II/view?usp=sharing
@ilyahryapko I haven't added support for ARM64, we need the binaries and probably some additional code. I welcome PRs :)
@HakanL I will gladly commit that issue, but honestly speaking I do not have any idea on how to start. My first thought was the following algorithm
Haukcode.WkHtmlToPdfDotNet.targets
file in order to copy needed libraries via $(Platform)
optionWkHtmlModuleLinuxArm64
with corresponding public const string DLLNAME = "runtimes/linux-arm64/native/libwkhtmltox";
System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture
and call new class mentioned beforeDid I get everything correct or am I missing something? Is there another way to get this 0.12.5 arm64 libwkhtmltox?
That looks correct, I haven't done any development on ARM64, but give it a shot, create a fork and see if you can make it run locally first.
@ilyahryapko Can you see if the latest version fixed this?
@HakanL Sorry for a late reply. Unfortunately do not have M1 anymore so I am unable to test this
Version 1.5.81 which is in NuGet now should support Linux ARM64. I have tested it in Docker on a Macbook Air M1, but more testing would be good.
Hello. Got an issue with workaround when using your library in arm64-hosted containers.
I have Mac M1 and x86 PC. My .net5 containers when launched on each of mentioned devices are arm64 and amd64 (docker specify it by itself i guess). Everything is working fine when containers are x86, but with arm64 the following exception appears `NotSupportedException: Unable to load native library. The platform may be missing native dependencies (libjpeg62, etc). Or the current platform is not supported.
WkHtmlToPdfDotNet.ModuleFactory.GetModule()`
I
docker exec
-ed into container and tried to investigate the problem. Simple installing the parent library arm64 seems to fix the issue. Installing does not require additional dependencies to be installed, so it's only a matter of parent package itself I guessI've read in readme that this is not how this library is supposed to function. So I don't know should I stick to that solution. Also I've found repo with binaries, maybe this repo just misses arm64 type of lib? IDK, just guessing.
Some additional info I have following Dockerfile (these packages for install was just copied from output of 'apt install wkhtmltopdf --no-install-recommends', many of them are included in your console app dockerfile).
Entrypoint script here only runs
dotnet Api.dll
And following csproj (partially presented here)
So is it okay to probably launch some bash script to get current container architecture and install this package if needed? Or solution can be found and commited there? If so I'd like to help with contributing, just need some guidance