Skip to content

Commit 5ecfb55

Browse files
beriberikixclaude
andcommitted
Remove the System Extension subsystem
Twenty thousand lines that no shipping path could reach, and a release artifact no installed component could locate. Activation was never attempted. Both OSSystemExtensionManager.submitRequest call sites were unreachable, because ServerCoordinator gated everything on systemExtensionBundleConfig, which nothing in Sources ever set. The whole of Sources/SystemExtension/ was unreachable even from its own executable: its IOKitDeviceClaimer, XPCIPCHandler and ComprehensiveStatusMonitor were shadowed by same-named stubs in USBIPDCore, and no module imported it. StatusCommand's 600-line report sat behind a guard that always took the early return. None of it could have worked. OSSystemExtensionRequest resolves extensions inside the calling process's own bundle and requires that bundle to live in /Applications; a Homebrew-installed Mach-O is neither. The claiming strategy underneath — setting IOMatchCategory and IOProbeScore from userspace and calling IOServiceRequestProbe — was measured not to unbind anything, and is not how a DriverKit extension matches in any case. What replaces it is what was already doing the work: DeviceOwnershipInspector refuses to bind a device whose interfaces macOS holds and names the owner, and IOKit refuses USBInterfaceOpen on an interface another driver owns. DeviceClaimManager survives as the seam a real implementation would slot into; UserspaceDeviceClaimManager satisfies it honestly. Deleted: Sources/USBIPDCore/SystemExtension/ (16,775 lines), Sources/SystemExtension/ (3,670), Common/SystemExtensionErrors.swift, DefaultUSBDeviceCommunicator (a superseded duplicate of the Implementation still carrying a hard claim gate), USBRequestHandler.validateDeviceAccess and its protocol requirement (no callers), the ServerCoordinator and ServerConfig branches, and two test files covering only the dead detector. The USBIPDSystemExtension product and target go with them. Sources/SystemExtension/Info.plist, its entitlements, and the README explaining why the subsystem failed are preserved under Documentation/development/system-extension-archive/ — they record the identifier and entitlement decisions a future DriverKit extension needs. 23,838 lines removed. Tests drop from 443 to 429, exactly the 14 covering the deleted detector and installer. Verified against a Raspberry Pi Debug Probe on a release build: control transfer passes, a control transfer still completes in 0.003s while a read blocks for 60, probe-rs still reaches chip detection, and bind still refuses a HID keyboard naming AppleUserHIDDevice. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017rmyikdjWveP99ZUCDLY89
1 parent 9b5fbd5 commit 5ecfb55

49 files changed

Lines changed: 55 additions & 23635 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Sources/SystemExtension/Info.plist renamed to Documentation/development/system-extension-archive/Info.plist

File renamed without changes.

Sources/SystemExtension/SystemExtension.entitlements renamed to Documentation/development/system-extension-archive/SystemExtension.entitlements

File renamed without changes.

Sources/USBIPDCore/SystemExtension/README.md renamed to Documentation/development/system-extension-archive/why-it-was-removed.md

File renamed without changes.

Package.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ let package = Package(
2222
.library(
2323
name: "Common",
2424
targets: ["Common"]),
25-
.executable(
26-
name: "USBIPDSystemExtension",
27-
targets: ["SystemExtension"]),
2825
// Plugin temporarily disabled - completion generation works via CLI scripts
2926
// .plugin(
3027
// name: "CompletionGeneratorPlugin",
@@ -43,7 +40,6 @@ let package = Package(
4340
.target(
4441
name: "USBIPDCore",
4542
dependencies: ["Common"],
46-
exclude: ["SystemExtension/README.md"],
4743
linkerSettings: [
4844
.linkedFramework("Security")
4945
]),
@@ -53,18 +49,6 @@ let package = Package(
5349
.executableTarget(
5450
name: "QEMUTestServer",
5551
dependencies: ["Common", "USBIPDCore"]),
56-
.executableTarget(
57-
name: "SystemExtension",
58-
dependencies: ["Common", "USBIPDCore"],
59-
exclude: ["Info.plist"],
60-
resources: [
61-
.copy("SystemExtension.entitlements"),
62-
.copy("Info.plist.template")
63-
],
64-
linkerSettings: [
65-
.linkedFramework("SystemExtensions"),
66-
.linkedFramework("IOKit")
67-
]),
6852
// Temporarily reduce test scope to basic functionality only
6953
.testTarget(
7054
name: "USBIPDCLITests",

Sources/Common/SystemExtensionErrors.swift

Lines changed: 0 additions & 471 deletions
This file was deleted.

0 commit comments

Comments
 (0)