Repository navigation
Keep first-run retryable and tolerate a missing DMI probe - #12056
scottjones wants to merge 3 commits into
Conversation
Every first-run step logs its failure and holds back the completion marker, except user finalization, whose status was discarded. A transient failure there let the later steps mark first-run complete over a user who was never finalized. Finalization is now logged and flagged like the other steps. Co-authored-by: dl-alexandre <166029845+dl-alexandre@users.noreply.github.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
run_logged sources every leaf under bash -eE, where an assignment from a failing command substitution aborts the leaf and takes every later stage down with it. Machines without DMI (Apple Silicon has none) hit that in the Surface and MacBook SPI keyboard leaves. Guard both probes, and add a test that scans every install leaf for an unguarded sysfs or procfs read. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Tests that import the Python commands under bin/ leave bin/__pycache__ behind, and the locate test then fails to decode a .pyc as UTF-8 when it runs later in the same suite. Skip bytecode while scanning. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Automated AI review
Verified: the first-run change works as described, and the DMI guard in The locate-test commit now conflicts with Verified: first-run, with finalization stubbed to fail and the real
Finalization now runs after The locate-test commit conflicts with
|
| Leaf | Base | Head |
|---|---|---|
apple/fix-spi-keyboard.sh |
exit 1, later leaves skipped | exit 0 |
fix-surface-keyboard.sh, real omarchy-hw-surface |
exit 0 (branch not entered) | exit 0 |
fix-surface-keyboard.sh, predicate forced true |
exit 1 | exit 0 |
intel/lpmd.sh, intel/thermald.sh, grep forced to fail |
exit 0 | exit 0 |
- Surface: the read sits inside
if omarchy-hw-surface, which itself needs DMIsys_vendorto be "Microsoft Corporation", so on a machine without DMI the branch never runs. The guard only matters if the predicate matches butproduct_nameis unreadable. - Intel: without
pipefail, the status ofgrep | cut | tristr's, so a failinggrepcannot make the assignment fail. The|| trueonly matters ifpipefailis enabled. These two edits are needed for the new guard test to pass, not to prevent an abort.
No other unguarded /sys or /proc read in install/ could abort a leaf under errexit.
Impact: the PR description overstates the fix: in the tested conditions, only the Apple SPI read aborted the hardware pass.
Suggested change: describe the Surface and Intel edits as consistency changes for the new test, since the PR description says leaves (plural) abort the pass.
install-leaf-guards-test.sh is a line-based check
The test greps for $(... /sys|/proc ...), then skips any line containing || and any line starting with if or elif. Run over synthetic leaves and compared with what each form does under bash -eE with the file missing:
| Form | Aborts? | Test result |
|---|---|---|
x="$(cat /sys/...)", x=$(</sys/...) |
yes | flagged |
| backticks; path in a variable; substitution split across lines | yes | passes |
if [[ ... ]]; then x=$(cat /sys/...); fi on one line |
yes | passes (skipped as an if line) |
another || elsewhere on the line |
yes | passes |
local x=$(...), echo "$(...)", [[ $(...) == ... ]] &&, pipelines without pipefail |
no | flagged |
Impact: the test name "install leaves tolerate a missing sysfs probe" claims more than the check proves. Open PRs that add the same unguarded DMI read (for example #8285, #10331 and #12286) would start failing it once this lands, which is partly the point, but it also flags harmless lines.
Suggested change: either restrict the match to plain assignment lines, or say in the test comment that it is a heuristic for the common form.
Documentation: docs/file-layout.md (line 270 at this head) still says first-run "first runs omarchy-provision-user || true". The same section already states that on failure the marker is not written and the sequence retries next login.
Optional test improvement: the new first-run test only covers a failing finalizer. A driver that always set first_run_failed=1, so first-run never completes, still passes all of first-run-test.sh. A success case that asserts the first-run-user mark would catch that.
Review information
Test scope: pinned head 400dad0d, merge base 2fbac0c8 and quattro at d3fb0284, plus a simulated merge onto that tip. The PR's tests, first-run (finalizer stubbed with fixed exit codes) and the four hardware leaves (system-changing helpers stubbed; the Intel leaves read an Intel host CPU's /proc/cpuinfo, with the grep failure injected) ran in an isolated sandbox. Missing DMI was reproduced with an empty /sys. No Apple Silicon or Surface hardware was used, so the premise that Apple Silicon has no DMI comes from the PR. The full hardware pass and the real omarchy-provision-user were not run. Overlap with other open PRs was checked by merging their heads with this one.
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
|
Reviewed at 400dad0 by Claude Opus 5.5, with Codex Medium as a second opinion. I read the diff against First-run: #11125 is the better fix for this half. Both changes stop discarding DMI guard: a real fix, and the part only this PR has. Locate test: nothing left to fix. Codex Medium also preferred #11125 for the first-run fix and agreed about the DMI and locate commits. It saw the question after I had reasoned about it, and it can read this session, so its agreement is not guaranteed to be independent. It added the Surface case above, where detection succeeds through This waits on the maintainer to choose between this PR and #11125 for the first-run fix. If #11125 lands, the DMI guard (ca166b0) is worth keeping as a PR of its own, without the first-run and locate-test commits. |
First-run discarded a failed user finalization and still marked the run complete, so a later retry never ran. Finalization is now logged and flagged like the other steps.
Hardware leaves that read DMI abort the whole hardware pass under
set -ewhen the file is missing. Guard those probes (same|| trueform on SPI and Surface), and skipbin/__pycache__in the locate test so a Python import cannot fail a later scan.