Skip to content

[StateReporting] Add bindings for the new StateReporting framework up to Xcode 27 Beta 3#26035

Open
dalexsoto wants to merge 4 commits into
xcode27.0from
dev/alex/xc27-StateReporting
Open

[StateReporting] Add bindings for the new StateReporting framework up to Xcode 27 Beta 3#26035
dalexsoto wants to merge 4 commits into
xcode27.0from
dev/alex/xc27-StateReporting

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

Bind the StateReporting framework introduced in Xcode 27 (iOS, tvOS, macOS and Mac Catalyst 27.0). It exposes a single Objective-C type, SRStateReporter, used to record a feature's or subsystem's state transitions and volatile metadata updates.

  • Add src/statereporting.cs binding SRStateReporter: the read-only Domain property, ReportTransition and ReportVolatileMetadataUpdate methods, and the FromDomain static factory. The native init is NS_UNAVAILABLE, so the type uses [DisableDefaultCtor].
  • Register the framework on all four platforms: add it to COMMON_FRAMEWORKS in frameworks.sources, regenerate generator-frameworks.g.cs, add the Frameworks.cs entries (Mac Catalyst inherits from iOS), and regenerate the *-defines-dotnet.rsp files.
  • Update tests/dotnet/UnitTests/ProjectTest.cs (expected frameworks linked with LinkMode=None) and regenerate the Documentation.KnownFailures.txt baseline for the new members.
  • Update the two untrimmed macOS CoreCLR app-size baselines (+10,240 bytes per RID from the added type).
  • Remove the now-resolved *-StateReporting.todo files.

Copilot-Session: a81895be-6d8d-4e92-b751-e88d304b350f

Bind the StateReporting framework introduced in Xcode 27 (iOS, tvOS,
macOS and Mac Catalyst 27.0). It exposes a single Objective-C type,
SRStateReporter, used to record a feature's or subsystem's state
transitions and volatile metadata updates.

* Add src/statereporting.cs binding SRStateReporter: the read-only
  Domain property, ReportTransition and ReportVolatileMetadataUpdate
  methods, and the FromDomain static factory. The native init is
  NS_UNAVAILABLE, so the type uses [DisableDefaultCtor].
* Register the framework on all four platforms: add it to
  COMMON_FRAMEWORKS in frameworks.sources, regenerate
  generator-frameworks.g.cs, add the Frameworks.cs entries (Mac
  Catalyst inherits from iOS), and regenerate the
  *-defines-dotnet.rsp files.
* Update tests/dotnet/UnitTests/ProjectTest.cs (expected frameworks
  linked with LinkMode=None) and regenerate the
  Documentation.KnownFailures.txt baseline for the new members.
* Update the two untrimmed macOS CoreCLR app-size baselines (+10,240
  bytes per RID from the added type).
* Remove the now-resolved *-StateReporting.todo files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a81895be-6d8d-4e92-b751-e88d304b350f
@dalexsoto dalexsoto added this to the xcode27 milestone Jul 10, 2026
Copilot AI review requested due to automatic review settings July 10, 2026 04:36
@dalexsoto dalexsoto requested a review from rolfbjarne as a code owner July 10, 2026 04:36

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

Adds first-class .NET bindings and build-system registration for Apple’s new StateReporting framework (Xcode 27 beta / platform version 27.0), including test and baseline updates so the new framework is recognized and validated across iOS, tvOS, macOS, and Mac Catalyst.

Changes:

  • Introduce StateReporting.SRStateReporter bindings (domain + transition/metadata reporting APIs) with 27.0 availability.
  • Register the StateReporting framework in build metadata and generated framework lists, and add HAS_STATEREPORTING defines.
  • Update unit-test expectations, documentation known-failures baseline, app-size baselines, and remove now-resolved xtro-sharpie .todo files.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/common/Frameworks.cs Registers StateReporting in per-platform framework availability lists (27.0).
