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

Fix test issues discovered from enabling AOT for authoring scenarios #1432

Conversation

manodasanW
Copy link
Member

Enabling AOT for authoring scenarios discovered some scenarios that weren't handled. This addresses most of them with one test failure remaining that I am still working on.

  • As part of CsWinRT's C# collection support, CsWinRT implements the ABI interfaces for these types such as IVector and IVectorView. As part of those implementation, some of those functions return managed objects for which we need to generate a vtable. Some of these are generic objects which this PR handles by making sure those types are on the lookup table if one of the collection types that returns it is used as we do not know which function is going to be called from the native side.
  • Fixes the IsWinRTType check to also handle types from authoring scenarios
  • Fix a bunch of custom mapped value types that were missing the WinRTExposedType attribute.
  • Fix IID optimizer which I found was generating the wrong guid for generics of custom mapped types which the WinRTExposedType attribute was added for.
  • Fix the GuidSignature in the WinRTRuntimeTypeAttribute not being used for authoring types.
  • Fix issue when adding to an event handler from native side due to GetMetadataToken doesn't work on AOT by replacing with GetHashCode as we were only using it get a unique value for the type to use as part of a token.
  • Add partial for types that are returned as part of the AsAsync functions so that the AOT source generator can run on them.
  • Fix issue where the AOT source generator was not running for authoring scenarios and thereby any internal types in them were not getting the WinRTExposedType attribute generated for them or the lookup table. Public types worked before as they were handled by the authoring source generator itself.
  • Fix issue where the Do_ABI functions in authoring scenarios can have generic types passed as parameters to them and those generic instantiation classes are not initialized. This addresses it by making sure the EnsureInitialized is called for them.

Sergio0694 and others added 30 commits November 30, 2023 23:17
@manodasanW manodasanW requested a review from Sergio0694 January 9, 2024 03:46
Copy link
Member

@Sergio0694 Sergio0694 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a couple notes, love this! Thank you! 😄

@manodasanW manodasanW merged commit 9fea72b into user/sergiopedri/naot-winrt-exports Jan 9, 2024
1 of 8 checks passed
@manodasanW manodasanW deleted the manodasanw/naot-winrt-exports-authoringtestfixes2 branch January 9, 2024 19:49
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

Successfully merging this pull request may close these issues.

2 participants