Repository navigation
fix(ios): commit Podfile and keep libgit2 FFI symbols alive in release - #9
Merged
Merged
Conversation
The iOS Runner had no committed Podfile; at CI build time the tooling generated the integration on the fly, so git2dart_binaries' pod loaded but its -force_load'd libgit2.a was treated as unreferenced (Dart AOT calls libgit2 via dlsym at runtime only) and Dead Code Stripping in the Release link removed every symbol. On device this surfaced as "libgit2 lifecycle exception: failed to look up symbol" (issue #6), making clone/pull/branch switching unusable on iOS. Commit the Podfile (platform 15.0, matching the project deployment target) and append -Wl,-no_dead_strip to the Runner aggregate targets' OTHER_LDFLAGS in post_install so the force-loaded libgit2 objects survive the release link. Verified on device separately: CI rebuild + signed install needed to confirm (issue #6).
2 tasks
flutter_ios_podspec_setup does not exist in Flutter 3.47 (the CI pin), and the Podfile never called flutter_install_all_ios_pods, so pod-only plugins such as git2dart_binaries would not be installed. Restore the standard template hooks. ld64 has no -no_dead_strip option. Set the Xcode DEAD_CODE_STRIPPING=NO build setting on the Runner aggregate xcconfig instead, which removes -dead_strip from the final link and keeps the force-loaded libgit2 objects.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ios/Podfile(platform 15.0, matching the deployment target) so iOS pod integration is deterministic instead of tool-generated on the fly.git2dart_binaries' pod loaded, but its-force_loadedlibgit2.awas treated as unreferenced (Dart AOT calls libgit2 via dlsym at runtime only) and stripped entirely by Dead Code Stripping in the Release link — on device:libgit2 lifecycle exception: failed to look up symbol.post_installappends-Wl,-no_dead_stripto the Runner aggregate targets'OTHER_LDFLAGSso the force-loaded objects survive.Closes #6 (pending device regression).
Test plan
temp/ios-test/results.md)