Skip to content

bug: the target/ build directory is committed to the repository β€” it contains compiled Rust artifacts, debug symbols, and incremental build cache (~100-500MB), bloating clone size and making git clone prohibitively slow for contributorsΒ #77

Description

@divyanshim27

πŸ› Repository Hygiene Issue

The repository file listing shows a committed target/ directory. The Rust target/ directory contains:

  • target/release/clipwallet β€” the compiled binary (duplicates GitHub Releases)
  • target/debug/ β€” debug build artifacts with embedded DWARF debug symbols
  • target/.fingerprint/ β€” incremental compilation cache (machine-specific, invalid for other contributors)
  • target/deps/ β€” compiled dependency crates

Problems caused by committing target/:

  1. Clone size: A typical Rust target/ directory is 100MB–2GB. Contributors on slow connections must download all of this unnecessarily.
  2. Platform incompatibility: The macOS-compiled binary in target/release/clipwallet will not run on any other machine's architecture (x86 vs ARM). Contributors who clone and run it directly will get Exec format error.
  3. Stale cache: The incremental build fingerprints in target/.fingerprint/ are tied to the original build machine's file paths and timestamps. Cargo will likely ignore or partially invalidate them, providing no build speedup.
  4. Security: Debug binaries contain full symbol tables and may include paths from the developer's local machine, leaking directory structure information.

Proposed Fix

Step 1 β€” Remove target/ and purge from git history

# Remove from tracking
git rm -r --cached target/

# Purge from all history (required β€” git rm only removes from future commits)
pip install git-filter-repo
git filter-repo --path target --invert-paths

git push origin --force --all

Step 2 β€” Verify .gitignore is correct

The repository has a .gitignore β€” verify it includes:

# Rust build artifacts
/target/
Cargo.lock  # Optional for binaries β€” keep for reproducible builds

# macOS artifacts
.DS_Store
*.dSYM/

# Distribution artifacts β€” these are generated by build_release.sh
/dist/*.tar.gz
/dist/*.zip

Note: Cargo.lock should be committed for binary crates (it ensures reproducible builds). Only library crates should omit it.

Step 3 β€” Update the contributing guide

Document that contributors should run cargo build --release locally and never commit the target/ directory:

<!-- CONTRIBUTING or README -->
### Building from Source
After cloning, build the binary locally:
```bash
cargo build --release
# Binary is at: target/release/clipwallet
```
Do NOT commit the `target/` directory β€” it is machine-specific and ignored by `.gitignore`.

Files to Modify

File Change
target/ Delete from repository and purge from git history
.gitignore Verify /target/ is listed (add if missing)
CONTRIBUTION_CODE_OF_CONDUCT.md Add note about never committing target/

Suggested labels: bug, repository-hygiene, good first issue

I would like to work on this. Could you please assign it to me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions