Migrate Apple native builds from Xcode projects to GN#4164
Open
mattleibow wants to merge 3 commits into
Open
Conversation
Contributor
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4164PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4164"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4164/packages --name skiasharp-pr-4164More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4164 |
Contributor
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
1d90176 to
70786a8
Compare
Replace the hand-maintained Xcode projects for libSkiaSharp and
libHarfBuzzSharp with the existing GN `skiasharp_build` targets, matching
how Linux, Windows, WASM and Android already build.
- Delete all 6 *.xcodeproj bundles (ios/tvos/macos × both libs) and
scripts/infra/native/apple/xcode.cake.
- Rewrite native/{ios,tvos,macos}/build.cake to drive GN/ninja only.
- Add scripts/infra/native/apple/apple.cake (CombineFrameworks, StripSign,
RunLipo, RunZip) for the post-GN lipo/strip/codesign/zip steps.
- macOS ships a plain fat .dylib (@rpath/lib<N>.dylib); iOS/tvOS/MacCatalyst
frameworks are emitted directly by GN with link-time framework-relative
install_name and provenance-complete Info.plist; Cake only lipos per-arch
frameworks together and strips/codesigns last.
- Bump externals/skia to pull in the GN-emits-framework support.
- Document the new flow in update-skia known-gotchas (#23).
Verified against the released 3.119.0 baseline on all four Apple platforms
(symbol counts 887 sk_/gr_ + 560 hb_, fat archs, framework-relative
install_name, valid codesign, Info.plist key parity). iOS simulator and
Mac Catalyst test suites pass 5548/0.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
70786a8 to
420d8fc
Compare
…ff-main # Conflicts: # externals/skia
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.
Fixes #4168
Summary
Migrate the Apple native builds (libSkiaSharp + libHarfBuzzSharp for macOS, iOS, tvOS and Mac Catalyst) off the hand-maintained Xcode projects and onto the existing GN
skiasharp_buildtargets — the same path Linux, Windows, WASM and Android already use.Lands cleanly off
main(independent of the in-flight C-API-move work) to give a simpler baseline and avoid conflicts. Requires the submodule half: mono/skia#256.Changes
*.xcodeprojbundles (ios/tvos/macos × both libs) andscripts/infra/native/apple/xcode.cake.native/{ios,tvos,macos}/build.caketo drive GN/ninja only.scripts/infra/native/apple/apple.cake(CombineFrameworks, StripSign, RunLipo, RunZip) for the post-GN lipo/strip/codesign/zip steps..dylib(@rpath/lib<N>.dylib); iOS/tvOS/MacCatalyst frameworks are emitted directly by GN with link-time framework-relative install_name and a provenance-completeInfo.plist; Cake only lipos the per-arch frameworks together and strips/codesigns last.externals/skiato pull in the GN-emits-framework support (Emit Apple .framework from the skiasharp_build GN target skia#256).update-skiaknown-gotchas (Text measurement support #23).Verification
Built from source for every Apple platform and checked against the released 3.119.0 baseline (per platform × both libs):
sk_/gr_, 560hb_)x86_64 arm64)Versions/A/for Mac Catalyst)x86_64→LC_VERSION_MIN_*,arm64→LC_BUILD_VERSIONInfo.plistkey set identical to the released NuGets (Mac Catalyst:UIDeviceFamily [2],LSMinimumSystemVersion 10.15)Runtime tests: iOS simulator (iPhone 14 Pro) and Mac Catalyst both pass 5548 / 0.
Dependency
skiasharp). Merge that first, then this PR's submodule pointer is valid.