Xcode 27 SDK breaks identifier/value/hint reads, lazy-stack traversal, GeometryReader

#442 · closed · 2 comments

View on GitHub ↗

DanMelbourne

Building with the Xcode 27 (macOS 27) SDK, ViewInspector 0.10.3 fails three ways — verified with Mirror dumps of the new internals: 1. AccessibilityProperties moved from struct fields to storage: [Entry] (key is a metatype: IdentifierKey, ValueStorageKey, HintsKey, LabelKey, VisibilityKey). Every v4 properties|<field>| path misses, so find(viewWithAccessibilityIdentifier:), accessibilityValue(), accessibilityHint(), non-Text accessibilityLabel() and accessibilityHidden() throw on all OS versions running the new SwiftUI. (Also: entry keys must be named with String(describing:), not Inspector.typeName(value:), which reports metatypes as Any.Type.) 2. Unhosted lazy stacks no longer materialize tree|content (plain {alignment, spacing, pinnedViews, content} struct now). LazyVStack/HStack/Grids traverse to zero children. 3. GeometryProxy outgrew the hardcoded 48/52-byte surrogate allocators: unsafeBitCast trap (Fatal error: Can't unsafeBitCast between types of different sizes) kills any traversal through a GeometryReader. Reference fix (try-new-shape-first, fall back to old paths, so one build runs on both SDKs) on a 0.10.3-based branch here: https://github.com/DanMelbourne/ViewInspector/tree/macos27-support (tag 0.10.3-patch1). Happy to rebase onto 0.10.4 on request — a direct cherry-pick conflicts because 0.10.4 touched the same files.

Comments

nalexn

0.10.4 is now available

DanMelbourne

Thanks for 0.10.4 — the three fixes themselves look right, but the tag can't be resolved by SwiftPM. `Package.swift` still declares `// swift-tools-version:5.9`, while 0.10.4 changed the platforms line from `.visionOS(.v1)` to `.visionOS(.v2)`. `.v2` is `@available(_PackageDescription 6.0)`, so the manifest fails to compile for every consumer: ``` error: Invalid manifest (compiled with: [... "-package-description-version", "5.9.0", "/Package.swift" ...]) /Package.swift:10:74: error: 'v2' is unavailable 10 | .macOS(.v12), .iOS(.v15), .tvOS(.v15), .watchOS(.v9), .visionOS(.v2) | `- error: 'v2' is unavailable PackageDescription.SupportedPlatform.VisionOSVersion.v2:4:23: note: 'v2' was introduced in PackageDescription 6.0 ``` Reproduced on Xcode 27 / macOS 27 SDK with a throwaway package that has no other dependencies: ```swift // swift-tools-version:5.9 import PackageDescription let package = Package( name: "vitest", platforms: [.macOS(.v14)], dependencies: [.package(url: "https://github.com/nalexn/ViewInspector", exact: "0.10.4")], targets: [.target(name: "vitest")] ) ``` `swift package resolve` fails there too, so it isn't specific to my project. There's no `[email protected]` alongside the manifest, so nothing selects a newer PackageDescription. Two ways out. Reverting that one token to `.visionOS(.v1)` is the smaller change; bumping the manifest to `// swift-tools-version:6.0` also switches the package to the Swift 6 language mode, which is a much larger blast radius for a patch release. The good news: with only that line patched in a local checkout, 0.10.4's source passes all 9 of the regression tests I wrote for this report — accessibility identifier/value/hint reads through `storage: [Entry]`, unhosted `LazyVStack`/`LazyHStack` traversal, and traversal through a `GeometryReader`. So the fixes are solid; it's only the tag that can't be consumed.