Adapter cache: hash the script content, not its path

sha256sum prints the file path next to the digest, and the build path carries
the run id, so every run produced a new cache key and rebuilt both adapters.
Read the script through stdin so only its content enters the key.
This commit is contained in:
Archipelago 2026-11-13 17:44:23 +03:00
parent f670019448
commit 10262ccfc2
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ mkdir -p "$output"
sources="$(dirname "$cache")/desktop-sources"
mkdir -p "$sources"
key=$( { sha256sum "$0"; printf '%s\n' "$mirror";
key=$( { sha256sum < "$0"; printf '%s\n' "$mirror";
( cd "$source_root" && find system/integrations/discover contracts/dbus builder/packages/plasma-setup \
-type f -print0 | LC_ALL=C sort -z | xargs -0 sha256sum ); } | sha256sum | cut -d' ' -f1 )
cached=$(dirname "$cache")/adapters/discover-$key

View file

@ -10,7 +10,7 @@ output=$4
mirror=${ARCHIPELAGO_MIRROR_URL:-'https://mirror.nw-sys.ru/archlinux/$repo/os/$arch'}
mkdir -p "$output"
key=$( { sha256sum "$0"; printf '%s\n' "$mirror";
key=$( { sha256sum < "$0"; printf '%s\n' "$mirror";
( cd "$source_root" && find system/integrations/gnome-software contracts/dbus -type f -print0 |
LC_ALL=C sort -z | xargs -0 sha256sum ); } | sha256sum | cut -d' ' -f1 )
cached=$(dirname "$cache")/adapters/software-$key