Parallelism
How to run independent prerequisites at the same time. Part of the guides; full syntax in the language guide.
Concept
Section titled “Concept”By default a task’s dependencies run sequentially. Adding the [parallel] attribute lets
its independent dependencies run concurrently, bounded by the available cores. The task
itself still runs only after all its dependencies succeed.
Syntax
Section titled “Syntax”[parallel]checks: lint test typecheck @echo "all checks passed"
lint: @echo "lint"test: @echo "test"typecheck: @echo "typecheck"lint, test, and typecheck run together; checks runs once they all finish.
Runnable example
Section titled “Runnable example”See examples/parallel.
Pitfalls
Section titled “Pitfalls”- Order between parallel tasks is not guaranteed. Don’t rely on
lintfinishing beforetest— if there’s a real ordering need, make one depend on the other. - Interleaved output. Concurrent tasks’ output can interleave; use task-level logging if you need to attribute lines.
- Shared mutable state. Parallel tasks that write the same file will race — keep them independent, or serialize them with a dependency.
Next steps
Section titled “Next steps”- Dependencies & post-hooks — the ordering model parallelism builds on.
- Caching — combine with
[cache]to skip unchanged parallel steps.