Fix xcframework public headers for macOS and other slices#147
Open
AttilaTheFun wants to merge 1 commit into
Open
Fix xcframework public headers for macOS and other slices#147AttilaTheFun wants to merge 1 commit into
AttilaTheFun wants to merge 1 commit into
Conversation
2f05be2 to
d47aae0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix xcframework public headers and versioned framework layout
Summary
This updates
scripts/build.shso each generatedWebRTC.xcframeworkslice has a valid, self-contained framework layout before it is packaged.The build script now:
HeadersandWebRTCbinary paths for both versioned and unversioned framework layouts.PrivacyInfo.xcprivacytoVersions/A/Resources/and removing nestedVersionsdirectories."sdk/objc/base/RTCMacros.h"to packaged framework imports such as<WebRTC/RTCMacros.h>.RTC*.hheaders into each framework slice.Motivation
Recent release artifacts can contain incomplete framework header directories. In particular, the native macOS slice may package only
WebRTC.framework/Versions/A/Headers/WebRTC.h, while that umbrella header imports additional public headers such asRTCAudioSource.h. This makesimport WebRTCfail for macOS consumers even though the framework binary is present.There have also been simulator artifacts with public headers that still import source-tree paths like
sdk/objc/base/RTCMacros.h. Those paths are not available to SwiftPM, Bazel, CocoaPods, or Carthage consumers after the framework is packaged.The versioned macOS and Catalyst framework layouts also need to be valid for consumers that inspect or embed the framework bundle directly. A malformed nested path such as
Versions/A/Versions/A/Resources/PrivacyInfo.xcprivacycan break embedding in build systems such asrules_apple, so the packaging step now moves the privacy manifest intoVersions/A/Resources/and rejects unexpected entries underVersions/A.Repairing and validating framework layout during xcframework assembly keeps each slice independently importable and catches broken packaging before a release asset is uploaded.
Validation
I validated this locally by building WebRTC M148 with iOS, iOS simulator, macOS, and macOS Catalyst slices enabled, then checking:
sdk/objc/...imports.<WebRTC/RTC*.h>import in packaged public headers resolves to a header in the same framework slice.Versions/A/Versions/...directory.import WebRTCtypechecks for macOS, iOS simulator, iOS device, and macOS Catalyst.