Skip to content

Add Foundation ProtobufMessage conformances (URL, UUID, Data, Locale)#804

Merged
Kyle-Ye merged 1 commit intomainfrom
feature/foundation_protobuf
Mar 1, 2026
Merged

Add Foundation ProtobufMessage conformances (URL, UUID, Data, Locale)#804
Kyle-Ye merged 1 commit intomainfrom
feature/foundation_protobuf

Conversation

@Kyle-Ye
Copy link
Collaborator

@Kyle-Ye Kyle-Ye commented Mar 1, 2026

Summary

  • Add ProtobufMessage conformances for URL, UUID, Data, and Locale in a single file Foundation+ProtobufMessage.swift
  • Add C stubs and dual test file to verify encoding/decoding matches SwiftUICore's implementation
  • Reverse engineered from SwiftUICore iOS 18.5 Simulator binary via Hopper

Test plan

  • swift test --filter FoundationProtobufMessage passes all 4 test suites (URL, UUID, Data, Locale)
  • Run dual tests on device to verify SwiftUI symbol compatibility

@Kyle-Ye Kyle-Ye merged commit 9bed481 into main Mar 1, 2026
4 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the feature/foundation_protobuf branch March 1, 2026 19:11
@github-actions github-actions bot added enhancement New feature or request test Test related issue platform: iOS labels Mar 1, 2026
@augmentcode
Copy link

augmentcode bot commented Mar 1, 2026

🤖 Augment PR Summary

Summary: This PR adds protobuf serialization support for several Foundation types to better match SwiftUICore’s on-device encoding/decoding.

Changes:

  • Added `ProtobufMessage` conformances for URL, UUID, Data (WIP), and Locale in Foundation+ProtobufMessage.swift.
  • Introduced SymbolLocator-based C stubs to call SwiftUICore’s implementations for dual-compat testing.
  • Added dual tests that verify OpenSwiftUICore and SwiftUICore produce identical protobuf bytes and decode to identical values (guarded by canImport(SwiftUI, _underlyingVersion: 6.5.4)).
  • Updated the Example app view and adjusted example/package dependency resolution files.
  • Changed the package manifest to default USE_LOCAL_DEPS to enabled.

Technical Notes: URL encoding includes an optional nested base URL message; UUID uses a 16-byte data payload; tests assert exact hex encodings to ensure wire-format parity with SwiftUICore.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode 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 completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

let compatibilityTestCondition = envBoolValue("COMPATIBILITY_TEST")

let useLocalDeps = envBoolValue("USE_LOCAL_DEPS")
let useLocalDeps = envBoolValue("USE_LOCAL_DEPS", default: true)
Copy link

Choose a reason for hiding this comment

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

Defaulting USE_LOCAL_DEPS to true means a default swift build will try to resolve sibling path dependencies (e.g. ../OpenCoreGraphics, ../OpenObservation) and can fail for users/CI that don’t have those checkouts. Is it intentional that the “local deps” mode is now the default behavior?

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request platform: iOS test Test related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant