Skip to content

Add module version metadata to binary distributions #1228

Closed

Description

@Kyle-Ye

Summary

Add module version metadata to published OpenSwiftUI binaries so consumers can check a minimum release at compile time:

#if canImport(OpenSwiftUI, _version: 0.25.0)
import OpenSwiftUI
#endif

Scope

  • Set SWIFT_USER_MODULE_VERSION from the release version for the OpenSwiftUI and OpenSwiftUICore targets.
  • Preserve -user-module-version in the public .swiftinterface files for every published platform slice.
  • Keep dependency framework versions independent of the OpenSwiftUI release version.
  • Document the use of _version and the behavior of older binaries without module version metadata.

Acceptance criteria

  • Version checks succeed for the published version and lower versions, and fail for higher versions.
  • The checks work when consumers load only the public textual interfaces on iOS, macOS, and visionOS.
  • Distribution validation checks both the expected version and an upper boundary.
  • Documentation explains that _underlyingVersion checks the underlying Clang module, and that an unversioned Swift module warns and ignores the requested version rather than selecting the false branch.

A standalone DemoKit experiment has verified the build setting, version boundaries, and public interface behavior across the five Apple SDK slices.

Activity

  1. added this to the 0.25.0 milestone on Oct 25, 2026
  2. added
    area: tooling
    type: build
    on Oct 25, 2026
  3. linked a pull request that will close this issuefeat: add binary module version metadata #1231on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: toolingtype: build

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions