-
Notifications
You must be signed in to change notification settings - Fork 508
Avalonia 0.9.0 With Corert Takes forever to Compile! #7920
Comments
It is possible, that they've started using a problematic (recursive) generic type / method. |
Here is how you can diagnose the recursive generics:
If it is a recursive generic instantiation, you should be able to see the methods that are involved in the recursive cycle. |
i think it's something to do with Avalonia.ReactiveUI Library I keep seeing [System.Reactive]
IDK what to do next :/ here's the sample I'm working on with the RD.xml https://github.com/Shadow4walker/AVCoret.git |
Does it work without |
IDK about System.Reactive it self , but Avalonia uses their own Fork 'or somthing!' for the ReactiveUI https://reactiveui.net/docs/getting-started/installation/avalonia and in previous released of Avalonia the Avalonia.ReactiveUI Lib is working with CoreRT without any issues! |
Here is how the infinite recursion happens:
This problem was introduce by https://github.com/dotnet/reactive/pull/500/files#diff-8e3d6e5fc08a3627f0d55495e5559ac9L100 . This change saved a few allocations by introducing much worse code bloat problems. It is likely that the code bloat problems have much worse negative effect on performance than the few allocations even without full AOT. |
The infinitive generics recursion interacts poorly with AOT. The AOT compilers have hard figuring out where the stop generating the code for generics with infinite recursion. They either fail or produce large images by giving up once the generics get too complex. This change reverts a small part of dotnet#500 that introduced infinite generic recusion and adds comment. Fixes dotnet/corert#7920
The infinitive generics recursion interacts poorly with AOT. The AOT compilers have hard figuring out where the stop generating the code for generics with infinite recursion. They either fail or produce large images by giving up once the generics get too complex. This change reverts a small part of dotnet#500 that introduced infinite generic recursion and adds comment. Fixes dotnet/corert#7920
I have submitted dotnet/reactive#1116 to System.Reactive to fix the infinite recursion. I have verified that your sample compiles successfully with this fix. |
The infinitive generics recursion interacts poorly with AOT. The AOT compilers have hard figuring out where the stop generating the code for generics with infinite recursion. They either fail or produce large images by giving up once the generics get too complex. This change reverts a small part of #500 that introduced infinite generic recursion and adds comment. Fixes dotnet/corert#7920
The infinitive generics recursion interacts poorly with AOT. The AOT compilers have hard figuring out where the stop generating the code for generics with infinite recursion. They either fail or produce large images by giving up once the generics get too complex. This change reverts a small part of #500 that introduced infinite generic recursion and adds comment. Fixes dotnet/corert#7920
Thank you!!! |
@jkotas
|
|
Opened a PR to (hopefully) fix it: dotnet/reactive#1121 |
@PJB3005 @jkotas
But I don't know how to fix it.... |
Even if we untangle the generic recursion, the It's likely this code is only getting pulled into the app because the compiler by default tries to compile all code to ensure reflection will work if someone tries to access anything dynamically. Try adding |
@MichalStrehovsky |
Yeah, you'll have to specify those dependencies in an RD.XML file now. This file might be a good starting point: https://github.com/wieslawsoltes/Draw2D/blob/863cbd0d1d2bb9c573f379124887937a2115a4d2/src/Draw2D/Draw2D.rd.xml (The line with "Avalonia.Themes.Default" would fix the exception you're seeing.) You add it to your project like this: |
Thanks. Issues with loading assemblies were gone, but failed with loading native libraries:
|
Did you try copying the DLL to where the EXE is? |
Thanks! After copying native dll to output directory, all issues were gone. |
I managed to get the way to fix the infinite recursive generics in System.Reactive and sent a PR. It will be fixed via dotnet/reactive#1177. After this PR merged, although |
@MichalStrehovsky
obj/Debug/netcoreapp3.1/win-x64/native/link.rsp:
|
Can you try if adding this to an ItemGroup in your project resolves the linking issue? <NativeLibrary Include="runtimeobject.lib" /> |
Thank you, the linking issue got resolved after adding |
I'm using Corert with 'Avalonia latest Released Build' and all were good till V0.9.0 Now my app Takes so much Time To Compile 'I had to Give Up after more than 2 Hours' and this was an issue with every Avalonia Nightly Build and Now I'm Facing it with he latest Released 0.9.0 the 0.8.3 and before was all good!!
The text was updated successfully, but these errors were encountered: