SkiaSharp: [BUG] [WASM] HarfBuzzSharp Linker Errors
Description I’m using SkiaSharp + HarfBuzzSharp in a WebAssembly application. I have disabled the linker to reduce the build time for the project which leads to various issues listed below. With the linker enabled the build works fine but takes significantly longer.
This is the setup i’m using:
- .net5.0
- linker enabled
HarfBuzzSharp
Version 2.88.0-preview.7SkiaSharp
Version 2.88.0-preview.7HarfBuzzSharp.NativeAssets.WebAssembly
Version 2.6.1.8-preview.93
i’m inspecting the build logs with detailed verbosity and get the following output with System.Exception: Failed to generate AOT layout
Behavior
... linker-out > pinvoke-table.h.tmp (TaskId:779)
[00:01:57.7838172] Unhandled exception. System.Exception: Parameter types of pinvoke callback method 'System.IntPtr GetTableDelegateProxyImplementation(System.IntPtr, HarfBuzzSharp.Tag, System.IntPtr)' needs to be blittable. (TaskId:779)
[00:01:57.7839076] at PInvokeTableGenerator.Error(String msg) in D:\a\1\s\src\Uno.Wasm.Tuner\PInvokeTableGenerator.net5.cs:line 328 (TaskId:779)
Unhandled exception. System.Exception: The return type 'HarfBuzzSharp.UnicodeCombiningClass' of pinvoke callback method 'HarfBuzzSharp.UnicodeCombiningClass CombiningClassProxyImplementation(System.IntPtr, System.UInt32, System.Void*)' needs to be blittable.
Basic Information
- Version with issue: 2.88.0-preview.7
- Last known good version: x
- IDE: Visual Studio 2019
- Platform Target Frameworks:
- Uno WebAssembly Bootstrapper : 3.0.0-dev.95
- Target Devices:
- Browser
Reproduction Link
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (8 by maintainers)
Merged a workaround for now
You do not have to extract the file from your .nuget-Folder. The following worked for me (in an
ItemGroup
-Block):<NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\2.0.23\*.a" />