Skip to content

Modify SDK build Cocoapods inclusion to use frameworks instead of libraries #905

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

Merged
merged 10 commits into from
Apr 23, 2022

Conversation

jonsimantov
Copy link
Contributor

@jonsimantov jonsimantov commented Apr 19, 2022

Description

Provide details of the change, and generalize the change in the PR title above.

Upcoming release 9.0.0 will require that Cocoapods be included as frameworks, not as a libraries. This change modifies the existing CMake build to be able to build via frameworks. This requires adding a few different locations to the include paths, as the paths are different when using frameworks (and in a few cases e.g. GTMSesionFetcher, headers are no longer in the public location).

This PR also modifies the integration tests to add "use_frameworks! :linkage => :static" to each one; the static linkage is required for tvOS, otherwise a bug in xcodebuild causes the tvOS build to accidentally import the iOS frameworks. If the xcodebuild command-line ever fixes this issue, we can remove the static linkage workaround.


Testing

Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.

Integration test and cpp packaging runs will both be verified.


Type of Change

Place an x the applicable box:

  • Bug fix. Add the issue # below if applicable.
  • New feature. A non-breaking change which adds functionality.
  • Other, such as a build process or documentation change.

Notes

  • Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
  • Read the contribution guidelines CONTRIBUTING.md.
  • Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.

@jonsimantov jonsimantov changed the title Modify Cocoapods inclusion to use frameworks instead of libraries Modify SDK build Cocoapods inclusion to use frameworks instead of libraries Apr 19, 2022
@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Apr 19, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. labels Apr 19, 2022
@github-actions
Copy link

github-actions bot commented Apr 19, 2022

✅  Integration test succeeded!

Requested by @jonsimantov on commit 6c2f067
Last updated: Fri Apr 22 20:47 PDT 2022
View integration test log & download artifacts

@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Apr 19, 2022
@jonsimantov jonsimantov requested a review from a-maurice April 19, 2022 19:57
@jonsimantov jonsimantov marked this pull request as ready for review April 19, 2022 19:58
@github-actions github-actions bot removed the tests-requested: quick Trigger a quick set of integration tests. label Apr 19, 2022
@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Apr 19, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 19, 2022
@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Apr 21, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: failed This PR's integration tests failed. and removed tests-requested: quick Trigger a quick set of integration tests. tests: failed This PR's integration tests failed. labels Apr 21, 2022
@jonsimantov
Copy link
Contributor Author

@sunmou99 The build_testapps.py script seems to be messing something up about adding the frameworks to the tvOS builds now, with this Cocoapods change. I tried looking into what might be happening but I haven't been able to figure it out. Can you try to reproduce the issue on this branch?

@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 21, 2022
@sunmou99
Copy link
Contributor

sunmou99 commented Apr 21, 2022

@sunmou99 The build_testapps.py script seems to be messing something up about adding the frameworks to the tvOS builds now, with this Cocoapods change. I tried looking into what might be happening but I haven't been able to figure it out. Can you try to reproduce the issue on this branch?

tvOS platform shouldn't contain CoreTelephony:
https://github.com/google/GoogleDataTransport/search?q=coretelephony
But, we included it anyway.
error: CoreTelephony is not available when building for tvOS Simulator. (in target 'GoogleDataTransport-iOS' from project 'Pods')

We could change the Podfile and remove the unwanted target it before we build the testapp

@jonsimantov jonsimantov added the tests-requested: quick Trigger a quick set of integration tests. label Apr 22, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. and removed tests-requested: quick Trigger a quick set of integration tests. tests: failed This PR's integration tests failed. labels Apr 22, 2022
@jonsimantov
Copy link
Contributor Author

jonsimantov commented Apr 22, 2022

@sunmou99 The build_testapps.py script seems to be messing something up about adding the frameworks to the tvOS builds now, with this Cocoapods change. I tried looking into what might be happening but I haven't been able to figure it out. Can you try to reproduce the issue on this branch?

tvOS platform shouldn't contain CoreTelephony: https://github.com/google/GoogleDataTransport/search?q=coretelephony But, we included it anyway. error: CoreTelephony is not available when building for tvOS Simulator. (in target 'GoogleDataTransport-iOS' from project 'Pods')

We could change the Podfile and remove the unwanted target it before we build the testapp

After some more research, it seems that this is a known issue with command-line xcodebuild using the new build system. When you have multiple targets with different platforms, the command-line build seems to mistakenly include the framework dependencies from Cocoapods into all of the targets. Unfortunately, we can't use the legacy build system as it doesn't support .xcframeworks. So it seems like the best workaround is to have platform-specific Podfiles (edited on the fly by the script).

I am testing one more possible fix, setting the linkage to static - this worked one time I tested it, though it still printed some warnings.

@jonsimantov jonsimantov added the skip-release-notes Skip release notes check label Apr 23, 2022
@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Apr 23, 2022
@jonsimantov jonsimantov removed the tests: failed This PR's integration tests failed. label Apr 23, 2022
@jonsimantov
Copy link
Contributor Author

Everything looks good except an unrelated Firestore error, gonna go ahead and merge this.

@github-actions github-actions bot added the tests: failed This PR's integration tests failed. label Apr 23, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 23, 2022
@jonsimantov jonsimantov added tests: failed This PR's integration tests failed. and removed tests: failed This PR's integration tests failed. labels Apr 23, 2022
@jonsimantov jonsimantov enabled auto-merge (squash) April 23, 2022 01:08
@jonsimantov jonsimantov disabled auto-merge April 23, 2022 01:09
@jonsimantov jonsimantov enabled auto-merge (squash) April 23, 2022 01:09
@jonsimantov jonsimantov merged commit 6c2f067 into main Apr 23, 2022
@github-actions github-actions bot added tests: in-progress This PR's integration tests are in progress. tests: succeeded This PR's integration tests succeeded. labels Apr 23, 2022
@firebase-workflow-trigger firebase-workflow-trigger bot removed the tests: in-progress This PR's integration tests are in progress. label Apr 23, 2022
@jonsimantov jonsimantov deleted the bugfix/pod_frameworks branch May 3, 2022 18:08
@firebase firebase locked and limited conversation to collaborators May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
skip-release-notes Skip release notes check tests: succeeded This PR's integration tests succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants