Skip to content

[GameKit] Correct nullable callback annotations Fixes #24480 - #26811

Merged
rolfbjarne merged 17 commits into
mainfrom
dev/rolf/fix-gklocalplayer-handler-nullability
Oct 23, 2026
Merged

rolfbjarne merged 17 commits into
mainfrom
dev/rolf/fix-gklocalplayer-handler-nullability

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Summary

  • Correct nullable results and errors throughout GameKit, including the named delegates backed by Apple SDK headers.
  • Remove 24 resolved GameKit xtro suppressions and the three platform ignore files left empty by this cleanup.

The existing GKTurnBasedMatch.DeclineInvite callback signature is left unchanged for a separate compatibility-safe fix; its xtro suppression remains.

Fixes #24480

🤖 Pull request created by Copilot

rolfbjarne and others added 12 commits September 25, 2026 18:22
Compile the repository's API-definition and binding-attribute assemblies with full nullable context, matching the already-enabled core and platform assemblies. Restore the inherited context after Foundation's locally annotated callback and remove an obsolete HealthKit warning suppression.

Enable annotations in both bgen's fallback compilation and the binding-project MSBuild target without imposing new nullable warnings on consuming projects. This covers direct csc response files and the separate binding-tool routes while keeping generated bindings buildable across all four platforms.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Put -nullable+ in DOTNET_FLAGS so core, platform, API-definition, and binding-attribute compiler invocations use the same setting. Remove redundant switches from the core and platform response files and the attribute-library command; keep it in the API-definition response files because they are separately consumed by generated analysis projects.

Track changes to Makefile when deciding whether to rebuild the binding-attribute assembly, so a future change to shared compiler flags also recompiles that direct-csc output.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Document ten active Network enums and all 42 of their values, with one commit for each type. Remove the corresponding 42 Cecil documentation known-failure entries.

🤖 Pull request created by Copilot

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Annotate both view controller and error as nullable in the local player's authentication handler for iOS, Mac Catalyst, tvOS, and macOS. Keep the existing nullable handler contract while the file is not yet nullable-enabled.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Match the nullable result and error parameters declared by GameKit's SDK headers across its completion callbacks. Keep enum and value-type arguments nonnullable, and annotate the optional best-host responses as nullable.

With PR #26746 enabling nullable annotations in API definitions globally, these annotations flow through bgen without local nullable directives.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the now-obsolete missing-null-allowed entries for GameKit callbacks and the local-player authentication handler. The managed annotations now match the nullable callback arguments in the native headers across Apple platforms.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Mark the image, photo, and challenge-definition results nullable in the named GameKit completion delegates, matching the native SDK headers. Remove the resolved xtro suppressions and delete the platform ignore files that are now empty.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore the existing DeclineInvite callback contract and its xtro suppression. Apple's native completion block has a different arity, which requires a separate compatibility-safe binding fix rather than a nullable annotation in this PR.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 13:44

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.

Copilot review overview

🟡 Changes recommended

The branch contains extensive unrelated changes and the bgen availability behavior lacks regression coverage.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

The PR corrects GameKit callback nullability and removes resolved xtro suppressions, but the diff also includes extensive unrelated .NET 12, CI, platform-availability, runtime-test, and build-system changes.

Changes:

  • Corrects nullable GameKit callback parameters.
  • Removes corresponding GameKit xtro suppressions.
  • Bundles broad dependency-flow and infrastructure updates unrelated to the stated purpose.
File Description
tests/​xtro-sharpie/​api-annotations-dotnet/​tvOS-GameKit.ignore Removes resolved tvOS suppressions.
tests/​xtro-sharpie/​api-annotations-dotnet/​macOS-GameKit.ignore Removes resolved macOS suppressions.
tests/​xtro-sharpie/​api-annotations-dotnet/​MacCatalyst-GameKit.ignore Removes resolved Catalyst suppressions.
tests/​xtro-sharpie/​api-annotations-dotnet/​iOS-GameKit.ignore Removes resolved iOS suppressions.
tests/​xtro-sharpie/​api-annotations-dotnet/​common-GameKit.ignore Removes common nullability suppressions.
tests/​test-libraries/​libtest.m Adds pthread-exit release helper.
tests/​test-libraries/​libtest.h Declares thread-exit helper.
tests/​msbuild/​Xamarin.MacDev.Tasks.Tests/​TaskTests/​GetCachedFileHashTaskTests.cs Tests cached file hashing.
tests/​monotouch-test/​ObjCRuntime/​RuntimeTest.cs Adds ignored thread-exit regression test.
tests/​monotouch-test/​CoreAnimation/​LayerTest.cs Flushes pending Core Animation work.
tests/​linker/​link sdk/​LinkSdkRegressionTest.cs Updates memory-size expectation.
tests/​fsharplibrary/​dotnet/​shared.fsproj Embeds linker substitutions.
tests/​fsharplibrary/​dotnet/​ILLink.Substitutions.xml Removes absent F# resources during linking.
tests/​dotnet/​UnitTests/​ProjectTest.cs Updates expected F# resources.
tests/​dotnet/​UnitTests/​IncrementalBuildTest.cs Tests R2R hash caching.
tests/​dotnet/​UnitTests/​expected/​TVOS-NativeAOT-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​TVOS-CoreCLR-R2R-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​TVOS-CoreCLR-Interpreter-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​MacOSX-NativeAOT-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​MacCatalyst-NativeAOT-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​MacCatalyst-CoreCLR-R2R-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​MacCatalyst-CoreCLR-Interpreter-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​iOS-NativeAOT-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​iOS-CoreCLR-R2R-size.txt Updates expected app size.
tests/​dotnet/​UnitTests/​expected/​iOS-CoreCLR-Interpreter-size.txt Updates expected app size.
tests/​cecil-tests/​Documentation.KnownFailures.txt Removes resolved documentation failures.
tests/​cecil-tests/​AttributeTest.cs Extends availability checks to nested types.
tests/​bindings-test/​ApiDefinition.cs Binds the thread-exit helper.
src/​Network/​NWEnums.cs Adds Network enum documentation.
src/​GLKit/​Defs.cs Corrects Catalyst availability.
src/​gamekit.cs Corrects callback nullability.
src/​CoreMidi/​MidiStructs.cs Corrects tvOS availability.
src/​CoreMidi/​MidiBluetoothDriver.cs Corrects tvOS availability.
src/​contactsui.cs Consolidates platform-specific delegate definitions.
src/​Cinematic/​CNDecision.cs Corrects Catalyst availability.
src/​CarPlay/​CPNowPlayingSportsClock.cs Restricts unsupported platforms.
src/​CarPlay/​CPLocationCoordinate3D.cs Restricts Catalyst availability.
src/​BrowserEngineKit/​BEWebContentFilterEvaluateUrlWithMainFrameResult.cs Restricts Catalyst availability.
src/​BrowserEngineKit/​BEStructs.cs Restricts Catalyst availability.
src/​bgen/​Generator.cs Alters appearance-property availability generation.
src/​AddressBookUI/​DisplayedPropertiesCollection.cs Restricts Catalyst availability.
src/​AddressBookUI/​ABUnknownPersonViewController.cs Restricts Catalyst availability.
src/​AddressBookUI/​ABPersonViewController.cs Restricts Catalyst availability.
src/​AddressBookUI/​ABPeoplePickerNavigationController.cs Restricts Catalyst availability.
src/​AddressBookUI/​ABNewPersonViewController.cs Restricts Catalyst availability.
src/​AddressBookUI/​ABAddressFormatting.cs Restricts Catalyst availability.
NuGet.config Updates .NET package feeds.
msbuild/​Xamarin.Shared/​Xamarin.Shared.targets Registers cached-hash task.
msbuild/​Xamarin.MacDev.Tasks/​Tasks/​GetCachedFileHash.cs Implements cached SHA-256 hashing.
msbuild/​Xamarin.Localization.MSBuild/​MSBStrings.resx Adds localized hashing messages.
global.json Moves the repository to .NET 12.
eng/​Version.Details.xml Updates .NET dependency versions.
eng/​Version.Details.props Updates generated dependency properties.
eng/​common/​tools.sh Enables local multithreaded MSBuild.
eng/​common/​tools.ps1 Enables local multithreaded MSBuild.
eng/​common/​templates/​variables/​pool-providers.yml Fixes spelling.
eng/​common/​templates-official/​variables/​pool-providers.yml Fixes spelling.
eng/​common/​SetupNugetSources.sh Adds the .NET 11 feed.
eng/​common/​SetupNugetSources.ps1 Adds the .NET 11 feed.
eng/​common/​run-helix-job-monitor.sh Extracts Helix monitor logic.
eng/​common/​post-build/​nuget-verification.ps1 Fixes documentation spelling.
eng/​common/​native/​init-os-and-arch.sh Adds OpenHarmony detection.
eng/​common/​native/​init-distro-rid.sh Adds OpenHarmony RID handling.
eng/​common/​msbuild.ps1 Changes multithreaded build defaults.
eng/​common/​loc/​P22DotNetHtmlLocalization.lss Fixes spelling.
eng/​common/​init-tools-native.sh Fixes help-text spelling.
eng/​common/​Get-GitHubAppToken.ps1 Changes GitHub App secret handling.
eng/​common/​cross/​toolchain.cmake Adds OpenHarmony toolchain support.
eng/​common/​cross/​build-rootfs.sh Updates Alpine APK tooling.
eng/​common/​core-templates/​steps/​source-index-stage1-publish.yml Moves source indexing to complog.
eng/​common/​core-templates/​steps/​send-to-helix.yml Revises Helix Entra authentication.
eng/​common/​core-templates/​steps/​get-github-app-token.yml Uses Key Vault secrets.
eng/​common/​core-templates/​steps/​astred-artifacts.yml Adds Astred artifact generation.
eng/​common/​core-templates/​stages/​renovate.yml Updates Renovate version.
eng/​common/​core-templates/​job/​source-index-stage1.yml Makes source indexing non-blocking.
eng/​common/​core-templates/​job/​onelocbuild.yml Updates GitHub App credentials.
eng/​common/​core-templates/​job/​job.yml Adds optional Astred integration.
eng/​common/​core-templates/​job/​helix-job-monitor.yml Refactors Helix monitoring.
eng/​common/​build.sh Improves argument quoting.
eng/​common/​build.ps1 Changes multithreaded build defaults.
dotnet/​targets/​Microsoft.Sdk.R2R.targets Uses cached R2R input hashes.

Comment thread src/bgen/Generator.cs Resolved
Comment thread global.json Resolved
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne added the do-not-merge Do not merge this pull request label Oct 2, 2026
@rolfbjarne

This comment was marked as outdated.

Base automatically changed from dev/rolf/repository-nullability to main October 5, 2026 19:27
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 16:46
@rolfbjarne rolfbjarne removed the do-not-merge Do not merge this pull request label Oct 13, 2026

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.

🔵 Needs a closer look

Public binding changes still need confirmed platform-test and API-diff results.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

dalexsoto
dalexsoto previously approved these changes Oct 21, 2026
Resolve the GameKit xtro baseline conflict by retaining main's removal of the obsolete GKInviteeResponse suppression and this branch's removal of resolved callback nullability suppressions. Keep the deferred DeclineInvite suppression unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 17:59

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.

🔵 Needs a closer look

Cross-platform build, test, and API-diff validation remains unconfirmed for the generated binding changes.

No open issues 🎉

Review effort: Balanced

@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

⚠️ AppSizeTest expected files changed ⚠️

The AppSizeTest detected changes in the expected app size files.

To update the expected files, add a comment with the following command:

/apply-gist https://gist.github.com/vs-mobiletools-engineering-service2/4d407ba1dd01c5434ad0984f9bcdcf1a
Updated files
  • MacOSX-CoreCLR-R2R-size.txt

Pipeline on Agent
Hash: db54ad851fc7bce62bbb026d183e095bc282611d [PR build]

Copilot AI balanced review requested due to automatic review settings October 23, 2026 06:51

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.

🔵 Needs a closer look

No blocking defects were identified, but successful cross-platform binding and API-diff validation has not been established.

No open issues 🎉

Review effort: Balanced

@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: 0a2c2ac637aee9cec4a1ea583519c74fe11be014 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #0a2c2ac] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 217 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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. [attempt 2] 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. [attempt 2] Html Report (VSDrops) Download
✅ generator: All 1 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker (tvOS): All 21 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 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. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 0a2c2ac637aee9cec4a1ea583519c74fe11be014 [PR build]

@rolfbjarne
rolfbjarne merged commit 4512b89 into main Oct 23, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/fix-gklocalplayer-handler-nullability branch October 23, 2026 17:39
rolfbjarne added a commit that referenced this pull request Dec 1, 2026
Keep main's removal of the GameKit callback nullability suppressions fixed by #26811, while retaining this branch's newly detected class-selector deprecation suppressions on all four platforms.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f56b49e-fb0f-4167-a04f-2c3b63a08063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect definition of GKLocalPlayer.AuthenticateHandler: missing nullables

4 participants