Expand description
Running an SDD’s own commands — the §5 Commands and Verification-table
rows — through sh -c: the one sanctioned shell use, and the one place
it happens.
Every command gets a TMPDIR of its own for as long as it runs, so
concurrent test sessions (the gate’s own rows, and workers building in
parallel) never share a temp root. The directories are slots, not
throwaways: a slot is exclusive while in use and stays where it is
afterwards, to be taken by the next command — so a build daemon a command
leaves behind keeps a temp directory that exists, and toolchains that tie
a daemon to its temp directory see the same few directories every time.
Under vitrify run each command also runs in its own process group and
is stopped when the run is interrupted, and holds a token of the run’s
gate pool while it runs (install_pool): one bound on the commands of
every gate, re-check and preflight in the process.
Structs§
- Memo
Runner - A runner that already knows the exit codes of the commands it will be
asked for: every Verified unit’s Verification rows, each distinct command
run once,
jobsat a time. The audit then reads the results. - Ran
- One finished command.
- ShRunner
- The audit’s command runner (check 4): plain
sh -c, one at a time. - TmpSlot
- A temp directory held by one command or one worker. Exclusive while this value lives; the directory itself is left in place for the next holder.
- Unwatched
- A watcher that does nothing, for callers no one is watching.
Traits§
- Watch
- Told as each command starts and ends: how the integrator reports its progress while a gate that prints nothing is passing.
Functions§
- alive
- Whether a process (
pid) — or, withgroup, any member of the process group it leads — still exists. - at_
priority - Run
fwith this thread’s commands waiting for a gate token atpriority(higher is served first); the previous priority is restored howeverfends. Rows run side by side inherit it. - install_
pool - Make
sizetokens the bound on every command this process runs from here on, and return the pool. The first call decides; a later one gets the pool already installed. Without one (every verb butrun), /// commands run unbounded, as their callers schedule them. - kill_
group - SIGKILL a whole process group.
- priority
- The priority this thread’s commands wait for a gate token at.
- run_
command - Run one command via
sh -cincwd, with aTMPDIRof its own. - run_
command_ watched - Run one command, telling
was it starts and ends. - run_
rows - Run
cmdsincwd, at mostjobsat once; results are index-aligned. - run_
rows_ watched run_rows, tellingwas each command starts and ends — the parallel pass and each re-run that confirms a failure alone.- slots_
root - Where the temp slots of
scopelive: a private directory under the system temp root, named by a hash of the user and the scope (kept short — tools put sockets underTMPDIR, and socket paths are length-limited). - tmp_
slot - Take the first free slot of
kindforscope(the checkout commands run in, or the root workers build under): the same few directories are handed out again and again, never two holders at once — across processes too, since a slot is held by a file lock. - unit_
text - The text of a unit’s entry: its unit file (bundle) or its
### U-###region (single). - verification_
table - The commands of a unit’s Verification table, in table order.
- verified_
commands - Every Verified unit’s Verification rows, each distinct command once, in
unit and table order: what
MemoRunner::for_verifiedruns, so a caller can count them first.