Artifact ca4d9171f38b60abbae8e31aa849f1e151b426f401e601dd031d66d4d056cea1:
- File
src/attention.h
— part of check-in
[79385a1b35]
at
2026-11-14 11:41:21
on branch trunk
— suit install retries a load that failed, and says so until it works
When the loader fails, suit install now writes one item to the attention file: timers load: written but not loaded, with the loader's name and exit status, or could not run when it never started. suit status and suit status --line show it. Running suit install again, with the files unchanged and that item present, loads again in place of saying already installed. A success removes the item; suit uninstall removes it too. If writing the item fails as well, install still exits 3 and reports both.
make quick now rebuilds the dev binaries before it runs, so it cannot test a stale build.
49 new shell cases. 1269 unit checks, 477 shell cases, 669 store cases, 612 placement cases and 378 project cases, under clang, under gcc 16, with no user name set, and under a strict umask, in one run of make gate (31 minutes). 100% coverage in all 23 source files. No suite has fewer cases than at the last check-in. (user: dmestas, size: 1465) [annotate] [blame] [check-ins using]
#ifndef SUIT_ATTENTION_H #define SUIT_ATTENTION_H #include <stdbool.h> #include <stddef.h> // $SUIT_HOME/attention: what needs the user. An item is a line, "KIND NAME" // or "KIND NAME: what", and the lines indented by two spaces after it, which // belong to it. The file is written beside, synced and renamed, and is removed // when it would be empty. Each returns 0, or 1 after saying what failed. constexpr size_t ATTENTION_FILE_MAX = 131072; // Take out the items of NAME, of kind KIND (every kind if null). Writes // nothing when there is none. int attention_remove(const char *path, const char *kind, const char *name); // Replace the item KIND NAME with HEADER and DETAILS: lines, each ending in a // newline, kept under it indented (null for none). Writes nothing when the // file would not change. int attention_add(const char *path, const char *kind, const char *name, const char *header, const char *details); // Print "needs you:" and the file's lines, or nothing when there are none. int attention_print(const char *path); // How many items the file holds: its lines that are not indented. 0 in *COUNT // when it is not there. Returns 0, or 1 after saying what failed. int attention_count(const char *path, unsigned *count); // Whether the item KIND NAME is in the file: false in *HAS when it is not // there. Returns 0, or 1 after saying what failed. int attention_has(const char *path, const char *kind, const char *name, bool *has); #endif