xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.49k stars 515 forks source link

[static registrar] Make sure to save any changes made by the managed static registrar. Fixes #21606. #21637

Closed rolfbjarne closed 1 week ago

rolfbjarne commented 1 week ago

If an assembly only required the lookup tables from the managed static registrar (and not any other code), we wouldn't save those changes.

This would lead to a runtime exception:

Microsoft.iOS: Processing Objective-C exception for exception marshalling (mode: 2):
Could not find the type 'ObjCRuntime.__Registrar__' in the assembly 'X.Y.Z'. (ObjCRuntime.RuntimeException)
   at ObjCRuntime.RegistrarHelper.GetMapEntry(String assemblyName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 105
   at ObjCRuntime.RegistrarHelper.GetMapEntry(Assembly assembly) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 93
   at ObjCRuntime.RegistrarHelper.LookupRegisteredType(Assembly assembly, UInt32 id) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/RegistrarHelper.cs:line 199
   at ObjCRuntime.Class.ResolveToken(Assembly assembly, Module module, UInt32 token) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Class.cs:line 521

The fix is to save the assembly if the managed static registrar added lookup tables to the assembly.

Fixes https://github.com/xamarin/xamarin-macios/issues/21606.

rolfbjarne commented 1 week ago

/sudo backport release/9.0.1xx

vs-mobiletools-engineering-service2 commented 1 week ago

Backport Job to branch release/9.0.1xx Created! The magic is happening here

vs-mobiletools-engineering-service2 commented 1 week ago

Hooray! Backport succeeded! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=10573963 for more details.

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Windows Integration Tests passed :computer:

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Tests on macOS M1 - Mac Monterey (12) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Tests on macOS M1 - Mac Ventura (13) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:white_check_mark: API diff for current PR / commit

.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/previous-api-comparison/diff/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/9793316a285e6defb757f6802ac0b407) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/previous-api-comparison/diff/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/45f3a38a598b19eefd2fc1c269427f05) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/previous-api-comparison/diff/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/2734c89f2d38c495aa5f5451fc42890e) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/previous-api-comparison/diff/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/93e468361015979cde9a2ac3a7f2cd32) (No breaking changes)

:white_check_mark: API diff vs stable

.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/stable-api-comparison/diff/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/bbb1fc83d1622e9327736dddcd0ecb2e) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/stable-api-comparison/diff/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/e909a50492cd70513e039a04f1d4edb4) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/stable-api-comparison/diff/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/c09992dc06d3400a4c113a5299cb352f) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.1/10573950-1/;/stable-api-comparison/diff/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/9d1915c836d2e6749c5723ecb5613222) (No breaking changes)

:information_source: Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed :computer:

:white_check_mark: All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:fire: [CI Build] Test results :fire:

Test results

:x: Tests failed on VSTS: test results

0 tests crashed, 2 tests failed, 99 tests passed.

Failures

:x: dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.
* DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

:x: dotnettests tests (macOS)

1 tests failed, 0 tests passed.
* DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

Successes

:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 40 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:fire: [CI Build] Test results :fire:

Test results

:x: Tests failed on VSTS: test results

0 tests crashed, 1 tests failed, 100 tests passed.

Failures

:x: dotnettests tests (MacCatalyst) [attempt 2]

1 tests failed, 0 tests passed.
* DotNet tests: Failed (Execution failed with exit code 1)

Html Report (VSDrops) Download

Successes

:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (macOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download :white_check_mark: dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 40 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: fa41fc5b1e4b953fa6430135703cd5dc7c1794a1 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Windows Integration Tests passed :computer:

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: ac9d644e638fbf3fe45a4971e3055d67af4449e3 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Tests on macOS M1 - Mac Monterey (12) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent Hash: ac9d644e638fbf3fe45a4971e3055d67af4449e3 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:white_check_mark: API diff for current PR / commit

.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/previous-api-comparison/diff/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/bf0b3841d6b4e6a18961f40ecd1ba9bd) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/previous-api-comparison/diff/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/c0f2e0ad02928ff4adc3beab2d38463e) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/previous-api-comparison/diff/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/22bddd02bab7ff937e517e951d3085b9) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/previous-api-comparison/diff/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/3bd1123b684a00dcee70212d10d42fa5) (No breaking changes)

:white_check_mark: API diff vs stable

.NET (No breaking changes) * iOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/stable-api-comparison/diff/Microsoft.iOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/b21cbc3b6a97d86624f71d68061dd8f8) (No breaking changes) * tvOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/stable-api-comparison/diff/Microsoft.tvOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/58a3fe227100a365bcc0b3e252a4c3d2) (No breaking changes) * MacCatalyst: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/stable-api-comparison/diff/Microsoft.MacCatalyst.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/3b1360b39875342e46b1cf5cf8ce9cab) (No breaking changes) * macOS: [vsdrops](https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/detected-changes/20241118.9/10576099-1/;/stable-api-comparison/diff/Microsoft.macOS.html) [gist](https://gist.github.com/vs-mobiletools-engineering-service2/ffc0e1b5379b8d4c13a7c8a83da19ae8) (No breaking changes)

:information_source: Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent Hash: ac9d644e638fbf3fe45a4971e3055d67af4449e3 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed :computer:

:white_check_mark: All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent Hash: ac9d644e638fbf3fe45a4971e3055d67af4449e3 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:computer: [CI Build] Tests on macOS M1 - Mac Ventura (13) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent Hash: ac9d644e638fbf3fe45a4971e3055d67af4449e3 [PR build]

vs-mobiletools-engineering-service2 commented 1 week ago

:rocket: [CI Build] Test results :rocket:

Test results

:white_check_mark: All tests passed on VSTS: test results.

:tada: All 101 tests passed :tada:

Tests counts

:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 40 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: ac9d644e638fbf3fe45a4971e3055d67af4449e3 [PR build]