-
Notifications
You must be signed in to change notification settings - Fork 520
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
[introspection][dotnet] Enable LegacyAttributes test #11055
Comments
…te` (#10580) This moves our current/legacy attributes to the ones added in dotnet 5 [1]. Short Forms (only in bindings) | Old | New | |---------------------------------------|-------------------------------------| | [iOS (7,0)] | [SupportedOSPlatform ("ios7.0")] | | [NoIOS] | [UnsupportedOSPlatform ("ios")] | Long Forms | Old | New | |---------------------------------------|-------------------------------------| | [Introduced (PlatformName.iOS, 7,0)] | [SupportedOSPlatform ("ios7.0")] | | [Obsoleted (PlatformName.iOS, 12,1)] | [Obsolete (...)] | | [Deprecated (PlatformName.iOS, 14,3)] | [UnsupportedOSPlatform ("ios14.3")] | | [Unavailable (PlatformName.iOS)] | [UnsupportedOSPlatform ("ios")] | Other changes * `[SupportedOSPlatform]` and `[UnsupportedOSPlatform]` are not allowed on `interface` [2] which means they cannot be used for protocols. This is currently handled by inlining the existing attributes on all members. * `[ObsoletedInOSPlatform]` was removed in net5 RC. This PR is now mapping the existing attributes to `[Obsolote]`, however multiple ones cannot be added so they need to be platform specific. Remaining work (manual bindings update) tracked in #11055 References * [1] #10170 * [2] dotnet/runtime#47599 * [3] dotnet/runtime#47601
Update MacCatalyst: LegacyAttributes: 1111 API with mixed legacy availability attributes The intersection between them would be quite high. Mac introspection for dotnet is not yet part of xharness |
I wonder if we could rewrite the old availability attributes with a C# source generator? |
Maybe ? 🤔 I had a look a while ago, IIRC... Generating the new attributes was not the problem - at least with C#9, where most restrictions were removed on partial methods, but still missing on a few things
Removing the old/existing attributes is... but the linker can remove them. However it makes testing missing attributes more difficult for introspection. |
This was fixed here: e16d8fe |
A new test is being added, but disabled, inside PR#10580. It detects the use of the old, legacy, availability attributes. Those should not be used inside the platform assemblies shipping for dotnet.
However this requires large changes in most manual [1] binding files and is better done in several, distinct PRs.
Once the conversion is complete then the test needs to be enabled to avoid regressions.
https://github.com/xamarin/xamarin-macios/pull/10580/files#diff-0f2fc77f14b962b0c7827112e11d4af3917f549422a5504f311356a0daeaf301R394
The test-side conversion also needs to be removed from
tests/common/PlatformInfo.cs
https://github.com/xamarin/xamarin-macios/pull/10580/files#diff-3070012c3058ef2b1ff75465e1394c3c3a03eddeaddc34e8ac35c92e2920383eR147
[1] the generator handles the conversion to the new dotnet attributes
The text was updated successfully, but these errors were encountered: