Skip to content

[tools] Keep track of removed/unavailable frameworks in our list of frameworks.#25490

Merged
rolfbjarne merged 6 commits into
mainfrom
dev/rolf/unavailable-frameworks
May 21, 2026
Merged

[tools] Keep track of removed/unavailable frameworks in our list of frameworks.#25490
rolfbjarne merged 6 commits into
mainfrom
dev/rolf/unavailable-frameworks

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

This simplifies some code, and also makes it easier to determine what to do with
some bindings we still have for some of these frameworks.

…rameworks.

This simplifies some code, and also makes it easier to determine what to do with
some bindings we still have for some of these frameworks.
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 updates the tooling framework metadata so that frameworks that have been removed (or are otherwise unavailable) can be identified via a unified API, with the goal of simplifying and centralizing framework-availability checks across bundler/linker/registrar code paths.

Changes:

  • Extend Framework/Frameworks to track “unavailable as of SDK version” (VersionUnavailable) and introduce Framework.IsFrameworkUnavailable (Application app).
  • Update the static registrar and module-reference linking logic to use the new “unavailable” concept instead of simulator-only checks and hardcoded Xcode-version special cases.
  • Update the dotnet linker step to consult framework availability before inlining Dlfcn calls.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/dotnet-linker/Steps/InlineDlfcnMethodsStep.cs Switches inlining-skip logic to consult framework availability metadata.
tools/common/StaticRegistrar.cs Uses framework availability metadata to decide imports/registration for unavailable frameworks.
tools/common/Frameworks.cs Adds versioned unavailability tracking + new availability helper, and records removed frameworks (AssetsLibrary/NewsstandKit).
tools/common/Assembly.cs Updates framework-linking decisions for module references to use the new unavailability helper.
tools/common/Application.cs Renames/replaces the simulator-availability helper with IsFrameworkUnavailable.

Comment thread tools/dotnet-linker/Steps/InlineDlfcnMethodsStep.cs Outdated
Comment thread tools/common/Frameworks.cs
Comment thread tools/common/StaticRegistrar.cs Outdated
Comment thread tools/common/StaticRegistrar.cs
@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 21, 2026 13:04
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne marked this pull request as ready for review May 21, 2026 11:13
@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.

@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.

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

tools/common/Frameworks.cs:688

  • AssetsLibrary is no longer listed among the frameworks marked unavailable for Mac Catalyst in this switch. Since GetMacCatalystFrameworks starts from the iOS framework list, omitting it here means it will be treated as available on Mac Catalyst (and even have its Version bumped to 13.0), which is likely incorrect and can lead to link/import failures. Add AssetsLibrary back to the Mac Catalyst-unavailable set (either in the explicit list or the xtro/unknown list) if it’s still unsupported on Catalyst.
				case "ARKit":
				case "BrowserEngineCore":
				case "CarPlay":
				case "WatchConnectivity":
					f.Unavailable = true;

Comment thread tools/common/Frameworks.cs
Comment thread tools/common/StaticRegistrar.cs
@rolfbjarne
Copy link
Copy Markdown
Member Author

/review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

.NET for Apple Platforms PR Reviewer completed successfully!

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Overall Assessment: Clean refactoring with suggestions for improvement

This PR successfully consolidates framework availability logic into a single IsFrameworkUnavailable() method, eliminating duplicate Xcode version checks and improving maintainability. The approach is sound and the implementation is generally correct.

Findings

  • 0 ❌ errors
  • 1 ⚠️ warnings
  • 5 💡 suggestions

What's Good

  • Excellent consolidation: The new IsFrameworkUnavailable() method unifies simulator, SDK version, and framework-specific unavailability checks into one place
  • Data-driven approach: Using VersionUnavailable to track when frameworks become unavailable is cleaner than scattered Xcode version checks
  • Code cleanup: Removed ~30 lines of duplicate logic from StaticRegistrar.cs
  • Correct nullability handling: Added null checks for TypeDefinition? parameters in TryGetFramework methods
  • Consistent log messages: Updated messages to use generic "current SDK" language instead of "simulator" or "Xcode 15+"

Suggestions for Improvement

  1. ⚠️ Semantic clarity: The Unavailable property name is potentially confusing since it's set to true whenever VersionUnavailable is provided, even if the framework is currently available in older SDKs. Consider renaming or documenting this more clearly.

  2. 💡 Documentation: Add brief comments for the version numbers (17.4 for AssetsLibrary, 17.0 for NewsstandKit) to help maintainers understand which Xcode/SDK versions these correspond to.

  3. 💡 Consistency: Mac Catalyst exclusions use direct Unavailable = true assignment while iOS uses the version_unavailable parameter pattern. Consider documenting why or making the patterns consistent.

CI Status

CI checks are still running. The code changes look correct, but please ensure all checks pass before merging.


Note: No test changes were included in this PR. The refactoring maintains existing behavior, so existing tests should continue to pass. If there are specific test scenarios for framework availability detection, consider verifying they cover the new consolidated logic.

Generated by .NET for Apple Platforms PR Reviewer for issue #25490 · ● 3.3M

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

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

Pipeline on Agent
Hash: d4d2f2f262e08e070eea6176ef8b89102906ebd0 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

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

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

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

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

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

Pipeline on Agent
Hash: d4d2f2f262e08e070eea6176ef8b89102906ebd0 [PR build]

@rolfbjarne rolfbjarne enabled auto-merge (squash) May 21, 2026 14:11
@vs-mobiletools-engineering-service2

This comment has been minimized.

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

🚀 [CI Build #d4d2f2f] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 183 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) 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 Publish failed ⚠️) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 11 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 (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. (⚠️ Html Report Publish failed ⚠️) 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: d4d2f2f262e08e070eea6176ef8b89102906ebd0 [PR build]

@rolfbjarne rolfbjarne merged commit 4fe3735 into main May 21, 2026
52 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