Pierre Rouanet 8b1b7e5109 Three papercuts, and the two things one of them was hiding
Each was found by the docs audit (#154) and written down there rather than
fixed, because a docs change is not the place for code.

**`cargo test --workspace` now works on a Mac.** `vendor/platform.c` reaches
the bus through `linux/i2c.h`, so `build.rs` compiles it only when the *target*
is Linux — read from `CARGO_CFG_TARGET_OS`, since a build script is compiled
for the host and `cfg!` there would answer for the laptop. The driver's calls
go with it, and off a board `Sensor` is uninhabited: `open` is the only
constructor and it always fails, so the compiler discharges every other method
instead of leaving a body that could one day invent a frame. `tofd` still
builds, `tofd --fake` still serves, and 942 tests pass with nothing excluded.

**`install.sh` stops reporting `tofd` as a daemon it forgot.** The hook enables
every unit with an `[Install]` section a step earlier, so the warning was noise
on every fresh install. Named as known, with no `enable_unit` of its own:
nothing depends on it, so there is no ordering to have an opinion about.

**`dev-push.sh` checks all seven daemons**, not six — and the comment saying
five, restarted in a set of three, was two daemons out of date.

That last one could not work on its own, and finding out why turned up two
faults rather than one:

- **`tofd` published no identity.** Six daemons call `log_startup_identity!`;
  `tofd` had a hand-rolled `warn!` that logged a version and wrote no
  `/run/tofd/identity.json`. That macro exists because `padd` was once the one
  daemon whose journal could not say which build was running — and its own doc
  comment predicts this: "a shared definition makes the next daemon's omission
  a missing call rather than a missing idea". `tofd` was the next daemon.
- **`configd::units::MANAGED` was still five units.** `mediad` and `tofd`
  shipped units two releases ago. So the `units` block of `robotctl health` —
  the one a person reads after an update to find which daemon is still on the
  old release — could not report either of them at all. Same defect as the
  restart set in `restart-order.md` that #154 fixed, one file over.

Docs follow the code: the macOS caveat in CONTRIBUTING, the `tofd` note in
`restart-order.md` §6, and `dev-push.md`, which claimed `robotctl version`
could answer for `tofd` — it could not, for both reasons above.

Verified: `cargo test --workspace` 942 passing on macOS with no exclusions,
`cargo board -p tof --bins` still cross-compiles the driver for the board,
clippy clean for what this touches, `shellcheck -S warning` clean on both
scripts.

Assisted-by: Claude:claude-opus-5[1m]
2026-08-26 17:14:37 +02:00
..