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

Xplat web publish: initial memory too small #103

Closed
bertt opened this issue Aug 22, 2022 · 4 comments · Fixed by #106
Closed

Xplat web publish: initial memory too small #103

bertt opened this issue Aug 22, 2022 · 4 comments · Fixed by #106

Comments

@bertt
Copy link

bertt commented Aug 22, 2022

Hi, I'm trying to dotnet publish an Avalonia xplat web project, but get an error in the 'Linking with emcc' step: 'wasm-ld : error : initial memory too small, 23789552 bytes needed'. I see it on Mac and Windows.

To reproduce:

$ dotnet new avalonia.xplat
$ cd avaloniatest.Web 
$ dotnet publish -c Release 

Result:

....
  [87/87] Avalonia.Base.dll.bc -> Avalonia.Base.dll.o [took 306,710s]
  Linking with emcc. This may take a while ...
   "/usr/local/share/dotnet/x64/packs/Microsoft.NET.Runtime.Emscripten.2.0.23.Sdk.osx-x64/6.0.4/tools/bin/wasm-ld" @/var/folders/rp/my1ll3l50yv_5tq707x3q4f00000gn/T/emscripten_vw689brm.rsp
wasm-ld : error : initial memory too small, 23789552 bytes needed 

BTW I'm using AvaloniaVersion: 11.0.0-preview1, workload wasm-tools is installed . Is there a way to get publish working with xplat web project?

@bertt bertt added the bug label Aug 22, 2022
@bertt
Copy link
Author

bertt commented Aug 22, 2022

fixed it by adding EmccTotalMemory to csproj file

<PropertyGroup>
 <EmccTotalMemory>134217728</EmccTotalMemory>
</PropertyGroup>

AvaloniaUI/Avalonia#7396

@bertt bertt closed this as completed Aug 22, 2022
@maxkatz6 maxkatz6 transferred this issue from AvaloniaUI/Avalonia Aug 22, 2022
@maxkatz6 maxkatz6 reopened this Aug 22, 2022
@maxkatz6
Copy link
Member

Default memory should be increased in the template as it seems

@maxkatz6 maxkatz6 removed the bug label Aug 22, 2022
@bertt
Copy link
Author

bertt commented Aug 22, 2022

Note: with setting EmccTotalMemory=134217728 the process got a bit further, but it seems stuck on line 'Compiling assembly bitcode files...' after many hours...

@bertt
Copy link
Author

bertt commented Aug 22, 2022

oh now it got through quite quick after running the second time...

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 a pull request may close this issue.

2 participants