Skip to content

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

Merged
rolfbjarne merged 9 commits into
mainfrom
dev/rolf/tests-linked-monotouch-test
May 19, 2026
Merged

rolfbjarne merged 9 commits into
mainfrom
dev/rolf/tests-linked-monotouch-test

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented May 14, 2026 •

Copy link
Copy Markdown
Member
  • 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@rolfbjarne
rolfbjarne enabled auto-merge (squash) May 18, 2026 16:24
@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

Copy link
Copy Markdown
Collaborator

βœ… [PR Build #7410898] Build passed (Detect API changes) βœ…

Pipeline on Agent
Hash: 741089831a8275379eefeb71125e6c7e1a48b338 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… [PR Build #7410898] Build passed (Build packages) βœ…

Pipeline on Agent
Hash: 741089831a8275379eefeb71125e6c7e1a48b338 [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: 741089831a8275379eefeb71125e6c7e1a48b338 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… [PR Build #7410898] Build passed (Build macOS tests) βœ…

Pipeline on Agent
Hash: 741089831a8275379eefeb71125e6c7e1a48b338 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

πŸš€ [CI Build #7410898] Test results πŸš€

Test results

βœ… All tests passed on VSTS: test results.

πŸŽ‰ All 183 tests passed πŸŽ‰

Tests counts

βœ… cecil: All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (iOS): All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) 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 (VSDrops) 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 Publish failed ⚠️) Download
βœ… interdependent-binding-projects: All 4 tests passed. [attempt 2] 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 (macOS): All 20 tests passed. (⚠️ Html Report Publish failed ⚠️) Download
βœ… monotouch (tvOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
βœ… msbuild: All 2 tests passed. (⚠️ Html Report Publish failed ⚠️) 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: 741089831a8275379eefeb71125e6c7e1a48b338 [PR build]

@rolfbjarne
rolfbjarne merged commit 881aad6 into main May 19, 2026
49 checks passed
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