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

Cannot AOT on Android, iOS and MacCatalyst #276

Open
Juriyx opened this issue Jul 29, 2024 · 11 comments
Open

Cannot AOT on Android, iOS and MacCatalyst #276

Juriyx opened this issue Jul 29, 2024 · 11 comments
Labels
bug Something isn't working upstream Issue is in an upstream dependency but still affects us

Comments

@Juriyx
Copy link

Juriyx commented Jul 29, 2024

Describe the bug

[FsToolkit.ErrorHandling.IcedTasks.dll] Exec (with response file contents expanded) in C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App: MONO_PATH=C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App\obj\Release\net8.0-android\android-x86\linked; MONO_ENV_OPTIONS= c:\program files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x86\8.0.5\Sdk\..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\net8.0-android\android-x86\aot\x86\FsToolkit.ErrorHandling.IcedTasks,profile-only,profile=c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\dotnet.aotprofile,mtriple=i686-linux-android,tool-prefix=c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\tools\binutils\bin\i686-linux-android-,outfile=obj\Release\net8.0-android\android-x86\aot\FsToolkit.ErrorHandling.IcedTasks.dll.so,temp-path=obj\Release\net8.0-android\android-x86\FsToolkit.ErrorHandling.IcedTasks.dll.tmp,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\net8.0-android\android-x86\linked\FsToolkit.ErrorHandling.IcedTasks.dll"
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Precompiling failed for C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App\obj\Release\net8.0-android\android-x86\linked\FsToolkit.ErrorHandling.IcedTasks.dll with exit code 1.
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Mono Ahead of Time compiler - compiling assembly C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App\obj\Release\net8.0-android\android-x86\linked\FsToolkit.ErrorHandling.IcedTasks.dll
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOTID BBBE58D8-93CA-B764-523F-676B69DC7019
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Using profile data file 'c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\dotnet.aotprofile'
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : TypeRef ResolutionScope not yet handled (10) for .CancellableTaskStateMachineData`1 in image C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App\obj\Release\net8.0-android\android-x86\linked\FsToolkit.ErrorHandling.IcedTasks.dll
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Failed to load method 0x600000c from 'C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App\obj\Release\net8.0-android\android-x86\linked\FsToolkit.ErrorHandling.IcedTasks.dll' due to Could not resolve type with token 0100000b from typeref (expected class 'CancellableTaskStateMachineData`1' in assembly '') assembly: type:CancellableTaskStateMachineData`1 member:(null).
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : Run with MONO_LOG_LEVEL=debug for more information.
1>c:\program files\dotnet\packs\Microsoft.Android.Sdk.Windows\34.0.52\targets\Microsoft.Android.Sdk.Aot.targets(109,5): error : AOT of image C:\Users\juriy\source\repos\eCierge\PropertyManagement\Console\App\obj\Release\net8.0-android\android-x86\linked\FsToolkit.ErrorHandling.IcedTasks.dll failed.

To Reproduce
Steps to reproduce the behavior:

  1. Create MAUI app.
  2. Install FsToolkit.ErrorHandling.IcedTasks library.
  3. Switch to "Release" configuration.
  4. Build.

Expected behavior
Builds successfully.

Desktop (please complete the following information):

  • OS: Windows 11
@TheAngryByrd TheAngryByrd added bug Something isn't working good first issue Good for newcomers labels Jul 30, 2024
@Juriyx Juriyx changed the title Cannot AOT on Android Cannot AOT on Android, iOS and MacCatalyst Aug 16, 2024
@Juriyx
Copy link
Author

Juriyx commented Aug 16, 2024

@TheAngryByrd Is there any workaround we can use to fix it at the moment?

@TheAngryByrd
Copy link
Collaborator

Not that I know of. I've never really used the AOT features in .NET.

@TheAngryByrd
Copy link
Collaborator

@vzarytovskii is this something the F# team has seen at all?

@xperiandri
Copy link

What steps would you propose? Should we provide you a minimum reproduction?

@vzarytovskii
Copy link

vzarytovskii commented Aug 16, 2024

@vzarytovskii is this something the F# team has seen at all?

Haven't seen, no, @vitek-karas @sbomer, what would be the easiest way of figuring out why does it fail to compile? State machines is highly generic code, so I assume something related to that?

@vitek-karas
Copy link

I can't repro this (tried on windows as mac). Could you please:

  • Create an issue in dotnet/runtime repo for this?
  • In the issue, if you can, share the repro project
  • Share the version of .NET you're using (dotnet --info)
  • Share the version of VS you're using
  • What target device you have set in VS when you build
  • If possible share a binlog of the build

@xperiandri
Copy link

@xperiandri
Copy link

/Users/runner/.dotnet/packs/Microsoft.MacCatalyst.Sdk/17.2.8053/targets/Xamarin.Shared.Sdk.targets(877,3): error : ILStrip failed for obj/Release/net8.0-maccatalyst/maccatalyst-arm64/linked/FsToolkit.ErrorHandling.dll: Must be of type CilStrip.Mono.Cecil.TypeReference

@vzarytovskii
Copy link

This needs to be over at dotnet/runtime (if it's not already).

@vitek-karas
Copy link

+1 - please create an issue in dotnet/runtime for this. Thank you!

@Juriyx
Copy link
Author

Juriyx commented Aug 28, 2024

Hello. I found it already exists:
dotnet/runtime#87867

@TheAngryByrd TheAngryByrd added upstream Issue is in an upstream dependency but still affects us and removed good first issue Good for newcomers labels Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Issue is in an upstream dependency but still affects us
Projects
None yet
Development

No branches or pull requests

5 participants