-
Notifications
You must be signed in to change notification settings - Fork 62
Add SFSymbols direct linking support via DarwinPrivateFrameworks #810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,31 +2,20 @@ | |
| // SFSymbolsShims.swift | ||
| // OpenSwiftUICore | ||
| // | ||
| // Status: WIP | ||
|
|
||
| // MARK: - SFSymbols Framework Access | ||
| // | ||
| // Currently uses dlopen/dlsym for dynamic symbol resolution at | ||
| // runtime. This avoids a hard link dependency on the private SFSymbols | ||
| // framework. | ||
| // | ||
| // TODO: Migrate to add SFSymbols in DarwinPrivateFrameworks package and link it with a new | ||
| // OPENSWIFTUI_LINK_SFSYMBOLS build flag (following the CoreUI pattern). | ||
| // When that migration happens: | ||
| // 1. Add `import SFSymbols` under `#if OPENSWIFTUI_LINK_SFSYMBOLS`. | ||
| // 2. Replace the dlopen-based implementations with direct calls. | ||
| // 3. Call sites using `SFSymbols.symbol_order` etc. remain unchanged | ||
| // because Swift resolves `SFSymbols.x` identically whether `SFSymbols` | ||
| // is a local enum or a qualified module name. | ||
| // Status: Complete | ||
|
|
||
| #if canImport(Darwin) | ||
|
|
||
| #if OPENSWIFTUI_LINK_SFSYMBOLS | ||
| import SFSymbols | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When Severity: high 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| #else | ||
| import Foundation | ||
|
|
||
| /// Shim for the private SFSymbols framework. | ||
| /// | ||
| /// Property names intentionally use snake_case to match the framework's | ||
| /// original API surface, ensuring a seamless migration to direct linking | ||
| /// (Option C) with no source-breaking changes at call sites. | ||
| /// with no source-breaking changes at call sites. | ||
| package enum SFSymbols { | ||
| // MARK: - Module-level Properties | ||
|
|
||
|
|
@@ -75,3 +64,5 @@ package enum SFSymbols { | |
| } | ||
| } | ||
| #endif | ||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the remote-deps branch, adding
DarwinPrivateFrameworksis gated byattributeGraphCondition || renderBoxCondition || linkCoreUI || linkSFSymbols, but notlinkBacklightServices(unlike the local-deps branch). This can break builds whenLINK_COREUI=0butLINK_BACKLIGHTSERVICES=1by omitting the required package dependency.Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.