Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Add module version metadata to binary distributions

已關閉
#1,228 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

已經有一個關聯 PR 被合併了。

  • #1231 來自 @Kyle-Ye —— 已合併

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
swift

研究方向

Start with the build settings that publish OpenSwiftUI and OpenSwiftUICore, tracing how SWIFT_USER_MODULE_VERSION is set and how -user-module-version reaches the generated .swiftinterface files. Then inspect the distribution validation path for the iOS, macOS and visionOS slices, and compare it with the standalone DemoKit experiment. Done means version checks pass at and below 0.25.0, fail above it, and the docs explain _underlyingVersion and unversioned-module behavior.

由索引模型根據 Issue 內容生成。

描述

area: tooling type: build

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.

主要語言
Swift
星號
2.5k
分支
84
平均合併
4 小時 55 分鐘
30 天內合併 PR
73

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

OpenSwiftUIProject/OpenSwiftUI 的其他 Issue

查看 OpenSwiftUIProject/OpenSwiftUI 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。