Skip to content

[tools] Fix marking generated block code when not using any of the static registrars#25434

Open
rolfbjarne wants to merge 7 commits into
mainfrom
dev/rolf/tests-linked-monotouch-test
Open

[tools] Fix marking generated block code when not using any of the static registrars#25434
rolfbjarne wants to merge 7 commits into
mainfrom
dev/rolf/tests-linked-monotouch-test

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

@rolfbjarne rolfbjarne commented May 14, 2026

  • Fix an issue where the new style of generated block supporting code wasn't properly handled by the trimmer when using the dynamic registrar.
  • Add a 'link sdk' + 'link all' test variation for all platforms for monotouch-test.
  • Update a few tests to cope with the additional trimming variations for monotouch-test.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the xharness Jenkins test matrix for monotouch-test by introducing additional linker coverage across all platforms, adding explicit Link SDK and Link All runs (as Release variations). This fits into the tests/xharness infrastructure that defines how CI expands a single test project into multiple build/run configurations.

Changes:

  • Add Release|LinkSdk variation for monotouch-test.
  • Add Release|LinkAll variation for monotouch-test.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Use IsLinkAny instead of IsLinkAll for trimming guards, since SDK-level
trimming (linksdk) can also remove framework references, properties, and
delegate mismatch checking code from SDK assemblies.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 3 commits May 18, 2026 13:47
The PreserveBlockCodeStep only handled old-style block proxy types (with a
Handler field and [MonoPInvokeCallback] attribute on Invoke). New-style block
proxy types use [UnmanagedCallersOnly] on Invoke with no Handler field.

When using linkall + dynamic registrar (the default on iOS simulator), the
existing MarkForStaticRegistrar[Step] does not run (gated on RegistrarMode.Static),
so the Invoke method was trimmed. At runtime, the reflection lookup in
Blocks.GetBlockForDelegate would then fail with MX8060.

Extend PreserveBlockCodeStep to also detect and preserve new-style block proxy
Invoke methods, matching on [UnmanagedCallersOnly] and [UserDelegateType] attributes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne force-pushed the dev/rolf/tests-linked-monotouch-test branch from 74a2acf to 81c5280 Compare May 18, 2026 11:47
@rolfbjarne rolfbjarne changed the title [xharness] Add a 'link sdk' + 'link all' test variations for all platforms for monotouch-test. [tools] Fix marking generated block code when not using any of the static registrars May 18, 2026
@rolfbjarne rolfbjarne marked this pull request as ready for review May 18, 2026 12:02
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne enabled auto-merge (squash) May 18, 2026 16:24
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #9437415] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 9437415fb792725262b625210a6ddafb8d195f57 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #9437415] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 9437415fb792725262b625210a6ddafb8d195f57 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 9437415fb792725262b625210a6ddafb8d195f57 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #9437415] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 9437415fb792725262b625210a6ddafb8d195f57 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 [CI Build #9437415] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

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

Failures

❌ monotouch tests (macOS)

1 tests failed, 19 tests passed.

Failed tests

  • monotouch-test/macOS/Release (link all): Failed (Test run failed.
    Tests run: 3709 Passed: 3597 Inconclusive: 4 Failed: 3 Ignored: 109)

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 9437415fb792725262b625210a6ddafb8d195f57 [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants