sow build
sow build updates local indexes to match Desired membership and current configuration. Run it after add --skip, rm --skip, or a policy change. It recovers unfinished local Repository operations before starting the next build.
Synopsis
| Flag | Meaning | Default |
|---|---|---|
-j, --jobs N |
Parallel workers; must be at least 1 |
logical CPU count |
-C, --workdir DIR |
Workspace discovery start directory | current directory |
-r, --repo NAME |
Select a Repository | selection rules |
-d, --dist NAME |
Build named Dists; repeatable | all affected Dists |
-T, --timeout DUR |
Maximum lock wait; 0 waits indefinitely |
0 |
-N, --no-wait |
Fail immediately when the lock is held | false |
--json |
Output JSON | false |
Without -d, SOW builds every affected Dist in the selected Repository. With -d, only those
Dists are built; unselected changes remain dirty.
Result
Without --json, build prints one human-readable summary:
Use --json to read the result in a script.
No-op builds
When membership, relevant policy, renderer settings, and signing configuration already match the
Built Generation, build is an idempotent no-op and does not increment the Generation:
Apply policy changes
build re-evaluates the current exclude and limit policy. Tightening policy may remove Desired
Membership. Loosening policy does not reconstruct historical members from leftover pool bytes; run
sow add again for packages you want to restore.
Commit and recovery
SOW moves required pending packages into pool/, writes the indexes, then updates client entry points such as repomd.xml and Release. One build can include several Dists. They share the resulting Generation; unselected dirty Dists still need a build.
If a build stops, rerun it. SOW uses the operation journal to finish or roll back the unfinished work. If the journal, database, and files disagree, the command reports an integrity error. Use sow check and sow log to identify the affected state.
Progress events
Long builds append structured build_progress records to the Operation log. Each event
contains phase, completed, total, and jobs. Current phases are:
rendering;promoting_payload;publishing_dists;normalizing_public_tree;finalizing.
Inspect the events with sow log OPERATION.
Metadata signing
Configure metadata signing in sow.yml.
Changing a configured key reference or fingerprint makes affected Dists dirty, and the next build
re-signs their metadata.
- RPM: always writes
repodata/repomd.xml; writesrepomd.xml.ascwhen configured. - DEB: always writes
Release; writesInReleaseandRelease.gpgwhen configured.
Exit codes
| Code | Trigger |
|---|---|
0 |
Build completed or nothing to do |
1 |
Renderer, signing, or filesystem failure |
2 |
Usage error, Workspace not found, or implicit Repository selection is ambiguous |
4 |
Repository write lock unavailable |
5 |
Recovery cannot complete safely, or Repository is in error |
6 |
Explicit scope is not configured, or current configuration rejects existing state |
See also
sow status— determine whether a build is neededsow check— verify the resulting treesow changes— inspect the resulting file delta- Transactions & Recovery — full commit protocol