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

[NET Attribute Conversion] Rerun with fixes to catch old/unlisted availability and type information. Enable one test. #14287

Closed

Conversation

chamons
Copy link
Contributor

@chamons chamons commented Mar 1, 2022

A few mel commits of note include:

Technically many of these attributes on types are not strictly required, as the generator (after another change post this) will generate a copy. However, there are some cases where it was required, and overall the team in discusses liked this as it removed an very non-obvious footgun inherit in the NET6 attribute behavior:

  • Adding a single attribute, such as a new platform, would remove it from all other platforms if you neglected to copy down from parent or generated code the platforms it is on. This is because NET6's rule "if any attributes exist, assume those are the only ones in existence, don't look elsewhere".

Buckle up, this PR is large.

Things to look for (Mistakes I've made in other places here and caught):

  • Attributes on internal classes
  • Attributes on items behind !NET6 attributes
  • Unnecessary whitespace diffs
  • Attributes combinations that are questionable

@chamons chamons added the not-notes-worthy Ignore for release notes label Mar 1, 2022
@chamons chamons added the run-dotnet-tests Run all the .NET tests label Mar 1, 2022
@chamons chamons changed the title Attribute super convert type mass smash 2 [NET Attribute Conversion] Rerun with fixes to catch old/unlisted availability and type information. Enable one test. Mar 1, 2022
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API Current PR diff

ℹ️ API Diff (from PR only) (please review changes)

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff
  • ⚠️ Generator diff comments have not been provided.

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

54 tests failed, 92 tests passed.

Failed tests

  • introspection/Mac [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 37 Passed: 34 Inconclusive: 0 Failed: 1 Ignored: 2)
  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 44 Passed: 41 Inconclusive: 0 Failed: 1 Ignored: 2)
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • introspection/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • monotouch-test/Mac [dotnet]/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Debug [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Debug (LinkSdk) [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: BuildFailure
  • monotouch-test/tvOS - simulator/Release (all optimizations) [dotnet]: BuildFailure
  • link sdk/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • link sdk/Mac [dotnet]/Release [dotnet]: BuildFailure
  • link sdk/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • link sdk/Mac Catalyst [dotnet]/Release [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link sdk/tvOS - simulator/Debug [dotnet]: BuildFailure
  • link sdk/tvOS - simulator/Release [dotnet]: BuildFailure
  • link all/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • link all/Mac [dotnet]/Release [dotnet]: BuildFailure
  • link all/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • link all/Mac Catalyst [dotnet]/Release [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • link all/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • link all/tvOS - simulator/Debug [dotnet]: BuildFailure
  • link all/tvOS - simulator/Release [dotnet]: BuildFailure
  • trimmode link/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • trimmode link/Mac [dotnet]/Release [dotnet]: BuildFailure
  • trimmode link/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • trimmode link/Mac Catalyst [dotnet]/Release [dotnet]: BuildFailure
  • trimmode link/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • trimmode link/iOS Unified 64-bits - simulator/Release [dotnet]: BuildFailure
  • trimmode link/tvOS - simulator/Debug [dotnet]: BuildFailure
  • trimmode link/tvOS - simulator/Release [dotnet]: BuildFailure
  • framework-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • framework-test/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • framework-test/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • framework-test/tvOS - simulator/Debug [dotnet]: BuildFailure
  • interdependent-binding-projects/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • interdependent-binding-projects/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • interdependent-binding-projects/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • interdependent-binding-projects/tvOS - simulator/Debug [dotnet]: BuildFailure
  • xcframework-test/Mac [dotnet]/Debug [dotnet]: BuildFailure
  • xcframework-test/Mac Catalyst [dotnet]/Debug [dotnet]: BuildFailure
  • xcframework-test/iOS Unified 64-bits - simulator/Debug [dotnet]: BuildFailure
  • xcframework-test/tvOS - simulator/Debug [dotnet]: BuildFailure
  • Xtro/.NET: Failed (Test run failed.)
  • MSBuild tests/Integration: Failed (Execution failed with exit code 2)
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1098.BigSur'
Merge 5d06b66 into 069d34b

@@ -29,15 +29,6 @@
!missing-release-attribute-on-return-value! ModelIO.IMDLMeshBufferZone ModelIO.MDLMeshBufferAllocatorWrapper::CreateZone(System.UIntPtr)'s selector's ('newZone:') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required.
!missing-release-attribute-on-return-value! ModelIO.IMDLMeshBufferZone ModelIO.MDLMeshBufferDataAllocator::CreateZone(Foundation.NSNumber[],Foundation.NSNumber[])'s selector's ('newZoneForBuffersWithSize:andType:') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required.
!missing-release-attribute-on-return-value! ModelIO.IMDLMeshBufferZone ModelIO.MDLMeshBufferDataAllocator::CreateZone(System.UIntPtr)'s selector's ('newZone:') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required.
!missing-release-attribute-on-return-value! ModelIO.MDLMesh ModelIO.MDLMesh::CreateCapsule(System.Single,System.Numerics.Vector2,System.UIntPtr,System.UIntPtr,System.UIntPtr,ModelIO.MDLGeometryType,System.Boolean,ModelIO.IMDLMeshBufferAllocator)'s selector's ('newCapsuleWithHeight:radii:radialSegments:verticalSegments:hemisphereSegments:geometryType:inwardNormals:allocator:') Objective-C method family ('new') indicates that the native method returns a retained object, and as such a '[return: Release]' attribute is required.
Copy link
Member

Choose a reason for hiding this comment

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

This looks fishy, I don't see why adding availability attributes would cause xtro to stop complaining like this (the other !extra-enum-value! removals in other files make sense, but not these)

Comment on lines 6 to 13

#if NET
[SupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("macos10.14")]
#if MONOMAC
[Obsolete ("Starting with macos10.14 no longer supported.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't the generated part of this partial class have these attributes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a question about this specific instance or the PR in general?

Right now, the generated code only has:

	[Register("WebFrame", true)]
	[UnsupportedOSPlatform ("macos10.14")]
	public unsafe partial class WebFrame : NSObject {

but it should match this when I finish the generator PR.

Part of my question on Teams (that I referenced in the description) was if we should "duplicate" attributes on partial class definitions.

Copy link
Member

Choose a reason for hiding this comment

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

Is this a question about this specific instance or the PR in general?

In general

Part of my question on Teams (that I referenced in the description) was if we should "duplicate" attributes on partial class definitions.

I misunderstood then, having two sources of truth (the api definition and the manual code), sounds like it'll diverge at some point, and cause problems.

In any case, the point is somewhat moot, because for this particular case once you fix the generator, you'll generate an Obsolete attribute, which means there will be two Obsolete attributes on the type, which is not allowed:

error CS0579: Duplicate 'Obsolete' attribute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, that changes things. I'll come up with a plan after lunch, likely just reverting commits by hand this one time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a local patch that removes all changes on public partial classes building locally.

Thanks patch iron and past-me for writing it to make this an hour-ish job instead of many hours.

@dalexsoto
Copy link
Member

I had to download it because Safari freaked out heh, and won't let me even approve it but other than what Rolf mentioned above is looking good to me.

@chamons chamons marked this pull request as draft March 2, 2022 15:52
@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API Current PR diff

ℹ️ API Diff (from PR only) (please review changes)

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff
  • ⚠️ Generator diff comments have not been provided.

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

5 tests failed, 141 tests passed.

Failed tests

  • introspection/Mac [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 37 Passed: 34 Inconclusive: 0 Failed: 1 Ignored: 2)
  • introspection/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 44 Passed: 41 Inconclusive: 0 Failed: 1 Ignored: 2)
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • introspection/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 2710 Passed: 2515 Inconclusive: 13 Failed: 1 Ignored: 194)

Pipeline on Agent XAMBOT-1100.BigSur'
Merge a47fc13 into b097770

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API Current PR diff

ℹ️ API Diff (from PR only) (please review changes)

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff
  • ⚠️ Generator diff comments have not been provided.

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

5 tests failed, 141 tests passed.

Failed tests

  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • introspection/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (LinkSdk): TimedOut
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Crashed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Crashed

Pipeline on Agent XAMBOT-1094.BigSur'
Merge 8f02430 into 3cce274

@chamons
Copy link
Contributor Author

chamons commented Mar 10, 2022

The second new test (test #4) is being punted to the generator PR. It's written, but fails to a number of things that I think are fixed there.

@chamons chamons marked this pull request as ready for review March 10, 2022 20:08
Copy link
Member

@rolfbjarne rolfbjarne left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

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

Phew, this was long. Great job @chamons ❤️

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API Current PR diff

ℹ️ API Diff (from PR only) (please review changes)

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff
  • ⚠️ Generator diff comments have not been provided.

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

🎉 All 146 tests passed 🎉

Pipeline on Agent XAMBOT-1108.Monterey'
Merge 669494c into 45dca51

@chamons
Copy link
Contributor Author

chamons commented Mar 11, 2022

This work looks ready to go in, however we're going to wait for a merge against main and possible fixes from @mandel-macaque since the test changes yesterday likely destabilized all of the cecil tests.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on VSTS: simulator tests iOS (no summary found). 🔥

Result file D:\a\1\s\Reports\TestSummary-simulator\TestSummary.md not found.

Pipeline on Agent
Merge bd872e5 into d61f187

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on VSTS: simulator tests iOS (no summary found). 🔥

Result file D:\a\1\s\Reports\TestSummary-simulator\TestSummary.md not found.

Pipeline on Agent
Merge f32651c into 1fd2e8e

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on macOS Mac Catalina (10.15) ❌

Tests failed on Mac Catalina (10.15).

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent
Merge 1c36da1 into 2586aa1

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

21 tests failed, 125 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug (static registrar) [dotnet]: Failed (Test run crashed (exit code: 139).
    Test run crashed)
  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk): Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations): Failed
  • monotouch-test/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug: Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (LinkSdk): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Failed
  • Xtro/.NET: BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 19)

Pipeline on Agent XAMBOT-1103.Monterey
Merge 1c36da1 into 2586aa1

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on macOS M1 - Mac Big Sur (11.5) ❌

Tests failed on M1 - Mac Big Sur (11.5).

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent
Merge 92e446d into c055c10

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on macOS Mac Catalina (10.15) ❌

Tests failed on Mac Catalina (10.15).

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent
Merge 92e446d into c055c10

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

3 tests failed, 143 tests passed.

Failed tests

  • link all/Mac [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 87 Passed: 75 Inconclusive: 0 Failed: 1 Ignored: 11)
  • Xtro/.NET: BuildFailure
  • MSBuild tests/Integration: Failed (Execution failed with exit code 19)

Pipeline on Agent XAMBOT-1107.Monterey
Merge 92e446d into c055c10

@chamons
Copy link
Contributor Author

chamons commented Mar 15, 2022

Still trying to get a clean build. The 3 test failures look unrelated.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ Tests failed on macOS Mac Catalina (10.15) ❌

Tests failed on Mac Catalina (10.15).

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent
Merge 7c3f397 into b859c6d

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

1 tests failed, 145 tests passed.

Failed tests

  • Xtro/.NET: BuildFailure

Pipeline on Agent XAMBOT-1109.Monterey'
Merge 7c3f397 into b859c6d

@chamons
Copy link
Contributor Author

chamons commented Apr 5, 2022

It's been a month since this started, and there were a bunch of conflicts now.

I'm going to push a new 3rd try in a few minutes....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-notes-worthy Ignore for release notes run-dotnet-tests Run all the .NET tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants