Skip to content

repo size: ~208 MB of .zig-cache-local build artifacts are still in git history (GitHub reports ~90 MB) #767

Open

Description

@justrach

Summary

The repository weighs ~90 MB on GitHub (size = 92,650 KB via the API) even though the current HEAD tree is only 3.58 MB of content — and 2.85 MB of that is assets/logo.png. Basically all of the weight lives in git history, not in the current source: build artifacts from .zig-cache-local/ and .zig-cache-local2/ were committed at some point and, although the files were later deleted, the blobs remain in history.

Evidence

Measured on main:

Metric Value
GitHub repo size 92,650 KB (~90.5 MB)
Total blob bytes across all reachable history 269.5 MB
Blobs under .zig-cache-local* 209 objects / 207.9 MB
Current HEAD tree (all tracked files) 3.58 MB
assets/logo.png alone (tracked at HEAD) 2.85 MB
Local packed .git 49 MB

So ~208 MB of history content is Zig build cache, while the checked-out sources are under a megabyte.

Largest single blobs in history:

9,134,656  .zig-cache-local/o/40435bca1bddd9dafc626fd817bd6ca3/build_zcu.o
5,257,624  .zig-cache-local/o/40435bca1bddd9dafc626fd817bd6ca3/build
3,591,464  .zig-cache-local/o/ee904ac84d4097604e4ec01a334e3aae/test_zcu.o
3,562,808  .zig-cache-local/o/63562846be42afb502b9dcffbb39fb2e/test_zcu.o
3,479,416  .zig-cache-local2/o/06f1f62c188b4fa32d663295a4002a2d/test_zcu.o
3,479,416  .zig-cache-local/o/0e8c9548db5580712ab9efbee53d0b26/test_zcu.o

Only 4 commits ever touched these paths. They were added by the orchestration/runtime commits and removed by 2200d0a ("chore: remove tracked junk files, update gitignore") — but deleting the files does not shrink history, so every clone still downloads them. .zig-cache-local/, .zig-cache-local2/ and zig-out/ are all in .gitignore today, so this is history-only, not an ongoing regression.

Impact

  • Every clone/fetch pulls tens of MB of dead build cache; packfile download dominates first-time setup and CI checkout.
  • GitHub repo size and local .git stay inflated (~49 MB packed after compression, ~90 MB as reported by GitHub).
  • assets/logo.png at 2.85 MB is 80% of the current tree and also ships as an asset.

Suggested fix

  1. Rewrite history to drop the cache directories, e.g. git filter-repo --path .zig-cache-local/ --path .zig-cache-local2/ --invert-paths (or BFG), then force-push main and ask forks to re-clone.
  2. In the same pass, consider shrinking assets/logo.png (2.85 MB -> a few hundred KB is achievable with lossless re-compression or a resized variant).
  3. Keep the existing .gitignore entries so it cannot recur, and optionally add a CI guard that fails if a tracked path matches .zig-cache* or zig-out/.
  4. After the rewrite, verify with gh api repos/justrach/codedb --jq .size and a fresh bare clone that the report drops from ~90 MB toward the ~1 MB of real source.

Activity

  1. justrach commented on Oct 3, 2026

    @justrach
    OwnerAuthor

    @codegraff-bot can you review and fix this, perhaps see if you can replicate it in more than one ways

  2. codegraff-bot commented on Oct 3, 2026

    @codegraff-bot

    On it — I picked up:

    can you review and fix this, perhaps see if you can replicate it in more than one ways

    Running on your Codegraff account — I'll open a pull request here when it's done.

  3. codegraff-bot commented on Oct 3, 2026

    @codegraff-bot

    Done — opened #769

    🤖 codegraff-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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