Skip to content

fix(⬆️): upgrade to chrome/154 and SPM support - #471

Merged
wcandillon merged 11 commits into
mainfrom
spm
Sep 10, 2026
Merged

fix(⬆️): upgrade to chrome/154 and SPM support#471
wcandillon merged 11 commits into
mainfrom
spm

Conversation

@wcandillon

Copy link
Copy Markdown
Owner

No description provided.

@wcandillon wcandillon changed the title chore(🍏): add SPM support fix(⬆️): upgrade to chrome/154 and SPM support Sep 9, 2026
@chrfalch

Copy link
Copy Markdown

Had a look — the distribution half looks right to me. A zipped xcframework with a published SHA-256, consumed by binaryTarget(url:checksum:) pointing straight at the release asset, and the manifest generated from a template so the URL and checksum can't drift by hand. No absolute paths in the committed project either. That's the pattern I'd want for Skia too.

The one thing I'd flag is this comment in Package.swift:

React Native's CLI has no SPM autolinking for third-party TurboModule/Fabric libraries yet

That's no longer the case as of 0.87. A library that ships its own Package.swift is treated as self-managed: the autolinker references it through a symlink under the app's build dir and it consumes React Native's headers as products — ReactHeaders, ReactNativeHeaders, ReactNativeDependenciesHeaders. The codegen headers are covered too: they come from the generated build/generated/ios package as ReactAppHeaders, rather than from a per-project ReactCodegen pod. Shopify/react-native-skia#4043 does exactly this and builds Debug and Release with no CocoaPods at all, so if you'd rather not depend on pod install here, that road is open.

Three smaller things in the current approach:

  1. PODS_ROOT read at manifest-evaluation time is fragile, because SwiftPM caches manifests. I hit this last week: a fatalError in a manifest didn't re-fire until I passed --manifest-cache none. Your comment notes the variable is unset while Xcode indexes — with caching, an evaluation from that moment can persist and leave the -I list empty, which surfaces as puzzling header-not-found errors rather than anything pointing at PODS_ROOT.
  2. unsafeFlags caps distribution. SwiftPM only allows them for local/path dependencies, so this package can't be consumed by URL and version later. Fine for the local-package model, just worth knowing it's a one-way door.
  3. Pods/Headers/Public is the static-library layout. The example's Podfile still honours USE_FRAMEWORKS, and in that mode those paths won't resolve.

One thing worth building in now, while you're in this file: Skia Graphite and WebGPU have to link the exact same Dawn. The podspec enforces that today by comparing libs/.dawn-version against this package's dawn field and refusing to install on a mismatch. SwiftPM has no prepare_command, so that check needs a new home — Package.swift is plain Swift and can read both files. Without it a mismatched pair links fine and crashes at runtime.

Happy to help with any of this.

wcandillon and others added 4 commits September 10, 2026 14:47
…E to chrome-m154

chrome-m154 does not contain the upstream fix, so the workaround stays.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Resolve the Pods directory from the package location instead of relying
  on PODS_ROOT/SRCROOT, which xcodebuild never exports and which SwiftPM's
  manifest cache can freeze as empty. Drop the CI env workaround.
- Add the Skia Graphite Dawn version check to Package.swift (the podspec
  prepare-time check has no SwiftPM equivalent); bake the Dawn release tag
  into the generated manifest for it.
- Refuse RNWGPU_USE_SPM together with USE_FRAMEWORKS in the podspec: the
  manifest reads the static-library Pods/Headers/Public layout.
- Express the folly defines as .define instead of unsafeFlags; only the
  Pods include paths remain unsafe.
- Correct the manifest comment: React Native 0.87 has SwiftPM autolinking
  for self-managed packages; this manifest still targets the CocoaPods
  header model and says so. Document the constraints in the install docs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@wcandillon
wcandillon merged commit 4acc6e4 into main Sep 10, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants