From 69c52c1bda7ac5c52cb6838c789d0d6362a9c5e8 Mon Sep 17 00:00:00 2001 From: PyTorch Bot Date: Thu, 10 Sep 2026 21:31:52 -0700 Subject: [PATCH] Declare the system frameworks the executorch SwiftPM product needs This is the prebuilt-binary half of the same fix. The published manifest is generated from this template, so a change to the root `Package.swift` on the main branch does not reach anyone who depends on a `swiftpm-` branch, which is what the documentation recommends. The `executorch` product declared only the C++ standard library. A package that depends on it alone and links with `-all_load` fails with 16 missing symbols: 8 from vImage, which lives in Accelerate, and 8 from Core Image. Both come from the image processor that ships inside the product. Accelerate and Core Image are the two that fix the link for most consumers. Core Graphics, Core Video and Foundation usually arrive as link hints instead, from the Swift files in the framework or from the consumer's own code when it is built with modules enabled. An Objective-C consumer built with modules off gets no such hints and needs those named too, so all five are declared. Test plan: - Rendered this template with the checksums and version of a published nightly and ran `swift package describe`, which is the check the release job performs. It passes, and both the release and debug `executorch` targets carry the five frameworks plus libc++. - Built a package against that rendered manifest and the published frameworks, depending only on the `executorch` product with `-all_load`. It links and runs, and removing just the added block brings back the 16 missing symbols. --- Package.swift.template | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Package.swift.template b/Package.swift.template index 4924399bca3..9f6db1d5e3c 100644 --- a/Package.swift.template +++ b/Package.swift.template @@ -65,6 +65,13 @@ let products = deliverables([ "executorch": [ "sha256": "__SHA256_executorch__", "sha256" + debug_suffix: "__SHA256_executorch_debug__", + "frameworks": [ + "Accelerate", + "CoreGraphics", + "CoreImage", + "CoreVideo", + "Foundation", + ], "libraries": [ "c++", ],