FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

iOS Static Build Pipeline by CatalinVoss · Pull Request #3436 · mozilla/DeepSpeech · GitHub

This repository was archived by the owner on Jun 19, 2025. It is now read-only.
/ DeepSpeech Public archive

iOS Static Build Pipeline - #3436

Closed
CatalinVoss wants to merge 20 commits into
masterfrom
ios-static-build
Closed

CatalinVoss wants to merge 20 commits into
masterfrom
ios-static-build

Conversation

Copy link
Copy Markdown
Collaborator

This PR contributes a static build framework build pipeline for iOS, hopefully helping push #3061 along. Credit goes to @xiaoqunSun for pointing me to bazel's ios_static_framework.

Build the static framework like this:

cd tensorflow

bazel build --verbose_failures --config=ios_arm64 --workspace_status_command="bash native_client/bazel_workspace_status_cmd.sh" --apple_bitcode=embedded --copt=-fembed-bitcode --config=monolithic -c opt //native_client:deepspeech_ios --define=runtime=tflite --copt=-DTFLITE_WITH_RUY_GEMV

# Replace .framework folder in Xcode project
rm -rf ../native_client/swift/deepspeech_ios.framework
unzip bazel-bin/native_client/deepspeech_ios.zip
mv deepspeech_ios.framework ../native_client/swift/

If you want a smaller bundle and don't care about shipping apps with bitcode to Apple, you can drop the --apple_bitcode=embedded --copt=-fembed-bitcode flags.

Then the xcodebuild or Xcode app build should work to build a static framework that can be integrated into apps that can be shipped on the iOS App Store or via Testflight.

I tried my best to update the Taskcluster command, but don't want to overpromise.

I also added a basic Podspec which should provide the starting point for turning this into a Cocoa Pod if anyone wants to tackle submitting that somewhere.

Comment thread taskcluster/tc-build-utils.sh Outdated

lissyx commented Nov 24, 2020

Copy link
Copy Markdown
Collaborator

I tried my best to update the Taskcluster command, but don't want to overpromise.

Please @CatalinVoss, feel free to push as much as you need to complete taskcluster green, do not worry about abusing the resources: current usage is quite low, and we have implemented back in august optimizations that ensures high usages do not results in too high costs. Current figures shows this has been successfull, and your PR is more than welcome, so push as much as you need.

Copy link
Copy Markdown
Collaborator Author

@lissyx that's good to know. OK, thanks.

Copy link
Copy Markdown
Collaborator Author

I think we're good on TC?

lissyx commented Nov 25, 2020

Copy link
Copy Markdown
Collaborator

I think we're good on TC?

There were à few failures but its all green after rerun. I'll gave à look tomorrow, hopefully. Thanks !

Copy link
Copy Markdown
Collaborator Author

Yeah those didn't look related to me. OK

lissyx commented Nov 26, 2020

Copy link
Copy Markdown
Collaborator

Yeah those didn't look related to me. OK

They were not, but they were blocking executing a lot of the tests :)

lissyx commented Nov 26, 2020

Copy link
Copy Markdown
Collaborator

@CatalinVoss Looks good, there were two things I'm unsure about, please let us know if you need further changes or if that is good to go.

Also @reuben can correct me but I think we would like to have that on r0.9 as well ?

reuben commented Nov 26, 2020

Copy link
Copy Markdown
Contributor

I don't think so. Not suitable for a point release in its current state. Would like to get more testing on it. I'll take a closer look at the PR as well this week.

Copy link
Copy Markdown
Collaborator Author

Looks like I don't have permissions to re-trigger that one failing windows test, but it doesn't look related

lissyx commented Nov 26, 2020

Copy link
Copy Markdown
Collaborator

Looks like I don't have permissions to re-trigger that one failing windows test, but it doesn't look related

Yeah dont worry about this one, it's past deadline Anyway and it's just an intermittent

reuben left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I have a few minor comments that need to be addressed before merging but this looks great! Great find with ios_static_framework, this ended up being much simpler than I expected.

Comment thread native_client/BUILD Outdated
Comment thread native_client/BUILD Outdated

lissyx commented Dec 4, 2020

Copy link
Copy Markdown
Collaborator

lissyx commented Dec 4, 2020

Copy link
Copy Markdown
Collaborator

@CatalinVoss Sorry, but valgrind metadata tests on linux shows a memory leak regression: https://community-tc.services.mozilla.com/tasks/VizPwDWmRa-rx6i2f2z_1w/runs/0/logs/https%3A%2F%2Fcommunity-tc.services.mozilla.com%2Fapi%2Fqueue%2Fv1%2Ftask%2FVizPwDWmRa-rx6i2f2z_1w%2Fruns%2F0%2Fartifacts%2Fpublic%252Fvalgrind_extended.log

@CatalinVoss It might just be some false-positive from Valgrind:

==4364== LEAK SUMMARY:
==4364==    definitely lost: 0 bytes in 0 blocks
==4364==    indirectly lost: 0 bytes in 0 blocks
==4364==      possibly lost: 0 bytes in 0 blocks
==4364==    still reachable: 96 bytes in 2 blocks
==4364==                       of which reachable via heuristic:
==4364==                         newarray           : 9,280 bytes in 11 blocks

And you would just have to update the exclusion lists: https://github.com/mozilla/DeepSpeech/blob/master/taskcluster/tc-valgrind-utils.sh#L5-L9

reuben commented Dec 4, 2020

Copy link
Copy Markdown
Contributor

Looks like re-adding the flags that were dropped when moving from tf_cc_shared_object to cc_library fixed it: #3451

reuben closed this in bc07842 Dec 4, 2020

reuben commented Dec 4, 2020

Copy link
Copy Markdown
Contributor

Merged with the fix. Thanks @CatalinVoss!

reuben commented Dec 4, 2020

Copy link
Copy Markdown
Contributor

(Please delete the upstream branch once you're done working on it)

Copy link
Copy Markdown
Collaborator Author

Thank you for that!!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL