Skip to content
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

feat: add basic support to build frameworks and zip them for the Apple Watch #12624

Conversation

jasesuperhero
Copy link
Contributor

@jasesuperhero jasesuperhero commented Mar 25, 2024

Fix #8731

These PRs add the ability to build frameworks using ReleaseTooling for Apple Watch. In my project I want to use Carthage as a dependency manager and by chance, I realized that the Firebase built frameworks do not support the architecture for Apple Watch.

The following changes are made in this PR:

As far as I understand supporting for different platforms is a part of the roadmap for the ReleaseTooling.

Copy link

google-cla bot commented Mar 25, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jasesuperhero
Copy link
Contributor Author

Sorry, I don't know how to add labels for the pr. Looks like I don't have such permissions

@paulb777 paulb777 added watchOS zip-builder Tools related to building the zip file. Carthage labels Mar 25, 2024
@paulb777
Copy link
Member

paulb777 commented Mar 25, 2024

Thanks for working on this @jasesuperhero!

There will also need to be updates to the platforms flag in the manifest to exclude products that aren't supported for watchos, like FirebaseDatabase and FirebaseFirestore.

@jasesuperhero
Copy link
Contributor Author

Thanks for working on this @jasesuperhero!

There will also need to be updates to the platforms flag in the manifest to exclude products that aren't supported for watchos, like FirebaseDatabase and FirebaseFirestore.

Thanks for the quick response! Yes, of course. I'll fix the manifest to remove unsupported frameworks.

I just have one question. I see that FirebaseDatabase supports watchos, but only since version 7. Right now all other frameworks have version 6.

What is the more correct way to proceed here? Just make it unavailable for watchos according to the documentation here or set the minimum version as 7.0 and add it to the build?

@ncooke3
Copy link
Member

ncooke3 commented Mar 25, 2024

What is the more correct way to proceed here? Just make it unavailable for watchos according to the documentation here or set the minimum version as 7.0 and add it to the build?

Thanks, @jasesuperhero. I think marking it unavailable is the way to go because the Database SDK's websocket implementation does not fully work on watchOS (more context in #10195 & https://github.com/firebase/firebase-ios-sdk/blob/10.23.0/FirebaseDatabase/CHANGELOG.md#1000).

@jasesuperhero
Copy link
Contributor Author

@ncooke3 Thanks for the clarification!
Fixed all remarks!

@jasesuperhero jasesuperhero force-pushed the dkalintsev/support-apple-watch-via-releasetooling branch 2 times, most recently from 55e473c to 0eb6770 Compare March 26, 2024 11:07
@jasesuperhero
Copy link
Contributor Author

jasesuperhero commented Mar 26, 2024

@paulb777 @ncooke3 looks like the build failed.

I checked the code and changes again and realized that it may be necessary to also add s.watchos.deployment_target = '6.0' also in Firebase.podspec. According to this error in the logs:

Here is a full log.

Output from `pod install`:
Analyzing dependencies

[!] The platform of the target `FrameworkMaker` (watchOS 6.0) is not compatible with `Firebase (10.24.0)`, which does not support `watchOS`.

Also, I changed minimumWatchOSVersion to "8.0" in useRecentVersions. As I understand it, we need to use a version higher than 6.0 in case we build frameworks with the zipPods parameter

@paulb777
Copy link
Member

Thanks, good find. The package-release job should still fail since it's building the latest release tags. package-head should succeed.

@jasesuperhero jasesuperhero force-pushed the dkalintsev/support-apple-watch-via-releasetooling branch from 0eb6770 to 650dd78 Compare March 26, 2024 21:22
@jasesuperhero
Copy link
Contributor Author

Ok, I think I understand the stages of the build and why it fell over last time. I also added platforms for GoogleAppMeasurement, Firebase podspecs.

@jasesuperhero
Copy link
Contributor Author

@paulb777 Great, the PR build is green and I tested the build again locally. Watch specific binaries included in the xcframeworks.

@paulb777
Copy link
Member

Thanks @jasesuperhero ! We appreciate the contribution. Looks good so far. We'll do a more thorough review and try to merge in for our next release.

@jasesuperhero
Copy link
Contributor Author

Hey @paulb777! I tried testing the assembled binary on a real device and when building on the Apple Watch Ultra 2, I found that it was missing some architecture. I understand that we also need to add arm64 for watchos targeting.

So I updated that and also updated the template README.md to match all available platforms.

@paulb777
Copy link
Member

Good spot! Have you confirmed the one of the zips built at https://github.com/firebase/firebase-ios-sdk/actions/runs/8468158559 addresses the Apple Watch Ultra 2 issue?

@jasesuperhero
Copy link
Contributor Author

@paulb777 I haven't had time to test the built frameworks from github yet, but I've been building them locally with the latest changes. Everything works without any problems. I also tried submitting some crashes to Crashlytics and they showed up there.

Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jasesuperhero! I'll merge now and add a release note in a subsequent PR

@paulb777 paulb777 merged commit 7455479 into firebase:main Apr 1, 2024
55 checks passed
cgrindel-self-hosted-renovate bot referenced this pull request in cgrindel/rules_swift_package_manager Apr 9, 2024
….24.0" (#1007)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[firebase/firebase-ios-sdk](https://togithub.com/firebase/firebase-ios-sdk)
| minor | `from: "10.23.1"` -> `from: "10.24.0"` |

---

### Release Notes

<details>
<summary>firebase/firebase-ios-sdk (firebase/firebase-ios-sdk)</summary>

###
[`v10.24.0`](https://togithub.com/firebase/firebase-ios-sdk/releases/tag/10.24.0):
Firebase Apple 10.24.0

[Compare
Source](https://togithub.com/firebase/firebase-ios-sdk/compare/10.23.1...10.24.0)

The Firebase Apple SDK (10.24.0) is now available. For more details, see
the [Firebase Apple SDK release
notes.](https://firebase.google.com/support/release-notes/ios#10.24.0)

To install this SDK, see [Add Firebase to your
project.](https://firebase.google.com/docs/ios/setup)

#### What's Changed

- Remove calls to fstat in crashlytics by
[@&#8203;volantwish](https://togithub.com/volantwish) in
[https://github.com/firebase/firebase-ios-sdk/pull/12531](https://togithub.com/firebase/firebase-ios-sdk/pull/12531)
- fix unit tests by
[@&#8203;themiswang](https://togithub.com/themiswang) in
[https://github.com/firebase/firebase-ios-sdk/pull/12553](https://togithub.com/firebase/firebase-ios-sdk/pull/12553)
- \[Release] Add release note for signed artifact changes by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12558](https://togithub.com/firebase/firebase-ios-sdk/pull/12558)
- Fix typo by [@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12565](https://togithub.com/firebase/firebase-ios-sdk/pull/12565)
- \[Firestore] Add a check to ensure FirestoreInternal has same public
headers as Firestore by [@&#8203;ncooke3](https://togithub.com/ncooke3)
in
[https://github.com/firebase/firebase-ios-sdk/pull/12575](https://togithub.com/firebase/firebase-ios-sdk/pull/12575)
- Carthage 10.23.0 by [@&#8203;paulb777](https://togithub.com/paulb777)
in
[https://github.com/firebase/firebase-ios-sdk/pull/12588](https://togithub.com/firebase/firebase-ios-sdk/pull/12588)
- Initial CI for visionOS by
[@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12578](https://togithub.com/firebase/firebase-ios-sdk/pull/12578)
- Upgrade cmake build to grpc 162 by
[@&#8203;wu-hui](https://togithub.com/wu-hui) in
[https://github.com/firebase/firebase-ios-sdk/pull/12417](https://togithub.com/firebase/firebase-ios-sdk/pull/12417)
- More visionOS CI by [@&#8203;paulb777](https://togithub.com/paulb777)
in
[https://github.com/firebase/firebase-ios-sdk/pull/12608](https://togithub.com/firebase/firebase-ios-sdk/pull/12608)
- Update versions for Release 10.24.0 by
[@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12594](https://togithub.com/firebase/firebase-ios-sdk/pull/12594)
- \[Release Tooling] Update XCFramework structure by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12595](https://togithub.com/firebase/firebase-ios-sdk/pull/12595)
- \[Docs] Update `FirebaseCore/CHANGELOG.md` with correct issue # by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12639](https://togithub.com/firebase/firebase-ios-sdk/pull/12639)
- Adds putFileHandle and putFileHandleAsync by
[@&#8203;mattcomi](https://togithub.com/mattcomi) in
[https://github.com/firebase/firebase-ios-sdk/pull/12580](https://togithub.com/firebase/firebase-ios-sdk/pull/12580)
- \[CocoaPods] Lock FirestoreInternal version to Firestore by
[@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12654](https://togithub.com/firebase/firebase-ios-sdk/pull/12654)
- Merge 10.23.1 by [@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12655](https://togithub.com/firebase/firebase-ios-sdk/pull/12655)
- \[Crashlytics] Fix missing Swift header error by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12659](https://togithub.com/firebase/firebase-ios-sdk/pull/12659)
- Move MIEQ to composite index tests by
[@&#8203;milaGGL](https://togithub.com/milaGGL) in
[https://github.com/firebase/firebase-ios-sdk/pull/12416](https://togithub.com/firebase/firebase-ios-sdk/pull/12416)
- feat: add basic support to build frameworks and zip them for the Apple
Watch by [@&#8203;jasesuperhero](https://togithub.com/jasesuperhero) in
[https://github.com/firebase/firebase-ios-sdk/pull/12624](https://togithub.com/firebase/firebase-ios-sdk/pull/12624)
- Release note for watchOS zip/Carthage by
[@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12670](https://togithub.com/firebase/firebase-ios-sdk/pull/12670)
- \[Crashlytics] Remove mach_absolute_time usages by
[@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12664](https://togithub.com/firebase/firebase-ios-sdk/pull/12664)
- Update to SwiftFormat 0.53.5 by
[@&#8203;paulb777](https://togithub.com/paulb777) in
[https://github.com/firebase/firebase-ios-sdk/pull/12665](https://togithub.com/firebase/firebase-ios-sdk/pull/12665)
- Fix typo: Timout -> Timeout by
[@&#8203;Jager-yoo](https://togithub.com/Jager-yoo) in
[https://github.com/firebase/firebase-ios-sdk/pull/12672](https://togithub.com/firebase/firebase-ios-sdk/pull/12672)
- \[Crashlytics] Regenerate privacy manifest by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12675](https://togithub.com/firebase/firebase-ios-sdk/pull/12675)
- \[Release] Version changelog entries for 10.24.0 by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12677](https://togithub.com/firebase/firebase-ios-sdk/pull/12677)
- \[Release Tooling] Fix METADATA.md regression introduced in
[#&#8203;12595](https://togithub.com/firebase/firebase-ios-sdk/issues/12595)
by [@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12661](https://togithub.com/firebase/firebase-ios-sdk/pull/12661)
- Analytics 10.24.0 by
[@&#8203;tsunghung](https://togithub.com/tsunghung) in
[https://github.com/firebase/firebase-ios-sdk/pull/12693](https://togithub.com/firebase/firebase-ios-sdk/pull/12693)
- \[Release] Update binary SPM Firestore distro for 10.24.0 by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12708](https://togithub.com/firebase/firebase-ios-sdk/pull/12708)
- \[Release] Update Firestore's binary deps in Package.swift by
[@&#8203;ncooke3](https://togithub.com/ncooke3) in
[https://github.com/firebase/firebase-ios-sdk/pull/12709](https://togithub.com/firebase/firebase-ios-sdk/pull/12709)

#### New Contributors

- [@&#8203;volantwish](https://togithub.com/volantwish) made their first
contribution in
[https://github.com/firebase/firebase-ios-sdk/pull/12531](https://togithub.com/firebase/firebase-ios-sdk/pull/12531)
- [@&#8203;mattcomi](https://togithub.com/mattcomi) made their first
contribution in
[https://github.com/firebase/firebase-ios-sdk/pull/12580](https://togithub.com/firebase/firebase-ios-sdk/pull/12580)
- [@&#8203;jasesuperhero](https://togithub.com/jasesuperhero) made their
first contribution in
[https://github.com/firebase/firebase-ios-sdk/pull/12624](https://togithub.com/firebase/firebase-ios-sdk/pull/12624)
- [@&#8203;Jager-yoo](https://togithub.com/Jager-yoo) made their first
contribution in
[https://github.com/firebase/firebase-ios-sdk/pull/12672](https://togithub.com/firebase/firebase-ios-sdk/pull/12672)

**Full Changelog**:
firebase/firebase-ios-sdk@10.23.1...10.24.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDkuNCIsInVwZGF0ZWRJblZlciI6IjM2LjEwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: Self-hosted Renovate Bot <361546+cgrindel-self-hosted-renovate[bot]@users.noreply.github.enterprise.com>
@firebase firebase locked and limited conversation to collaborators May 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Carthage watchOS zip-builder Tools related to building the zip file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FR: Support watchOS platform in xcframework, Carthage distribution
3 participants