Skip to content

Zerobrew v0: Complete Implementation (Steps 2-10)#1

Merged
lucasgelfond merged 18 commits intopr/step-0-1-workspace-cifrom
pr/step-10-cli
Jan 25, 2026
Merged

Zerobrew v0: Complete Implementation (Steps 2-10)#1
lucasgelfond merged 18 commits intopr/step-0-1-workspace-cifrom
pr/step-10-cli

Conversation

@lucasgelfond
Copy link
Owner

Summary

Complete implementation of Zerobrew v0 - a fast Homebrew-compatible package installer for macOS arm64.

Phases Implemented

Phase Steps Description
2 2.1-2.2 API client with ETag caching
3 3.1-3.3 Blob cache, parallel downloads
4 4.1-4.2 Safe tar extraction, store entries
5 5.1-5.2 Materializer with APFS clonefile
6 6.1-6.2 Executable linking, SQLite state
7 7.1 Install command wiring
8 8.1-8.2 Uninstall & garbage collection
9 9.1-9.2 Benchmarking tool
10 10.1 CLI for daily driver use

Key Features

  • Parallel downloads with bounded concurrency
  • Single-flight deduplication for duplicate requests
  • Content-addressed store with file locking
  • APFS clonefile with hardlink/copy fallback
  • Safe tar extraction (rejects path traversal)
  • SQLite install state with transactions
  • ETag-based API caching

CLI Usage

zb install <formula>    # Install with dependencies
zb uninstall <formula>  # Uninstall formula  
zb list                 # List installed formulas
zb info <formula>       # Show formula info
zb gc                   # Garbage collect store

Test Results

  • 52 tests passing
  • Clippy clean
  • Smoke benchmark: ~10ms

Test plan

  • cargo test --all passes
  • cargo clippy --all-targets -- -D warnings passes
  • zb bench smoke completes in < 60s
  • zb install python3 works on macOS arm64

🤖 Generated with Claude Code

Step 7.1 - zb install:
- Add Installer struct orchestrating complete install workflow
- Plan: fetch formulas, resolve deps, select bottles
- Execute: parallel download, store unpack, cellar materialize, link
- Add InstallPlan for separating planning from execution
- Fix bottle content extraction for Homebrew tarball structure
- Add Clone derive to Formula types
- Add create_installer() factory with standard paths

Step 8.1 - Uninstall:
- Add Installer::uninstall() to clean up linked shims, cellar entry
- Decrement store refs in database
- Add NotInstalled error variant

Step 8.2 - Garbage Collection:
- Add Installer::gc() to delete unreferenced store entries
- Add Store::remove_entry() with locking

Tests:
- Integration tests with wiremock for install, uninstall, GC
@lucasgelfond lucasgelfond force-pushed the pr/step-10-cli branch 2 times, most recently from b093ef3 to f97f5ca Compare January 25, 2026 18:47
New commands in PR comments:
- @claude merge / lgtm / ship it - approve and auto-merge single PR
- @claude merge all - approve and auto-merge ALL open step PRs

PRs merge in dependency order once checks pass.
@lucasgelfond lucasgelfond merged commit 7f5f9c3 into pr/step-0-1-workspace-ci Jan 25, 2026
0 of 8 checks passed
This was referenced Jan 25, 2026
chrischabot added a commit to chrischabot/zerobrew-1 that referenced this pull request Jan 27, 2026
…ings

docs: Add services architecture and migration learnings documentation
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