From 1586608eee7a2ecdd3cb4d9bf77a68634903083f Mon Sep 17 00:00:00 2001 From: Si Beaumont Date: Tue, 3 Nov 2026 17:17:39 +0000 Subject: [PATCH] Clarify the privacy manifest comment in the package manifest (#498) ### Motivation: The comment we have in our package manifest was a bit ambiguous about Foundation linking and caused some confusion (reported in #496). As discussed on that issue, I don't think there's anything we want to do differently here, but we can try and improve the comment so other adopters don't waste time on a misunderstanding. ### Modifications: Clarify the privacy manifest comment in the package manifest. ### Result: Fixes #496. --- Package.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 13c452ef..47e0b95f 100644 --- a/Package.swift +++ b/Package.swift @@ -49,9 +49,8 @@ var swiftSettings: [SwiftSetting] = [ swiftSettings.append(.enableExperimentalFeature("CheckImplementationOnly")) #endif -// This doesn't work when cross-compiling: the privacy manifest will be included in the Bundle and -// Foundation will be linked. This is, however, strictly better than unconditionally adding the -// resource. +// A resource makes SwiftPM generate a `Bundle.module` accessor that imports Foundation, not just FoundationEssentials. +// `canImport(Darwin)` checks the host, not the target, so cross-compiling from Darwin still adds the resource. #if canImport(Darwin) let privacyManifestExclude: [String] = [] let privacyManifestResource: [PackageDescription.Resource] = [.copy("PrivacyInfo.xcprivacy")]