Commitdd655351Recorded20 Sep 2026Repositorysigil-audio
DL-SEARCH-ORIGIN.md: the check is two-way now; the test's provenance block matches sigil-desktop's
Changed
src/c/DL-SEARCH-ORIGIN.md | 2 +-
test/dl-search-test.sh | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)Diff
src/c/DL-SEARCH-ORIGIN.mdmodified
@@ -1,7 +1,7 @@
1
# dl-search.c is a copy 2
3
`dl-search.c` (and `test/dl-search-probe.c`, `test/dl-search-test.sh`) is−4
sigil-desktop's `src/c/dl-search.c`, byte for byte, configured here with+4
sigil-desktop's `src/c/dl-search.c`, byte for byte (sigil-desktop records the same hash in its own `src/c/DL-SEARCH-ORIGIN.md`, so a change on either side reddens a test), configured here with 5
`-DSIGIL_DL_SEARCH_INTERPOSE=0` and the `sigil_audio_*` names (see 6
`package.sgl`). The one file serves both packages because a program may 7
link either without the other (a game links both; motif's CLI links onlytest/dl-search-test.shmodified
@@ -58,13 +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: this copy must be the one src/c/DL-SEARCH-ORIGIN.md records−62
if [ -f src/c/DL-SEARCH-ORIGIN.md ]; then−63
want=$(grep -E '^ [0-9a-f]{64}$' src/c/DL-SEARCH-ORIGIN.md | tr -d ' ')−64
have=$(sha256sum src/c/dl-search.c | cut -d' ' -f1)−65
if [ "$want" = "$have" ]; then pass provenance "dl-search.c matches the hash in DL-SEARCH-ORIGIN.md"−66
else fail provenance "dl-search.c sha256 $have, DL-SEARCH-ORIGIN.md records $want: recopy from sigil-desktop or update the record"; fi−67
fi+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_AUDIO_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