Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avalonia Browser is broken on net8.0 (Emscripten 3.1.34) #12225

Closed
fMichaleczek opened this issue Jul 16, 2023 · 6 comments · Fixed by #13312
Closed

Avalonia Browser is broken on net8.0 (Emscripten 3.1.34) #12225

fMichaleczek opened this issue Jul 16, 2023 · 6 comments · Fixed by #13312
Assignees

Comments

@fMichaleczek
Copy link

Describe the bug
Wasm app is broken when use latest dotnet sdk 8.0 which use Emscripten 3.1.34

To Reproduce

  1. Install dotnet sdk 8.0.100-preview.6.23330.14
  2. Upgrade your wasm projet to net8.0
  3. Build.
  4. See Error in MSBuild.log
    1>wasm-ld : warning : function signature mismatch: time

Expected behavior
It works

Logs
wasm-ld : warning : function signature mismatch: time
error MSB3073: The command "emcc exited with code 1.

Desktop:

  • OS: Microsoft Windows 11 (22621)
  • SDK : dotnet 8.0.100-preview.6.23330.14
  • Avalonia : 11.0

Additional context

mono/SkiaSharp#2494
mono/SkiaSharp#2495

@maxkatz6
Copy link
Member

Yes, it's a known skiasharp issue, should be already fixed with the latest skia nightly builds.

@fMichaleczek
Copy link
Author

fMichaleczek commented Jul 17, 2023

@maxkatz6 My Workaround bellow.
Next dotnet8.0 preview should contain first improvements with a SynchronisationContext in multithreading (it's merged)
dotnet/runtime#87567 (comment)

In Avalonia :

  • update SkiaSharp.props with the latest preview available on nuget (2.88.4-preview.84)
  • update HarfBuzzSharp.props with the latest preview available on nuget (2.8.2.4-preview.84)
  • recompil

In your Browser App csproj (example here MobileSandbox.Browser)

  • update MobileSandbox.Browser csproj to net8.0
  • in an Itemgroup, add this to use Emscripten 3.1.34
<ItemGroup>
    <NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\3.1.34\st\*.a" />
    <NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\3.1.34\st\*.a" />
<ItemGroup>

PS : multithreading compile too but it's not working at end (expected result)

<PropertyGroup>
    <WasmEnableThreads>true</WasmEnableThreads>
</PropertyGroup>
<ItemGroup>
    <NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\3.1.34\mt\*.a" />
    <NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\3.1.34\mt\*.a" />
<ItemGroup>

@kekekeks
Copy link
Member

You don't need to update Avalonia to use a newer SkiaSharp, you can just add relevant PackageReference entries directly to your project.

@webprofusion-chrisc
Copy link

Hi, I see this is considered a skiasharp issue, so are we still waiting for someone in another project to do something? I'd really like to publish my app as net8 but it, and I assume any browser target app, fails to compile with undefined symbol warnings if I target net8.

@timunie
Copy link
Contributor

timunie commented Sep 19, 2023

We have a WIP PR #12729 . Still need to work out how and when to finally update, as this is a breaking change and 3.0 of SkiaSharp is not released yet

@curia-damiano
Copy link

Hi I am interested in this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants