layer-wizard/tools/ninja-jcap
Philip Peterson a50e2d7b5e Cap ninja parallelism to stop flutter run from OOMing
flutter_tools shells out to bare `ninja -C <dir> install` with no -j
flag, so ninja defaults to nproc+2 parallel compile/link jobs. On this
6-core/7.6GiB box that's enough concurrent clang jobs (sqlite3's
single-TU amalgamation is the worst offender) to trip systemd-oomd
well before swap fills up.

Add tools/ninja-jcap, a PATH-shadowing ninja shim that caps jobs via
NINJA_JOBS (default 2), and have the Taskfile prepend it inline in the
run command. Task's `env:` block can't override PATH itself (the OS
env wins), so the shim has to go on PATH via the shell command line.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-10 10:27:11 -08:00
..
ninja Cap ninja parallelism to stop flutter run from OOMing 2026-10-10 10:27:11 -08:00