Skip to content

chore: stop tracking compiled rust native libraries#648

Open
BrawlerXull wants to merge 1 commit into
CCExtractor:mainfrom
BrawlerXull:chore/remove-prebuilt-native-libs
Open

chore: stop tracking compiled rust native libraries#648
BrawlerXull wants to merge 1 commit into
CCExtractor:mainfrom
BrawlerXull:chore/remove-prebuilt-native-libs

Conversation

@BrawlerXull
Copy link
Copy Markdown
Collaborator

@BrawlerXull BrawlerXull commented May 27, 2026

Summary

The tc_helper native libraries are build outputs of the rust/ crate, but
they were checked into git. That bloated the repo to 100MB+ on clone
(.git ~129MB). This PR stops tracking them and documents how to regenerate
them instead.

Addresses Part 1 of #647.

What this does

  • Removes the committed build artifacts from the tree:
    • android/app/src/main/jniLibs/**/*.so (libtc_helper.so, libcrc_fast-*.so)
    • ios/tc_helper.xcframework/ (device + simulator slices)
  • Git-ignores both output paths so they aren't re-committed.
  • Documents + scripts regeneration:
    • rust/build_android.sh — wraps cargo ndk (existing, documented flow).
    • rust/build_ios.sh — builds tc_helper.xcframework (device + fat simulator
      slice) via cargo build + lipo + xcodebuild -create-xcframework. iOS
      builds 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

cd rust

# Android (needs cargo-ndk + Android NDK)
./build_android.sh

# iOS (needs Xcode CLT + iOS rust targets)
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
./build_ios.sh

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-repo
procedure and its caveats are written up in #647, and is best run right after
this merges.

Verification

  • .gitignore and rust/README.md changes verified locally; both scripts pass
    bash -n.
  • The build scripts encode the standard cargo-ndk / xcframework procedure
    (the iOS framework layout matches the previously committed
    tc_helper.xcframework: dynamic framework, @rpath install name, bundle id
    com.ccextractor.taskwarriorflutter.tc-helper, min iOS 13.0). I did not
    have 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.sh produces android/app/src/main/jniLibs/
  • cd rust && ./build_ios.sh produces ios/tc_helper.xcframework/
  • flutter build apk --flavor production succeeds
  • iOS build succeeds and the app launches (framework embeds correctly)
  • generated artifact dirs stay untracked (git status clean)

Summary by CodeRabbit

  • Documentation

    • Updated build instructions for native dependencies, clarifying that compiled libraries must be generated locally.
  • Chores

    • Added build automation scripts for native library compilation on Android and iOS platforms.
    • Updated ignore rules to exclude local build artifacts and development configuration files from version control.
    • Cleaned up committed build artifacts that are now generated locally.

Review Change Stack

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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

📝 Walkthrough

Walkthrough

This 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.

Changes

Native Build Automation and Artifact Management

Layer / File(s) Summary
Build process documentation and git configuration
.gitignore, rust/README.md (lines 3–11)
Git ignore rules exclude generated native artifacts and cache directories. README overview explains that compiled Rust libraries are not committed and must be generated locally.
Android native build automation
rust/README.md (lines 23–34), rust/build_android.sh
Android build instructions document cargo-ndk and NDK prerequisites, provide the full compile command, and reference the new build helper script. build_android.sh runs cargo ndk for two ABIs and outputs to android/app/src/main/jniLibs/.
iOS native build automation
rust/README.md (lines 35–51), rust/build_ios.sh
iOS instructions document Rust target installation and use of the new build_ios.sh script. The script cross-compiles for device and simulator, builds per-target .framework bundles, generates Info.plist metadata for each, and packages both into a single .xcframework for Xcode integration.
Remove metadata from old committed artifacts
ios/tc_helper.xcframework/ios-arm64/tc_helper.framework/Info.plist
Delete Info.plist from the arm64 framework slice within the pre-built xcframework structure, signaling transition from committed artifacts to local builds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 From binaries locked in git's embrace,
We craft a script-driven, build-time place.
Android and iOS dance through the fold,
Fresh native libraries, generated, bold.
The artifacts vanish—.gitignore knows,
Where local machines reap what each build sows.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore: stop tracking compiled rust native libraries' directly and clearly summarizes the main change: removing tracked build artifacts and stopping their version control.
Description check ✅ Passed The description is comprehensive and well-structured, covering summary, what was done, how to rebuild, and verification steps, though it does not follow the exact template structure with all sections.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
rust/README.md (1)

23-27: 💤 Low value

Clarify working directory for the manual cargo command.

The cargo ndk command at line 26 uses a relative path (../android/app/src/main/jniLibs) that assumes execution from the rust/ 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

📥 Commits

Reviewing files that changed from the base of the PR and between f058b4a and 63774f5.

⛔ Files ignored due to path filters (4)
  • android/app/src/main/jniLibs/arm64-v8a/libcrc_fast-b3182f249ae653b7.so is excluded by !**/*.so
  • android/app/src/main/jniLibs/arm64-v8a/libtc_helper.so is excluded by !**/*.so
  • android/app/src/main/jniLibs/armeabi-v7a/libcrc_fast-c8bd19aec5c73f3a.so is excluded by !**/*.so
  • android/app/src/main/jniLibs/armeabi-v7a/libtc_helper.so is excluded by !**/*.so
📒 Files selected for processing (9)
  • .gitignore
  • ios/tc_helper.xcframework/Info.plist
  • ios/tc_helper.xcframework/ios-arm64/tc_helper.framework/Info.plist
  • ios/tc_helper.xcframework/ios-arm64/tc_helper.framework/tc_helper
  • ios/tc_helper.xcframework/ios-arm64_x86_64-simulator/tc_helper.framework/Info.plist
  • ios/tc_helper.xcframework/ios-arm64_x86_64-simulator/tc_helper.framework/tc_helper
  • rust/README.md
  • rust/build_android.sh
  • rust/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

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.

1 participant