Closed heckj closed 1 year ago
Amazing job!!! You really did crack the xcframeworks thing. May I leave here an article with your learnings from your blog – I think it's very well-written article on the nitty-gritties details of under-documented xcframeworks space, and it could serve as a great reference into your thought process for anyone who comes by this PR/changes.
Thanks for taming and soundproofing this quite flaky process🙏🏻
I also submitted a PR to uniffi-rs to update their docs with this little hard-to-find detail: https://github.com/mozilla/uniffi-rs/pull/1473
resolves #6
I moved back to including the generated header and swift files from uniffi-bindgen since they need to be in lock-stop, but are used in two (potentially) different release steps down the road. The core issue with the XCFramework I encounted earlier was a admittedly arcane precondition that the modulemap file in an XCFramework must be named
module.modulemap
, and I'd incorrectly assumed that anything matching*.modulemap
would do the trick. Turns out - nope. With that sorted, the generation is fewer files by quite a bit, although it takes longer now as well, since we're generating all of iOS, iOS simulator, and macOS platform support within the single XCFramework.The relevant binary sizes for macOS:
combined macOS using lipo:
iOS:
iOS Simulator:
And combined architectures for the simulator:
Total generated XCFramework size: