Skip to content

Parallelize template Justfile recipes with mprocs - #327

Draft
Nicolapps wants to merge 4 commits into
mainfrom
nicolas/mprocs-justfile-templates
Draft

Parallelize template Justfile recipes with mprocs#327
Nicolapps wants to merge 4 commits into
mainfrom
nicolas/mprocs-justfile-templates

Conversation

@Nicolapps

@Nicolapps Nicolapps commented Jul 1, 2026

Copy link
Copy Markdown
Member

The per-template loops in install-all, _install-all-clean, regenerate-codegen, and update-ai-files now run in parallel via a shared _run-parallel recipe instead of iterating sequentially. In an interactive terminal it launches everything at once in an mprocs live TUI, using --on-all-finished (mprocs >= 0.9) so it quits automatically when every command finishes. Since mprocs is unfit for CI — it refuses to start without a TTY and always exits 0 regardless of failures — the non-interactive path uses concurrently, which runs the commands in parallel with prefixed output and exits non-zero if any command failed. So both local and CI runs are parallelized while CI still fails loudly when a template command breaks.

Nicolapps and others added 4 commits July 1, 2026 13:20
Drive the per-template loops in `install-all`, `_install-all-clean`,
`regenerate-codegen`, and `update-ai-files` through `npx mprocs@latest`
via a shared `_run-parallel` recipe. It falls back to sequential
execution when there is no TTY (e.g. CI), where mprocs would hang.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Use mprocs's `--on-all-finished` (>= 0.9) so the interactive TUI quits
on its own once every command finishes. Replace the sequential non-TTY
fallback with parallel background jobs that capture per-command output
and propagate a non-zero exit code, so CI runs in parallel and still
fails when a template command fails (mprocs itself is unfit for CI: it
needs a TTY and always exits 0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the hand-rolled background-jobs fallback with `concurrently`,
a documented tool built for non-interactive parallel execution: it
prefixes each command's output and, with the default `--success all`,
exits non-zero if any command failed. mprocs is still used for the
interactive (TTY) path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Nicolapps
Nicolapps marked this pull request as draft July 2, 2026 18:12
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