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.42k stars 507 forks source link

[Blocks] Remove a block callback validation that's apparently too eager. #20625

Closed rolfbjarne closed 1 month ago

rolfbjarne commented 1 month ago

The validation verifies that the function pointer for a block callback is the same the return value from the method's MethodInfo.MethodHandle.GetFunctionPointer() method.

In actual code, it's equivalent to validating that the following always prints "Equal: true":

[UnmanagedCallersOnly]
public static void Invoke () {}

static void Test ()
{
    delegate* unmanaged<void> fptr1 = &Invoke;
    IntPtr fptr2 = GetType ().GetMethod ("Invoke").MethodHandle.GetFunctionPointer ();
    Console.WriteLine ($"fptr1: 0x{((IntPtr) fptr1).ToString ("x")}");
    Console.WriteLine ($"fptr2: 0x{fptr2.ToString ("x")}");
    Console.WriteLine ($"Equal: ((IntPtr) fptr1) == fptr2}"); // prints "Equal: true" for me
}

However, this isn't documented, and some feedback indicates it's certainly not a valid assumption for CoreCLR:

https://discord.com/channels/732297728826277939/732582981163548703/1242473425759633488

And there's also a customer running into this validation, apparently withou cause: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2054534

So just remove it.

vs-mobiletools-engineering-service2 commented 1 month ago

:fire: Unable to find the contents for the comment: D:\a\1\a\change-detection\results\gh-comment.md does not exist :fire

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:books: [PR Build] Artifacts :books:

Packages generated

View packages * [xamarin.ios-17.3.0.446.pkg](https://dl.internalx.com/wrench/merge/a852f7c8d810022693422a766c4261edfa809d1d/9610781/package/xamarin.ios-17.3.0.446.pkg) * [xamarin.mac-9.3.0.446.pkg](https://dl.internalx.com/wrench/merge/a852f7c8d810022693422a766c4261edfa809d1d/9610781/package/xamarin.mac-9.3.0.446.pkg)

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

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

:x: Build failure :x:

Build result: Failed

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:computer: [PR 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: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:computer: [PR 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: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:computer: [PR Build] Tests on macOS M1 - Mac Big Sur (11) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Big Sur (11) passed.

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:computer: [PR 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: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

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

Test results

:x: Tests failed on VSTS: test results

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

Failures

:x: dotnettests tests (iOS) [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 (MacCatalyst): All 1 tests passed. [attempt 2] 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 8 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: install-source: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 65 tests passed. Html Report (VSDrops) Download :white_check_mark: mac-binding-project: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: mmp: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mononative: All 6 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (watchOS): All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mtouch: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: xammac: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

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

Test results

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

:tada: All 170 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. [attempt 3] Html Report (VSDrops) Download :white_check_mark: dotnettests (MacCatalyst): All 1 tests passed. [attempt 2] 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 8 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: install-source: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 65 tests passed. Html Report (VSDrops) Download :white_check_mark: mac-binding-project: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: mmp: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mononative: All 6 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 11 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (watchOS): All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mtouch: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: xammac: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

:x: [CI Build] Windows Integration Tests failed :x:

:x: Failed :x:

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

vs-mobiletools-engineering-service2 commented 1 month ago

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

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: 50fc38d6c3a2ceb4f2d3fad4e94aa94b92465391 [PR build]

rolfbjarne commented 3 weeks ago

/sudo backport release/8.0.1xx-xcode15.1

vs-mobiletools-engineering-service2 commented 3 weeks ago

Backport Job to branch release/8.0.1xx-xcode15.1 Created! The magic is happening here

vs-mobiletools-engineering-service2 commented 3 weeks ago

Oh no! Backport failed! Please see https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=9694066 for more details.