The Zig build and the Python tool¶
The Zig build in zig/ carries every command of the Python tool: probe,
status, resolve, retire, gc, run, resume and rollback, with or
without --ledger-config, and the ledger maintenance entry point as
ledger-maintenance, and the build_events module’s entry point
(python3 -m eb_staged_rebuild.build_events) as build-events. The Python
tool stays the one to use until the test suite passes against the binary
through TOOL_BIN.
tests/differential.sh runs both on the same invocations and fails on any
difference in exit code, stdout or stderr; for the commands that change a fixture
(retire, gc, rollback, run, resume) it also compares the journals and
the trees they leave, with timestamps and the sandbox command normalized, and,
for whole runs, the sha256 of module text that names each fixture’s own path.
Where the Zig build differs on purpose¶
case |
Python tool |
Zig build |
|---|---|---|
|
wrapped to the terminal width ( |
the 80-column text |
usage lines and argparse errors |
as the running Python’s argparse prints them, which changes between releases |
as Python 3.14 prints them |
a module file or journal that is not UTF-8 |
a Python traceback, exit 1 |
|
a journal that is not valid JSON |
|
the same start, then |
a journal value that |
a Python traceback, exit 1 |
|
program output that is not UTF-8 (bwrap, eb) |
a decoding error |
decoded with U+FFFD for invalid bytes |
|
Python |
ASCII decimal and exponent forms |
a lock wait longer than about 49 days |
waits that long |
capped at 2^32 ms |
|
|
|
a signal while |
the exception unwinds, releasing the lock |
the process prints the same message and exits 128 + signal; the kernel releases the lock |
|
the JSON decoder’s message |
|
the user-namespace probe |
|
|
the ledger maintenance entry point |
|
|
ledger, head or manifest text that is not valid JSON |
|
the same start, then the reason and the character offset |
|
any Unicode decimal digit |
ASCII digits only |
a manifest string with an unpaired |
accepted, and escaped again in the appended record |
refused: |
an integer in a head, record or manifest beyond 64 bits |
accepted |
refused: |
an operating-system error with no fixed text in the Zig build |
|
|
|
argparse’s option help |
a short list of the options and which are required |