-
Notifications
You must be signed in to change notification settings - Fork 519
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
Failed to AOT compile Microsoft.Graph.dll, the AOT compiler exited with code 134 #18388
Comments
I'm trying to work around this issue so that we can at least reach the AOT compilation error faster. Almost all of this 1 hour is spent in the The Microsoft.Graph.dll is only copied/skipped by the linker, but if I remove it from <ItemGroup>
<UnanalyzableAssembly Include="Microsoft.Graph" />
</ItemGroup>
<Target Name="ConfigureTrimming"
BeforeTargets="PrepareForILLink">
<ItemGroup>
<_UnanalyzableManagedAssemblyToLink Include="@(UnanalyzableAssembly)" NuGetPackageId="%(Identity)" />
<ManagedAssemblyToLink Remove="@(_UnanalyzableManagedAssemblyToLink)" MatchOnMetadata="NuGetPackageId" />
</ItemGroup>
</Target> However, in our project (not the sample project) doing so then causes the AOT compilation to fail on the app instead.
It looks like excluding an assembly from Edit:
I can add the <ItemGroup>
<UnanalyzableAssembly Include="Microsoft.Graph" />
</ItemGroup>
<Target Name="ConfigureLinkingWorkaround" BeforeTargets="PrepareForILLink">
<ItemGroup>
<UnanalyzableManagedAssemblyToLink Include="@(ManagedAssemblyToLink)" Condition="'%(ManagedAssemblyToLink.NuGetPackageId)' == '@(UnanalyzableAssembly)'" />
<ManagedAssemblyToLink Remove="@(UnanalyzableManagedAssemblyToLink)" />
</ItemGroup>
</Target>
<Target Name="ConfigureAOTCompilationWorkaround" BeforeTargets="ComputeFilesToPublish">
<ItemGroup>
<ManagedAssemblyToLink Include="@(UnanalyzableManagedAssemblyToLink)" />
</ItemGroup>
</Target> I'm struggling to follow the path from to the context to the declaration of the step to the use of the steps. (I'm on macOS so I'm not sure if the last one being 'Windows' means I've taken a wrong turn somewhere. |
I'm having the same issue and mtouchInterpreter does nothing |
The AOT compiler asserts:
which is from around here: https://github.com/dotnet/runtime/blob/release/7.0/src/mono/mono/mini/aot-compiler.c#L11219 |
I'm not sure if the resulting app works as expected, but asking the linker to trim Microsoft.Graph.dll makes the build succeed: <ItemGroup>
<TrimmableAssembly Include="Microsoft.Graph" />
</ItemGroup> |
For me CommunityToolkit.WinUI.UI.dll
Let me try your workaround @rolfbjarne |
Disabling LLVM makes the build noticeable faster: <PropertyGroup>
<MtouchUseLlvm>false</MtouchUseLlvm>
</PropertyGroup> @Soap-141 disabling llvm might also work around your crash |
@rolfbjarne You think it's a good idea to disable llvm? |
@Soap-141 there might be perf hit, but if you don't notice / don't care, then it won't be a problem |
@rolfbjarne I'll test it out to and compare it to UseInterpreter=true |
That's not what I see, although it takes a while for me too (~1m30s) - on a 6 years old iMac Pro. Not passing Microsoft.Graph.dll to the illinker is not a good idea, you're likely to run into a lot of weird issues. If it works, it's probably better to ask illink to trim Microsoft.Graph.dll (as I mentioned above). This means there are really two separate issues here:
|
I've filed:
Feel free to CC yourself on these issues to be updated. I'll also close this issue, since I don't think there's any other issue here relative to this repo. |
This worked thanks! |
@rolfbjarne, thanks for investigating. To summarize:
|
Steps to Reproduce
dotnet publish -c Release -f net7.0-ios16.1 -r ios-arm64
Expected Behavior
App is published.
Actual Behavior
If I use
<UseInterpreter>true</UseInterpreter>
, the build succeeds.Environment
Build Logs
msbuild_(6).zip
Example Project
https://github.com/microsoftgraph/msgraph-sample-maui
The text was updated successfully, but these errors were encountered: