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

fix(wasm): Enable Wasm EH and SIMD in all configurations for net8+ #2495

Merged
merged 4 commits into from
Jun 19, 2023

Conversation

jeromelaban
Copy link
Contributor

Description of Change

Enables Wasm EH and SIMD by default for Emscripten 3.1.34 (net8)

Bugs Fixed

API Changes

None.

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

@KirillKornienko
Copy link

Looks like the same error

My .csproj:
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0-preview.5.23302.2" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0-preview.5.23302.2" PrivateAssets="all" />
    
    <PackageReference Include="SkiaSharp" Version="2.88.4-preview.72" />
    <PackageReference Include="SkiaSharp.HarfBuzz" Version="2.88.4-preview.72" />
    <PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" Version="2.88.4-preview.72" />
    <PackageReference Include="HarfBuzzSharp.NativeAssets.WebAssembly" Version="2.8.2.4-preview.72" />
  </ItemGroup>

  <ItemGroup>
    <NativeFileReference Include="$(HarfBuzzSharpStaticLibraryPath)\3.1.34\st\*.a" />
    <NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\3.1.34\st\*.a" />
  </ItemGroup>
</Project>

Build output:
1>Compiling native assets with emcc with -O0. This may take a while ...
1>[2/3] skipped unchanged files
1>[3/3] pinvoke.c -> pinvoke.o [took 0,52s]
1>Linking for initial memory $(EmccInitialHeapSize)=26279936 bytes. Set this msbuild property to change the value.
1>Linking with emcc with -O0. This may take a while ...
1> "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Node.win-x64\8.0.0-preview.5.23275.2\tools\bin\node.exe" "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64\8.0.0-preview.5.23275.2\tools\emscripten\src\compiler.js" C:\Users\kirea\AppData\Local\Temp\tmpznp9s5wy.json --symbols-only
1> "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64\8.0.0-preview.5.23275.2\tools\bin\wasm-ld.exe" -o C:\Users\kirea\source\repos\fastreport_net2\Tools\DebugApps\BlazorAppWasm8\obj\Debug\net8.0\wasm\for-build\dotnet.native.wasm C:\Users\kirea\.nuget\packages\harfbuzzsharp.nativeassets.webassembly\2.8.2.4-preview.72\buildTransitive\netstandard1.0\..\..\build\netstandard1.0\libHarfBuzzSharp.a\3.1.34\st\libHarfBuzzSharp.a C:\Users\kirea\.nuget\packages\skiasharp.nativeassets.webassembly\2.88.4-preview.72\buildTransitive\netstandard1.0\..\..\build\netstandard1.0\libSkiaSharp.a\3.1.34\st\libSkiaSharp.a C:\Users\kirea\source\repos\fastreport_net2\Tools\DebugApps\BlazorAppWasm8\obj\Debug\net8.0\wasm\for-build\pinvoke.o C:\Users\kirea\source\repos\fastreport_net2\Tools\DebugApps\BlazorAppWasm8\obj\Debug\net8.0\wasm\for-build\driver.o C:\Users\kirea\source\repos\fastreport_net2\Tools\DebugApps\BlazorAppWasm8\obj\Debug\net8.0\wasm\for-build\corebindings.o "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libicudata.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libicui18n.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libicuuc.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-component-debugger-static.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-component-diagnostics_tracing-stub-static.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-component-hot_reload-static.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-component-marshal-ilgen-static.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-ee-interp.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-icall-table.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-profiler-aot.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-profiler-browser.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmono-wasm-eh-wasm.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libmonosgen-2.0.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libSystem.Globalization.Native.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libSystem.IO.Compression.Native.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\libSystem.Native.a" "C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\wasm-bundled-timezones.a" "-LC:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.win-x64\8.0.0-preview.5.23275.2\tools\emscripten\cache\sysroot\lib\wasm32-emscripten" -lGL -lal -lhtml5 -lstubs-debug -lnoexit -lc-debug -ldlmalloc -lcompiler_rt-wasm-sjlj -lc++-except -lc++abi-debug-except -lunwind-except -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -wasm-enable-sjlj -mllvm -disable-lsr -mllvm -wasm-enable-eh -mllvm -exception-model=wasm --allow-undefined-file=C:\Users\kirea\AppData\Local\Temp\tmp_r9qv8uf.undefined --export-if-defined=malloc --export-if-defined=memalign --export-if-defined=htons --export-if-defined=ntohs --export-if-defined=fmod --export-if-defined=atan2 --export-if-defined=fma --export-if-defined=pow --export-if-defined=fmodf --export-if-defined=atan2f --export-if-defined=fmaf --export-if-defined=powf --export-if-defined=asin --export-if-defined=asinh --export-if-defined=acos --export-if-defined=acosh --export-if-defined=atan --export-if-defined=atanh --export-if-defined=cbrt --export-if-defined=cos --export-if-defined=cosh --export-if-defined=exp --export-if-defined=log --export-if-defined=log2 --export-if-defined=log10 --export-if-defined=sin --export-if-defined=sinh --export-if-defined=tan --export-if-defined=tanh --export-if-defined=asinf --export-if-defined=asinhf --export-if-defined=acosf --export-if-defined=acoshf --export-if-defined=atanf --export-if-defined=atanhf --export-if-defined=cbrtf --export-if-defined=cosf --export-if-defined=coshf --export-if-defined=expf --export-if-defined=logf --export-if-defined=log2f --export-if-defined=log10f --export-if-defined=sinf --export-if-defined=sinhf --export-if-defined=tanf --export-if-defined=tanhf --export-if-defined=memset --export-if-defined=stackSave --export-if-defined=stackRestore --export-if-defined=stackAlloc --export-if-defined=free --export-if-defined=__get_exception_message --export-if-defined=__cpp_exception --export-if-defined=__cxa_increment_exception_refcount --export-if-defined=__cxa_decrement_exception_refcount --export-if-defined=__thrown_object_from_unwind_exception --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=fflush --export=emscripten_stack_get_end --export=emscripten_stack_get_free --export=emscripten_stack_get_base --export=emscripten_stack_get_current --export=emscripten_stack_init --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=malloc --export=free --export=__trap --export=__wasm_call_ctors --export=emscripten_builtin_memalign --export=__dl_seterr --export=saveSetjmp --export=setThrew --export=htonl --export=htons --export=ntohs --export-table --growable-table -z stack-size=5242880 --initial-memory=26279936 --no-entry --max-memory=2147483648 --stack-first
1> "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Node.win-x64\8.0.0-preview.5.23275.2\tools\bin\node.exe" "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64\8.0.0-preview.5.23275.2\tools\emscripten\src\compiler.js" C:\Users\kirea\AppData\Local\Temp\tmpa26g2pq4.json
1>EXEC : error : undefined symbol: emscripten_longjmp (referenced by top-level compiled C/C++ code)
1>EXEC : warning : To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
1>EXEC : warning : _emscripten_longjmp may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
1>EXEC : error : Aborting compilation due to previous errors
1>emcc : error : '"C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Node.win-x64\8.0.0-preview.5.23275.2\tools\bin\node.exe" "C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64\8.0.0-preview.5.23275.2\tools\emscripten\src\compiler.js" C:\Users\kirea\AppData\Local\Temp\tmpa26g2pq4.json' failed (returned 1)
1>C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.0-preview.5.23280.8\Sdk\WasmApp.Native.targets(476,5): error MSB3073: The command "emcc "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\src\emcc-default.rsp" "@C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.Mono.browser-wasm\8.0.0-preview.5.23280.8\runtimes\browser-wasm\native\src\emcc-link.rsp" "@C:\Users\kirea\source\repos\fastreport_net2\Tools\DebugApps\BlazorAppWasm8\obj\Debug\net8.0\wasm\for-build\emcc-link.rsp"" exited with code 1.
1>Done building project "BlazorAppWasm8.csproj" -- FAILED.

@jeromelaban jeromelaban marked this pull request as ready for review June 17, 2023 23:12
@jeromelaban
Copy link
Contributor Author

@KirillKornienko I've been able to build and run using this PR's packages using net8's Uno Platform bootstrapper, could you try with blazor net8 and let me know if it works for you?

@KirillKornienko
Copy link

KirillKornienko commented Jun 18, 2023

@KirillKornienko I've been able to build and run using this PR's packages using net8's Uno Platform bootstrapper, could you try with blazor net8 and let me know if it works for you?

Sure, where can I find the artifacts, attached to this PR? On https://dev.azure.com/xamarin/public/_artifacts/feed/SkiaSharp I see only -preview72 version, which isn't the latest version.

@jeromelaban
Copy link
Contributor Author

@KirillKornienko you can find the nuget packages in the Artifacts section of the build, here. Make sure to use the versions with pr in it.

@KirillKornienko
Copy link

@KirillKornienko you can find the nuget packages in the Artifacts section of the build, here. Make sure to use the versions with pr in it.

Yes, everything is good, thanks!

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

Successfully merging this pull request may close these issues.

[BUG] NET8 Preview5 Wasm + SkiaSharp 2.88.4 build errors
3 participants