Skip to content

feat(packages): parallel brew formula and cask installation#108

Open
jdcodes1 wants to merge 3 commits intomojwang:mainfrom
jdcodes1:feat/parallel-brew-installs
Open

feat(packages): parallel brew formula and cask installation#108
jdcodes1 wants to merge 3 commits intomojwang:mainfrom
jdcodes1:feat/parallel-brew-installs

Conversation

@jdcodes1
Copy link
Copy Markdown

@jdcodes1 jdcodes1 commented Apr 11, 2026

Hey Marvin 👋 I emailed you about wanting to work at Netflix- I'm a great fit for multiple roles (UI & TV UI engineer). Shooting my shot here as well- love this project you're working on (would have been really helpful onboarding).

Summary

  • Replaces sequential brew install with parallel installation using xargs -P
  • Formulae install at 4x (configurable via SETUP_PARALLEL_FORMULAE), casks at 2x (SETUP_PARALLEL_CASKS)
  • Collects install results via temp directory files for accurate success/failure reporting
  • Adds 31 unit tests covering Brewfile parsing, result collection, concurrent write safety, and install helper behavior

How it works

Instead of installing packages one-by-one in a while loop, the script now:

  1. Collects packages that need installing (skipping already-installed ones)
  2. Installs them in parallel via xargs -P with exported helper functions
  3. Reports results from temp files that track installed vs failed packages

Expected speedup: 40-60% on fresh installs with 30+ formulae.

Test plan

  • bash tests/unit/test_parallel_install.sh — 31/31 tests pass
  • Run ./setup.sh on a clean machine to verify end-to-end
  • Run ./setup.sh on an existing setup to verify skip-if-installed works
  • Test with custom parallelism: SETUP_PARALLEL_FORMULAE=1 ./setup.sh (sequential fallback)
  • Verify brew bundle fallback still triggers on failure

jdcodes1 and others added 3 commits April 10, 2026 22:04
Replace sequential brew install loops with xargs -P for parallel
installation. Formulae default to 4 parallel jobs, casks to 2.
Configurable via SETUP_PARALLEL_FORMULAE and SETUP_PARALLEL_CASKS
env vars. Preserves skip-if-installed logic and error tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover Brewfile parsing, font detection, parallel result collection,
concurrent write safety, install helper success/failure paths, parallelism
configuration via env vars, and the collect-then-install pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants