Repository navigation
feat(🍏): download the Apple binaries from GitHub releases (CocoaPods/SPM) - #640
Merged
wcandillon merged 4 commits intoNov 24, 2026
Merged
Conversation
theeket
force-pushed
the
feat/apple-sdk-binary-preparation
branch
4 times, most recently
from
November 22, 2026 12:06
729c912 to
85ce5b4
Compare
theeket
marked this pull request as ready for review
November 22, 2026 14:52
Contributor
Author
|
What's going on there: flowchart TD
%% Installation configures linking; binary downloads wait for Xcode.
subgraph SETUP["Installation — no binary downloads"]
NPM["npm / yarn install<br/>JS, Dawn headers, binaries.json"]
CP["CocoaPods: pod install<br/>Configure library links and pod-target phase"]
SPM["Optional SwiftPM: spm update<br/>RN 0.87.1+ plugin generates<br/>link-settings package and app-target phase"]
NPM --> CP
NPM --> SPM
PIN["Installed binaries.json<br/>Release tag, asset SHA-256, Dawn commit"]
NPM -.-> PIN
end
CP --> PHASE
SPM --> PHASE
%% The same shell implementation handles both integrations.
PHASE["Every Xcode build<br/>prepare-apple-binaries.sh<br/>Bash and system tools; no Node"]
PHASE --> SDK["Select SDK and variant from Xcode<br/>Apply ARCHS, EXCLUDED_ARCHS, ONLY_ACTIVE_ARCH<br/>Catalyst selects maccatalyst, not native macOS"]
%% WebGPU always supplies its own Dawn.
SDK --> LOCAL{"Local Dawn directory exists?<br/>libs/apple"}
LOCAL -->|Yes| OVERRIDE["Use local SDK folder read-only<br/>Never overwrite or download replacements"]
OVERRIDE --> VALID
LOCAL -->|No| ASSET["Locate selected SDK's Dawn asset in pin<br/>Shared Skia/WebGPU cache keyed by release tag and ZIP SHA-256"]
PIN -.-> ASSET
ASSET -->|Asset missing| FAIL
ASSET --> CACHE{"Cached ZIP exists<br/>and SHA-256 matches?"}
%% Downloads are bounded, verified, and synchronized across builds.
CACHE -->|No| DOWNLOAD["Download selected SDK ZIP only<br/>GitHub, mirror, or file:///<br/>Bounded retries; verify SHA-256"]
DOWNLOAD -->|Download or checksum failure| FAIL
DOWNLOAD -->|Verified| MARKER
CACHE -->|Yes: no download| MARKER{"Extraction marker matches SHA-256?"}
MARKER -->|Yes: reuse extracted files| VALID
MARKER -->|No| EXTRACT["Check archive paths<br/>Extract temporarily; atomically replace cache"]
EXTRACT --> VALID
VALID{"SDK metadata valid?<br/>Platform, variant, required architectures,<br/>library, and deployment minimum"}
VALID -->|No| FAIL
VALID -->|Yes| ROOT["Assembly root under OBJROOT<br/>Version + manifest hash<br/>Source signature: ZIP hash or local metadata/file stats"]
%% A changed pin selects new storage; old binaries cannot silently win.
PIN -. "Changed tag or SHA selects new cache entry" .-> ASSET
PIN -. "Changed manifest selects new assembly root" .-> ROOT
subgraph INCREMENTAL["Incremental preparation — synchronized per build root"]
ROOT --> SAME{"Source signature unchanged<br/>and SDK slice files exist?"}
SAME -->|Yes: reuse container| STAGED
SAME -->|No| COMPOSE["Atomically append or replace current SDK slice<br/>Preserve other SDK slices for this manifest<br/>Update Info.plist from metadata<br/>No compilation or lipo"]
COMPOSE --> STAGED
STAGED{"Staged signature matches<br/>and linker archive exists?"}
STAGED -->|Yes: skip copy| LINK
STAGED -->|No| COPY["Stage selected SDK as librnwgpu_webgpu_dawn.a<br/>APFS clone or ordinary copy"]
COPY --> LINK
end
LINK["Compile WebGPU wrapper using bundled headers<br/>Statically link prepared Dawn into app/framework<br/>No Dawn XCFramework embedding"]
FAIL["Stop build with actionable Xcode error<br/>Clean temporary files and release owned locks"]
%% Highlight SDK selection, downloads, preparation, and final linking.
classDef selection fill:#dbeafe,stroke:#2563eb,color:#111827,stroke-width:2px;
classDef download fill:#ffedd5,stroke:#ea580c,color:#111827,stroke-width:2px;
classDef preparation fill:#ccfbf1,stroke:#0f766e,color:#111827,stroke-width:2px;
classDef linking fill:#ede9fe,stroke:#7c3aed,color:#111827,stroke-width:2px;
classDef failure fill:#fee2e2,stroke:#b91c1c,color:#111827;
class SDK selection;
class DOWNLOAD download;
class PHASE,COMPOSE preparation;
class LINK linking;
class FAIL failure;
|
theeket
force-pushed
the
feat/apple-sdk-binary-preparation
branch
2 times, most recently
from
November 22, 2026 15:33
f2f7c80 to
88a36fd
Compare
theeket
force-pushed
the
feat/apple-sdk-binary-preparation
branch
from
November 22, 2026 15:38
88a36fd to
af523f6
Compare
Pins the first release with SDK-grouped Apple archives. Same Dawn commit as 158.0.0.
wcandillon
self-requested a review
November 24, 2026 14:28
wcandillon
approved these changes
Nov 24, 2026
- Ignore the dormant Skia demos in the example's ESLint config, matching tsconfig.json (fixes the failing lint step in CI). - Restore the RNWGPU_USE_SPM stub mode of the podspec so apps that link through SwiftPM but still run CocoaPods don't get the module twice. - Keep Dawn's headers out of the pod's public headers instead of setting header_mappings_dir, preserving the flat public header layout. - Serialize stale lock recovery so a waiter never removes a lock another build has just taken over. - Treat minimumDeploymentTarget as optional in SDK metadata.
|
🎉 This PR is included in version 0.24.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This was referenced Nov 24, 2026
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.
ℹ️ This PR requires prebuilt binaries from react-native-skia#4494, and its updated
binaries.jsonSummary
Android already download the prebuilt binaries from GitHub releases (#628); released in
0.22.0,This PR uses the same CocoaPods/SwiftPM preparation workflow as react-native-skia#4498. See other changes there.
WebGPU-specific changes:
react-native-webgpu-dawn; headers ship insidereact-native-webgpu.Other minor changes (in this PR) to be able to test:
spm-exampleto support scene lifecycle. Otherwise it will crash in Xcode 27.pod installwill fails.Validation: