[FSKit] Update bindings up to Xcode 27.0 Beta 3#26163
Conversation
Bind the macOS 27 FSVolume handler protocols and their result types, including subclass-specific requested-attribute dispatch and the new data-cache and coherency APIs. Add the FSClient mounting and settings APIs, FSContext and FSFreeSpace support, the failable FSEntityIdentifier factory, and focused factory tests. Remove the resolved xtro todo and update the FSKit documentation baseline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3358f406-d18f-40bf-b789-86517fea0312
There was a problem hiding this comment.
Pull request overview
Updates the FSKit bindings to match macOS 27 / Xcode 27 Beta 3, expanding the bound API surface (protocol handlers, result types, data-cache/coherency APIs) and adding a safe nullable factory for a failable FSEntityIdentifier initializer.
Changes:
- Added new macOS 27 FSKit bindings (protocols, result classes, enums, and new FSClient/FSVolume APIs) in
src/fskit.cs. - Introduced
FSEntityIdentifier.Create(...)as a nullable factory wrapping the failable qualifier-data initializer, plus a focused monotouch test. - Removed the resolved xtro todo and updated the documentation known-failures baseline for the newly bound API surface.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/xtro-sharpie/api-annotations-dotnet/macOS-FSKit.todo | Removed resolved FSKit xtro todo entries. |
| tests/monotouch-test/FSKit/FSEntityIdentifierTest.cs | Adds targeted runtime-gated coverage for the new nullable Create factory behavior. |
| tests/cecil-tests/Documentation.KnownFailures.txt | Updates doc baseline to include newly introduced FSKit members/enums. |
| src/FSKit/FSEntityIdentifier.cs | Adds a nullable Create factory wrapping the failable qualifier-data initializer. |
| src/fskit.cs | Binds macOS 27 FSKit API additions (protocol handlers, results, enums, and new FSClient/FSVolume members). |
| src/frameworks.sources | Includes the new FSKit partial source file in the build. |
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🔥 [CI Build #6d4a926] Test results 🔥Test results❌ Tests failed on VSTS: test results 2 tests crashed, 0 tests failed, 171 tests passed. Failures❌ monotouch tests (tvOS)🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Sonoma (14) tests🔥 Failed catastrophically on VSTS: test results - mac_sonoma (no summary found). Html Report (VSDrops) Download Successes✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
| [SupportedOSPlatform ("macos27.0")] | ||
| public static FSEntityIdentifier? Create (NSUuid uuid, NSData qualifierData) | ||
| { | ||
| if (uuid is null) | ||
| ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (uuid)); | ||
| if (qualifierData is null) | ||
| ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (qualifierData)); | ||
|
|
||
| var rv = new FSEntityIdentifier (NSObjectFlag.Empty); | ||
| rv.InitializeHandle (rv._InitWithUuidQualifierData (uuid, qualifierData), "initWithUUID:qualifierData:", false); | ||
| if (rv.Handle == NativeHandle.Zero) { | ||
| rv.Dispose (); | ||
| return null; | ||
| } | ||
| return rv; | ||
| } |
There was a problem hiding this comment.
@copilot This is fairly frequent pattern, we should try to figure out a way to define this in the api definition and have bgen generate the correct code.
One idea could be to define a [FactoryMethod ("Create")]:
[Export ("initWithUUID:qualifierData:")]
[FactoryMethod ("Create")]
NativeHandle Constructor (NSUuid uuid, NSData qualifierData);another could be to define a [Constructor] attribute:
[Export ("initWithUUID:qualifierData:")]
[Constructor]
NativeHandle Create (NSUuid uuid, NSData qualifierData);although the [Constructor] attribute might be redundant, given that all "init*" selectors are constructors (or is this not true?)? So maybe we could use the selector (instead of the "Constructor" name) to determine whether an api definition is a constructor or not?
In any case, file an issue about this so we can look into it and decide on a design.
There was a problem hiding this comment.
Filed #26167 to track adding [FactoryMethod] (or an alternative design) to bgen so this boilerplate can be generated automatically. The issue captures both design options you described, lists the existing occurrences of the pattern across the codebase, and calls out the open questions (attribute vs. naming convention, distinguishing failable vs. non-failable init* selectors, platform availability propagation).
| public void Create () | ||
| { | ||
| TestRuntime.AssertXcodeVersion (27, 0); | ||
| TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 27, 0); |
There was a problem hiding this comment.
NBD but the AssertSystemVersion call is redundant, that's covered by the AssertXcodeVersion csll.
Summary
Validation
make worldiOS and tvOS introspection were also exercised; their remaining failures are pre-existing Xcode 27 Beta 3 UIKit/AVFoundation runtime gaps unrelated to FSKit.