src/frameworks.sources Adds StateReporting to COMMON_FRAMEWORKS so it’s included in framework processing.
src/build/dotnet/generator-frameworks.g.cs Regenerates generated framework registry to include StateReporting and HaveStateReporting.
src/statereporting.cs Adds binding definitions for SRStateReporter (27.0 across iOS/tvOS/macOS/MacCatalyst).
src/rsp/dotnet/ios-defines-dotnet.rsp Adds -d:HAS_STATEREPORTING compile define for iOS.
src/rsp/dotnet/tvos-defines-dotnet.rsp Adds -d:HAS_STATEREPORTING compile define for tvOS.
src/rsp/dotnet/macos-defines-dotnet.rsp Adds -d:HAS_STATEREPORTING compile define for macOS.
src/rsp/dotnet/maccatalyst-defines-dotnet.rsp Adds -d:HAS_STATEREPORTING compile define for Mac Catalyst.
tests/dotnet/UnitTests/ProjectTest.cs Updates expected framework link set to include StateReporting across relevant scenarios.
tests/cecil-tests/Documentation.KnownFailures.txt Updates documentation baseline for the new StateReporting type/members.
tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt Updates macOS untrimmed app-size baseline due to added API surface.
tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-TrimmableStatic-size.txt Updates macOS untrimmed app-size baseline (trimmable static variant).
tests/xtro-sharpie/api-annotations-dotnet/iOS-StateReporting.todo Removes resolved xtro-sharpie todo entries for iOS.
tests/xtro-sharpie/api-annotations-dotnet/tvOS-StateReporting.todo Removes resolved xtro-sharpie todo entries for tvOS.
tests/xtro-sharpie/api-annotations-dotnet/macOS-StateReporting.todo Removes resolved xtro-sharpie todo entries for macOS.
tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-StateReporting.todo Removes resolved xtro-sharpie todo entries for Mac Catalyst.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 Failed to compute test summaries on VSTS: test results 🔥

Failed to compute test summaries: Unable to understand the test result '# ⚠️ arm64 - Mac Golden Gate (27): Tests skipped, incorrect beta version' for test 'Tests on macOS Golden Gate (27)'.

Pipeline on Agent
Merge 4b16824 into 9f3bb3d

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 Failed to compute test summaries on VSTS: test results 🔥

Failed to compute test summaries: Unable to understand the test result '# ⚠️ arm64 - Mac Golden Gate (27): Tests skipped, incorrect beta version' for test 'Tests on macOS Golden Gate (27)'.

Pipeline on Agent
Merge 4b16824 into 9f3bb3d

@dalexsoto

Copy link
Copy Markdown
Member Author

@copilot please revert the changes on tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt and tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-TrimmableStatic-size.txt

Co-authored-by: dalexsoto <204671+dalexsoto@users.noreply.github.com>

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

@copilot please revert the changes on tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt and tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-TrimmableStatic-size.txt

Done in 2a68d5b.

@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 #2a68d5b] Build failed (Build packages) 🔥

Build failed for the job 'Build packages' (with job status 'Failed')

Pipeline on Agent
Hash: 2a68d5bb892333555ba80dfc84ec5834c11f1aff [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

StateReporting is a native-only framework: it exists only in the SDK's
/System/Library/Frameworks/ and not in the iOSSupport overlay, so on Mac
Catalyst it is linked from the native path (its .tbd install-name is
/System/Library/Frameworks/StateReporting.framework/Versions/A/StateReporting),
the same path used on macOS.

Move the StateReporting entry in expectedFrameworks_MacCatalyst_None from
the /System/iOSSupport/ section to the native /System/Library/Frameworks/
section so it matches the actual LC_LOAD_DYLIB read by
GetLinkedWithFrameworks, fixing the
LinkedWithNativeLibraries(MacCatalyst, "maccatalyst-x64", "None") test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a81895be-6d8d-4e92-b751-e88d304b350f
@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: 921d861dfd15205debe11f564459aa0b137e01f5 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #921d861] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

1 tests crashed, 2 tests failed, 188 tests passed.

Failures

❌ assembly-processing tests

🔥 Failed catastrophically on VSTS: test results - assembly-processing (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

1 tests failed, 17 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Release (compat inline Class.GetHandle): TimedOut

Html Report (VSDrops) Download

❌ Tests on macOS Tahoe (26) tests

1 tests failed, 4 tests passed.

Failed tests

  • macOS/osx-arm64 monotouch-test: Failed (exit code 137)
    • No test failure details available. Output tail:
      • 2026-07-11 18:26:18.965 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:18.979 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:18.993 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:19.007 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:19.021 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:19.035 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:19.049 monotouchtest[85016:3259623] CFSocketSetAddress listen failure: 102
      • 2026-07-11 18:26:19.091 monotouchtest[85016:3259196] CFSocketSetAddress listen failure: 102
      • Execution timed out after 600 seconds.
      • Execution completed with exit code 137

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 (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 (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 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 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 Golden Gate (27): Tests skipped, incorrect beta version. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 921d861dfd15205debe11f564459aa0b137e01f5 [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.

5 participants