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

[v2.1.1] Compile error in .NET6 iOS AOT builds #516

Closed
tipa opened this issue Sep 14, 2022 · 9 comments
Closed

[v2.1.1] Compile error in .NET6 iOS AOT builds #516

tipa opened this issue Sep 14, 2022 · 9 comments

Comments

@tipa
Copy link

tipa commented Sep 14, 2022

Both the version 2.1.1 and the 2.1.2-preview of SQLitePCLRaw.bundle_green cause compile errors in a .NET iOS app.
Example project: test.zip

Simply navigate to the folder and run dotnet publish -c Release

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.4.447/targets/Xamarin.Shared.Sdk.targets(1000,3): error : Failed to AOT compile SQLitePCLRaw.provider.sqlite3.dll, the AOT compiler exited with code 134 [/Users/.../test.csproj]

Downgrading to 2.1.0 resolves the problem

@ericsink
Copy link
Owner

I'm away from my Mac. I'm curious. Can you try using bundle_e_sqlite3 instead of bundle_green? Does it show the same problem?

@tipa
Copy link
Author

tipa commented Sep 14, 2022

Changing it to SQLitePCLRaw.bundle_e_sqlite3 still errors out, but with a slightly different error:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.4.447/targets/Xamarin.Shared.Sdk.targets(1000,3): error : Failed to AOT compile SQLitePCLRaw.provider.internal.dll, the AOT compiler exited with code 134 [/Users/.../test.csproj]

@ericsink
Copy link
Owner

OK. Thanks. I'll take a closer look as soon as I get a chance.

@ericsink
Copy link
Owner

Confirming: I can reproduce this. It happens for 2.1.1, but not for 2.1.0. Unfortunately, the error message is exceedingly unhelpful.

@filipnavara The only change between 2.1.0 and 2.1.1 that looks remotely relevant here is your changes for the calling convention of unmanaged function pointers, in #507 -- any idea how that could be causing the AOT failure seen here? Are you able to do AOT iOS builds with your code change?

@filipnavara
Copy link
Contributor

filipnavara commented Sep 15, 2022

any idea how that could be causing the AOT failure seen here? Are you able to do AOT iOS builds with your code change?

It could be a MonoVM bug. We should raise the issue on dotnet/runtime repo with a small self-contained repro. I won't be able to look into it until next week.

@ericsink
Copy link
Owner

I condensed the repro down to not need SQLitePCLRaw. It's basically a single function with an UnmanagedCallersOnly attribute that fails when CallConvs is provided. I posted that repro in a bug report to dotnet/runtime and linked to this issue as shown above.

ericsink added a commit that referenced this issue Sep 16, 2022
…ed to use on windows platforms, to avoid apparent iOS AOT bug mentioned in #516.
@ericsink ericsink mentioned this issue Sep 16, 2022
@ericsink
Copy link
Owner

I believe this is fixed in 2.1.2-pre20220916165053.

ericsink added a commit that referenced this issue Sep 16, 2022
…mplicated to serve as a repro for #516.  no luck.  calling sqlite3_log() multiple times still seems to work, even when disabling the CallingConvention fix.
@freever
Copy link

freever commented Sep 17, 2022

I can confirm this is fixed for me. I have a .NET Maui app for which the iOS builds started breaking once I upgraded SQLitePCLRaw to 2.1.1. Builds are working again with 2.1.2-pre20220916165053.

@ericsink
Copy link
Owner

Fixed in 2.1.2, which is now on nuget

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

No branches or pull requests

4 participants