-
Notifications
You must be signed in to change notification settings - Fork 787
cmd/gomobile: support Catalyst and Apple Silicon #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
create one framework for all targets: ios, simulator and catalyst, every framework contains at least one arch library, and combine all framework into one xcframework
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@dpwiese Can you confirm your consent with the bot? :) |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
This PR (HEAD: 8c9ecea) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/mobile/+/288752 to see it. Tip: You can toggle comments from me using the |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/288752. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to see this moving along, and think considering targets and architectures separately (as opposed to just treating catalyst
as a new architecture as I had) is a much more elegant approach! And great to see Apple Silicon support added. 🎉
I've built my Sample.xcframework
from this branch it it works on the target/architecture combos I've tested it quickly on: my old x86_64
mac with both simulator and catalyst, and my arm64
iPhone. Seems to work as expected. 👍
As far as tests, TestBindIOS
fails now, but that's expected and should be a quick fix of updating the templates. I also have the TestBindWithGoModules
tests failing. And finally TestIOSBuild
is failing too, but that was already the case as mentioned in #45 (comment). I'm not sure how much effort should be placed towards these tests given they are failing already, but it would be very nice to get this helpful PR merged in. 🙂
Message from Hyang-Ah Hana Kim: Patch Set 3: Run-TryBot+1 Trust+1 (6 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/288752. |
Message from Go Bot: Patch Set 3: TryBots beginning. Status page: https://farmer.golang.org/try?commit=79d4c5ae Please don’t reply on this GitHub thread. Visit golang.org/cl/288752. |
This PR (HEAD: 68a32d9) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/mobile/+/288752 to see it. Tip: You can toggle comments from me using the |
Would this PR make .xcframeworks built by gomobile compatible with Swift Package Manager (SPM)? If so, my team is very excited for this to move forward! |
I’m trying to use this fork with a
The full command output:
Go 1.16 on macOS 11.3 beta, using Xcode 12.4 on an Intel MB Pro. Edit: I forked this fork and rebased on Edit 2: it was trivial to add macOS support to gomobile in this fork, which enables the framework to be packaged and distributed via Swift Package Manager: |
This is a pretty exciting and important PR, any idea when it will get merged? Currently, if I try to install it manually, I get this strange error when I run
Error aside, it would be really cool to see this merged and pushed into stable. |
See #65 for a build that fixes that issue |
When this PR will be merged ? |
Add support for macOS (non-Catalyst) and Catalyst targets. The compiled library is packaged into a "fat" XCFramework file (as opposed to a Framework), which includes binaries for iOS, macOS, MacCatalyst (iOS on macOS), and iOS Simulator targets, for amd64 and arm64 architectures. The generated XCFramework file is suitable for distribution as a binary Swift Package Manager package: https://developer.apple.com/documentation/swift_packages/distributing_binary_frameworks_as_swift_packages This change is based on earlier work: #45 #63 Fixes golang/go#36856 Change-Id: Iabe535183c7215c68838d6c8f31618d8bceefdcf GitHub-Last-Rev: 623f8f3 GitHub-Pull-Request: #65 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/310949 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Hajime Hoshi <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Trust: Hajime Hoshi <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: Go Bot <[email protected]>
Guess we can close this PR now that the fork with these and additional changes has been merged in! Finally closure! |
closed since #65 has been merged |
Thank you so much! |
This PR is derived from #45 .
I changed the build process and it will create 3 frameworks for ios, simulator and catalyst. Every framework has a fat library contains both arm64 and x86_64 (except ios that only needs arm64).
Finally create one xcframework from all 3 fat frameworks and this xcframework contains every platform and architecture.