fix(ci): add-on packs compress the same on every runner (#2938)

The proot pack pin check failed on GitHub-hosted runners for PRs that do
not touch proot. The hosted image puts the latest upstream zstd (1.5.7)
in /usr/local/bin, while the self-hosted runners use zstd 1.5.5, and
zstd -19 output differs between those versions for identical tar input.

tools/packs/build.sh now compresses every pack with the zstd version
pinned in tools/packs/zstd/release.env: the system zstd when it is that
version, otherwise the checksum-verified upstream release built once
into the pack input cache.
This commit is contained in:
MaxsTechReview authored and GitHub committed 2026-11-20 10:27:17 -05:00
1 parent e58b463f54
commit acb2cba970
3 files changed
+22 -2

No files matched your search

+19 -1
View File
@@ -11,6 +11,8 @@ linuxfs="$repo/app/src/main/assets/linuxfs/usr/local/lib"
source "$here/tracking/release.env"
# shellcheck source=butler/release.env
source "$here/butler/release.env"
# shellcheck source=zstd/release.env
source "$here/zstd/release.env"
work=$(mktemp -d)
trap 'rm -rf "$work"' EXIT
@@ -21,6 +23,22 @@ fetch() {
bash "$here/fetch-verified.sh" "$@"
}
zstd_version() { "$1" -V 2>/dev/null | sed -n 's/.* v\([0-9][0-9.]*\),.*/\1/p'; }
zstd=$(command -v zstd || true)
if [ -z "$zstd" ] || [ "$(zstd_version "$zstd")" != "$ZSTD_VERSION" ]; then
zstd="${DROIDDECK_PACK_CACHE:-"$HOME/.cache/droiddeck-pack-inputs"}/zstd-$ZSTD_VERSION/zstd"
if [ ! -x "$zstd" ] || [ "$(zstd_version "$zstd")" != "$ZSTD_VERSION" ]; then
fetch "https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz" \
"$ZSTD_SHA256" "$work/zstd.tar.gz"
tar -xzf "$work/zstd.tar.gz" -C "$work"
make -s -C "$work/zstd-$ZSTD_VERSION" -j"$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2)" zstd-release >/dev/null
mkdir -p "$(dirname "$zstd")"
install -m755 "$work/zstd-$ZSTD_VERSION/programs/zstd" "$zstd.part.$$"
mv -f "$zstd.part.$$" "$zstd"
fi
fi
[ "$(zstd_version "$zstd")" = "$ZSTD_VERSION" ] || { echo "packs need zstd $ZSTD_VERSION, $zstd is not it" >&2; exit 1; }
pack() {
local name=$1 src=$2
shift 2
@@ -47,7 +65,7 @@ with tarfile.open(dest, "w", format=tarfile.USTAR_FORMAT) as tar:
with open(path, "rb") as f:
tar.addfile(info, f)
EOF
zstd -q -19 -f "$work/$name.tar" -o "$out/$name.tar.zst"
"$zstd" -q -19 -f "$work/$name.tar" -o "$out/$name.tar.zst"
echo "$name $(sha256 "$out/$name.tar.zst") $(wc -c < "$out/$name.tar.zst" | tr -d ' ')"
}
+2
View File
@@ -0,0 +1,2 @@
ZSTD_VERSION=1.5.5
ZSTD_SHA256=9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4