Skip to content

fix(ios): commit Podfile and keep libgit2 FFI symbols alive in release - #9

Merged
interset-wq merged 2 commits into
mainfrom
fix/ios-libgit2
Nov 10, 2026
Merged

interset-wq merged 2 commits into
mainfrom
fix/ios-libgit2

Conversation

@interset-wq

Copy link
Copy Markdown
Owner

Summary

  • Commit the missing ios/Podfile (platform 15.0, matching the deployment target) so iOS pod integration is deterministic instead of tool-generated on the fly.
  • Root cause of iOS: clone fails with libgit2 lifecycle exception (failed to look up symbol) #6: git2dart_binaries' pod loaded, but its -force_loaded libgit2.a was 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.
  • Fix: post_install appends -Wl,-no_dead_strip to the Runner aggregate targets' OTHER_LDFLAGS so the force-loaded objects survive.

Closes #6 (pending device regression).

Test plan

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).
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.
@interset-wq
interset-wq merged commit 8ad279a into main Nov 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS: clone fails with libgit2 lifecycle exception (failed to look up symbol)

1 participant