dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.18k stars 4.72k forks source link

Blazor WebAssembly AOT condition `table_size < 65000' not met #85917

Closed SeanLeitzinger closed 1 year ago

SeanLeitzinger commented 1 year ago

Is there an existing issue for this?

Describe the bug

When publishing a Blazor wasm app on .NET 7 using AOT the following error is encountered:

Precompiling failed for obj\Release\net7.0\linked\Microsoft.Graph.dll with exit code -1073740791. Mono Ahead of Time compiler - compiling assembly obj\Release\net7.0\linked\Microsoft.Graph.dll

Expected Behavior

App should compile successfully. The issue did not exist on .NET 6. All nuget packages are latest version.

Steps To Reproduce

Compile a Blazor WebAssembly project with Microsoft Graph on .NET 7.

Exceptions (if any)

No response

.NET Version

7.0.203

Anything else?

Visual Studio 17.5.5

.NET SDK:
 Version:   7.0.203
 Commit:    5b005c19f5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22621
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.203\

Host:
  Version:      7.0.5
  Architecture: x64
  Commit:       8042d61b17

.NET SDKs installed:
  7.0.203 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

`

<PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <Nullable>disable</Nullable>
    <PublishTrimmed>true</PublishTrimmed>
    <UseBlazorWebAssembly>true</UseBlazorWebAssembly>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
  <RunAOTCompilation>False</RunAOTCompilation>
  <NoWarn>1701;1702;BL0005;BL0007;</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
  <RunAOTCompilation>True</RunAOTCompilation>
  <NoWarn>1701;1702;BL0005;BL0007;</NoWarn>
</PropertyGroup>

<ItemGroup>
  <None Include="wwwroot\app.css" />
</ItemGroup>

<ItemGroup>
    <PackageReference Include="Blazored.LocalStorage" Version="4.3.0" />
    <PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="6.4.12" />
    <PackageReference Include="Enums.NET" Version="4.0.1" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.5" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.5" PrivateAssets="all" />
    <PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.5" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
    <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
    <PackageReference Include="Microsoft.Graph" Version="5.9.0" />
    <PackageReference Include="MudBlazor" Version="6.2.3" />
    <PackageReference Include="System.Net.Http.Json" Version="7.0.1" />
    <PackageReference Include="TinyMCE.Blazor" Version="1.0.4" />
</ItemGroup>
<ItemGroup>
    <TrimmerRootAssembly Include="Microsoft.Authentication.WebAssembly.Msal" />
</ItemGroup>
<ItemGroup>
    <ProjectReference Include="..\EdgesideSystems.Application\EdgesideSystems.Application.csproj" />
    <ProjectReference Include="..\EdgesideSystems.Core\EdgesideSystems.Core.csproj" />
</ItemGroup>
<ItemGroup>
  <Content Update="wwwroot\decode.min.js">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
</ItemGroup>

`

ghost commented 1 year ago

Tagging subscribers to 'arch-wasm': @lewing See info in area-owners.md if you want to be subscribed.

Issue Details
### Is there an existing issue for this? - [X] I have searched the existing issues ### Describe the bug When publishing a Blazor wasm app on .NET 7 using AOT the following error is encountered: Precompiling failed for obj\Release\net7.0\linked\Microsoft.Graph.dll with exit code -1073740791. Mono Ahead of Time compiler - compiling assembly obj\Release\net7.0\linked\Microsoft.Graph.dll * Assertion at D:\a\_work\1\s\src\mono\mono\mini\aot-compiler.c:11219, condition `table_size < 65000' not met ### Expected Behavior App should compile successfully. The issue did not exist on .NET 6. All nuget packages are latest version. ### Steps To Reproduce Compile a Blazor WebAssembly project with Microsoft Graph on .NET 7. ### Exceptions (if any) _No response_ ### .NET Version 7.0.203 ### Anything else? Visual Studio 17.5.5 ``` .NET SDK: Version: 7.0.203 Commit: 5b005c19f5 Runtime Environment: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.203\ Host: Version: 7.0.5 Architecture: x64 Commit: 8042d61b17 .NET SDKs installed: 7.0.203 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found ``` ` net7.0 disable true true False 1701;1702;BL0005;BL0007; True 1701;1702;BL0005;BL0007; PreserveNewest `
Author: SeanLeitzinger
Assignees: -
Labels: `arch-wasm`, `untriaged`, `area-Codegen-AOT-mono`, `needs-area-label`
Milestone: -
radical commented 1 year ago

cc @vargaz

lewing commented 1 year ago

looks like https://github.com/dotnet/runtime/issues/81271

vargaz commented 1 year ago

This is fixable, but having 65k AOTed methods will probably mean that both compile times and executable sizes will be unacceptable.