Commit1f15e4e3Recorded20 Sep 2026Repositorysigil-app

Record dl-search.c's hash here too: the provenance check is two-way

Message

sigil-audio already refused a copy whose hash differed from the one it recorded; this side now records the same hash in src/c/DL-SEARCH-ORIGIN.md and test/dl-search-test.sh refuses a dl-search.c that does not match it, so an edit on either side reddens a test until the file is copied across and the hash re-recorded in both. Sabotaged with a one-line comment here: FAIL provenance; restored, GREEN.

Changed
 src/c/DL-SEARCH-ORIGIN.md | 16 ++++++++++++++++
 test/dl-search-test.sh    |  7 +++++++
 2 files changed, 23 insertions(+)
Diff
src/c/DL-SEARCH-ORIGIN.mdadded
@@ -0,0 +1,16 @@
+1
# dl-search.c is shared with sigil-audio
+2
+3
This file is the origin; sigil-audio carries a byte-identical copy
+4
(`src/c/dl-search.c` there, with `-DSIGIL_DL_SEARCH_INTERPOSE=0` and the
+5
`sigil_audio_*` names). Each repository records the hash below and its
+6
`test/dl-search-test.sh` refuses a file whose hash differs, so a change
+7
on either side reddens a test until the file is copied across and the
+8
hash re-recorded in both.
+9
+10
sha256 of `src/c/dl-search.c`:
+11
+12
c3495d28b963ff5defe58375153c96e4d9e86ced6b9d3e4fa1fbb234bac3881a
+13
+14
To change it: edit here, run this repository's test (it fails on the old
+15
hash), update the hash above, copy the file and the hash to sigil-audio's
+16
`src/c/dl-search.c` and `src/c/DL-SEARCH-ORIGIN.md`, run its test.
test/dl-search-test.shmodified
@@ -58,6 +58,13 @@ cp "$T/$FAKE" "$H/.nix-profile/lib/"
58
# 5. the override beats everything
59
mkdir -p "$T/override"; cp "$T/$FAKE" "$T/override/"
60
run override "found via SIGIL_LIBRARY_PATH as $T/override/$FAKE" SIGIL_LIBRARY_PATH="/nonexistent:$T/override" IN_NIX_SHELL=impure buildInputs="$T/nixstore/foo-1.0"
+61
# provenance: the file must be the one src/c/DL-SEARCH-ORIGIN.md records (the
+62
# same hash is recorded in the other repository that carries a copy)
+63
want=$(grep -E '^ [0-9a-f]{64}$' src/c/DL-SEARCH-ORIGIN.md 2>/dev/null | tr -d ' ')
+64
have=$(sha256sum src/c/dl-search.c | cut -d' ' -f1)
+65
if [ -z "$want" ]; then fail provenance "src/c/DL-SEARCH-ORIGIN.md missing or without a recorded sha256"
+66
elif [ "$want" = "$have" ]; then pass provenance "dl-search.c matches the hash in DL-SEARCH-ORIGIN.md"
+67
else fail provenance "dl-search.c sha256 $have, DL-SEARCH-ORIGIN.md records $want: re-record it here and copy both to the other repository"; fi
68
# the trace names the stores present on this machine
69
out=$(env -i HOME="$H" USER=sigiltest SIGIL_DESKTOP_VERBOSE=1 "$T/probe" "$FAKE" 2>&1)
70
case "$out" in *"(/gnu/store "*", /nix/store "*")"*) pass trace-stores "$(echo "$out" | grep -o '(/gnu/store [a-z]*, /nix/store [a-z]*)' | head -1)";; *) fail trace-stores "no store note in: $out";; esac