chore: stop tracking compiled rust native libraries#648
Conversation
The tc_helper native libraries (Android jniLibs *.so and the iOS tc_helper.xcframework) are build outputs of the rust/ crate, not source. Committing them across history bloated the repository to 100MB+ on clone. Remove them from the tree, git-ignore both output paths, and document and script how to regenerate them for Android (cargo-ndk) and iOS (xcframework build via build_ios.sh). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR transitions Rust native library builds from pre-built xcframework and JNI artifacts to local generation via automated scripts. Git configuration now excludes generated outputs, the README documents required build steps and output directories, and new Bash scripts automate Android and iOS compilation. ChangesNative Build Automation and Artifact Management
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
rust/README.md (1)
23-27: 💤 Low valueClarify working directory for the manual cargo command.
The
cargo ndkcommand at line 26 uses a relative path (../android/app/src/main/jniLibs) that assumes execution from therust/directory, but this isn't explicitly stated. Users might run it from the repository root and get an incorrect output path.📝 Suggested documentation improvement
Requires [`cargo-ndk`](https://github.com/bbqsrc/cargo-ndk) and the Android NDK. +From the `rust/` directory: + ```bash cargo ndk -t arm64-v8a -t armeabi-v7a -o ../android/app/src/main/jniLibs build --release🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rust/README.md` around lines 23 - 27, The README's cargo ndk example uses a relative output path that assumes you run the command from the rust/ directory; update the README to explicitly state the required working directory (e.g., "run this from the rust/ directory") or provide an alternative command using an absolute or repo-root-aware path so the cargo ndk -t arm64-v8a -t armeabi-v7a -o ../android/app/src/main/jniLibs build --release example will consistently place libraries in the intended android/app/src/main/jniLibs location; reference the shown cargo ndk command in the README to locate where to add the clarification.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@rust/README.md`:
- Around line 23-27: The README's cargo ndk example uses a relative output path
that assumes you run the command from the rust/ directory; update the README to
explicitly state the required working directory (e.g., "run this from the rust/
directory") or provide an alternative command using an absolute or
repo-root-aware path so the cargo ndk -t arm64-v8a -t armeabi-v7a -o
../android/app/src/main/jniLibs build --release example will consistently place
libraries in the intended android/app/src/main/jniLibs location; reference the
shown cargo ndk command in the README to locate where to add the clarification.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6d48c1f7-5770-4f8d-abb8-8ef748e4962b
⛔ Files ignored due to path filters (4)
android/app/src/main/jniLibs/arm64-v8a/libcrc_fast-b3182f249ae653b7.sois excluded by!**/*.soandroid/app/src/main/jniLibs/arm64-v8a/libtc_helper.sois excluded by!**/*.soandroid/app/src/main/jniLibs/armeabi-v7a/libcrc_fast-c8bd19aec5c73f3a.sois excluded by!**/*.soandroid/app/src/main/jniLibs/armeabi-v7a/libtc_helper.sois excluded by!**/*.so
📒 Files selected for processing (9)
.gitignoreios/tc_helper.xcframework/Info.plistios/tc_helper.xcframework/ios-arm64/tc_helper.framework/Info.plistios/tc_helper.xcframework/ios-arm64/tc_helper.framework/tc_helperios/tc_helper.xcframework/ios-arm64_x86_64-simulator/tc_helper.framework/Info.plistios/tc_helper.xcframework/ios-arm64_x86_64-simulator/tc_helper.framework/tc_helperrust/README.mdrust/build_android.shrust/build_ios.sh
💤 Files with no reviewable changes (3)
- ios/tc_helper.xcframework/ios-arm64/tc_helper.framework/Info.plist
- ios/tc_helper.xcframework/ios-arm64_x86_64-simulator/tc_helper.framework/Info.plist
- ios/tc_helper.xcframework/Info.plist
Summary
The
tc_helpernative libraries are build outputs of therust/crate, butthey were checked into git. That bloated the repo to 100MB+ on clone
(
.git~129MB). This PR stops tracking them and documents how to regeneratethem instead.
Addresses Part 1 of #647.
What this does
android/app/src/main/jniLibs/**/*.so(libtc_helper.so,libcrc_fast-*.so)ios/tc_helper.xcframework/(device + simulator slices)rust/build_android.sh— wrapscargo ndk(existing, documented flow).rust/build_ios.sh— buildstc_helper.xcframework(device + fat simulatorslice) via
cargo build+lipo+xcodebuild -create-xcframework. iOSbuilds were previously undocumented.
rust/README.md— notes the outputs are git-ignored and adds the iOS steps.How to build the native libs after pulling this
Note on existing clone size
This PR only stops future bloat — the old blobs remain in history until a
maintainer rewrites it (force-push). The recommended
git filter-repoprocedure and its caveats are written up in #647, and is best run right after
this merges.
Verification
.gitignoreandrust/README.mdchanges verified locally; both scripts passbash -n.cargo-ndk/xcframeworkprocedure(the iOS framework layout matches the previously committed
tc_helper.xcframework: dynamic framework,@rpathinstall name, bundle idcom.ccextractor.taskwarriorflutter.tc-helper, min iOS 13.0). I did nothave the Android NDK / Xcode toolchain available to run a full native build —
please verify a clean Android + iOS build before merging.
Test plan
cd rust && ./build_android.shproducesandroid/app/src/main/jniLibs/cd rust && ./build_ios.shproducesios/tc_helper.xcframework/flutter build apk --flavor productionsucceedsgit statusclean)Summary by CodeRabbit
Documentation
Chores