Skip to content

Add SFSymbols direct linking support via DarwinPrivateFrameworks#810

Merged
Kyle-Ye merged 1 commit intomainfrom
workspace
Mar 8, 2026
Merged

Add SFSymbols direct linking support via DarwinPrivateFrameworks#810
Kyle-Ye merged 1 commit intomainfrom
workspace

Conversation

@Kyle-Ye
Copy link
Collaborator

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

Summary

  • Add LINK_SFSYMBOLS build flag and OPENSWIFTUI_LINK_SFSYMBOLS Swift define following the CoreUI pattern
  • Bump DarwinPrivateFrameworks dependency to include the new SFSymbols product
  • Replace dlopen/dlsym shim with direct import SFSymbols when the flag is enabled, keeping the dlopen fallback for non-linking builds

Test plan

  • Verify swift build succeeds with OPENSWIFTUI_USE_LOCAL_DEPS=1
  • Verify SFSymbolsShimsTests pass on Darwin
  • Verify non-Darwin / SPI builds still compile (dlopen fallback)

@Kyle-Ye Kyle-Ye merged commit 6945325 into main Mar 8, 2026
2 of 8 checks passed
@Kyle-Ye Kyle-Ye deleted the workspace branch March 8, 2026 06:35
@augmentcode
Copy link

augmentcode bot commented Mar 8, 2026

🤖 Augment PR Summary

Summary: Adds optional direct linking to the private SFSymbols framework via DarwinPrivateFrameworks.

Build: Introduces LINK_SFSYMBOLS env flag and OPENSWIFTUI_LINK_SFSYMBOLS Swift define, mirroring the CoreUI pattern.

Deps: Updates Package.resolved to a newer DarwinPrivateFrameworks revision that includes an SFSymbols product.

SwiftPM: Wires the SFSymbols product into OpenSwiftUICore when linking is enabled.

Runtime: Uses direct import SFSymbols under the flag, otherwise keeps the dlopen/dlsym shim for non-link builds.

Goal: Enable direct symbol access while preserving portability/fallback behavior.

🤖 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. 2 suggestions posted.

Fix All in Augment

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

#if canImport(Darwin)

#if OPENSWIFTUI_LINK_SFSYMBOLS
import SFSymbols
Copy link

Choose a reason for hiding this comment

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

When OPENSWIFTUI_LINK_SFSYMBOLS is enabled this file no longer defines the SFSymbols shim type, but other files/tests reference SFSymbols.* without importing the SFSymbols module (e.g. Sources/OpenSwiftUICore/View/Image/NamedImage.swift, Tests/OpenSwiftUICoreTests/Util/SFSymbolsShimsTests.swift). That will likely become an unresolved identifier compile error in linking builds.

Severity: high

Fix This in Augment

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

.package(url: "https://github.com/OpenSwiftUIProject/OpenObservation", branch: "main"),
]
if attributeGraphCondition || renderBoxCondition || linkCoreUI {
if attributeGraphCondition || renderBoxCondition || linkCoreUI || linkSFSymbols {
Copy link

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 DarwinPrivateFrameworks is gated by attributeGraphCondition || renderBoxCondition || linkCoreUI || linkSFSymbols, but not linkBacklightServices (unlike the local-deps branch). This can break builds when LINK_COREUI=0 but LINK_BACKLIGHTSERVICES=1 by omitting the required package dependency.

Severity: medium

Fix This in Augment

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

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 13.99%. Comparing base (7425dc9) to head (4ec0a05).
⚠️ Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (7425dc9) and HEAD (4ec0a05). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (7425dc9) HEAD (4ec0a05)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #810       +/-   ##
===========================================
- Coverage   27.41%   13.99%   -13.43%     
===========================================
  Files         660      624       -36     
  Lines       42376    37809     -4567     
===========================================
- Hits        11619     5290     -6329     
- Misses      30757    32519     +1762     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant