* fix(appimage): reuse the Vulkan pywhispercpp build across CI runs The x86_64 Build AppImage step spends most of its time recompiling pywhispercpp with Vulkan. That compile depends on the base image, tool_checksums.txt, and the pywhispercpp pin, not on the commit. Cache the native tree under one key shared by CI, Nightly, and Release. * fix(appimage): reject a partial Vulkan cache and key the build tools A failed copy could leave a tree that still contained libggml-vulkan.so, and the next run would reuse it. Check each copy, and keep the previous cache until the new one is in place. The cache id now also covers the pinned cmake and ninja export and the Vulkan compile flags. The hit path is what the build calls, and a test runs it with a stub compile command. * chore(ci): rerun AppImage against the saved Vulkan cache The review fix changed the native cache id, so run 37586979294 compiled pywhispercpp again and saved appimage-native-X64-ebf478b87986e2f6b9d80c97c2f5869fe3120c2bcd48f5d8f5a65fe06ec03015. This commit leaves the base image, tool checksums, pywhispercpp pin, installer tool pins, and Vulkan compile flags alone.
50 lines
2.1 KiB
Bash
Executable File
50 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Id for the reusable pywhispercpp Vulkan build.
|
|
#
|
|
# That compile depends on the base image (glibc, and the toolchain apt installs
|
|
# from it), every pin in tool_checksums.txt, the cmake/ninja pins in
|
|
# requirements/appimage-tools.txt, the Vulkan flags in build.sh, and the
|
|
# pywhispercpp sdist install.sh names. It does not depend on the rest of the
|
|
# Vocalinux sources, so this id ignores the git commit and the Actions run id
|
|
# on purpose: putting either in the cache key would rebuild on every push.
|
|
set -euo pipefail
|
|
|
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
repo="$(cd "$here/../.." && pwd)"
|
|
pins="${VOCALINUX_PINS:-$repo/packaging/appimage/tool_checksums.txt}"
|
|
install_sh="${VOCALINUX_INSTALL_SH:-$repo/install.sh}"
|
|
tools="${VOCALINUX_APPIMAGE_TOOLS:-$repo/requirements/appimage-tools.txt}"
|
|
build_sh="${VOCALINUX_BUILD_SH:-$repo/packaging/appimage/build.sh}"
|
|
|
|
base="$(awk '$1=="base-image" {print $3; exit}' "$pins")"
|
|
if [ -z "$base" ]; then
|
|
echo "No base-image pin in $pins" >&2
|
|
exit 1
|
|
fi
|
|
pywhispercpp="$(sed -n 's/^PYWHISPERCPP_VERSION="\([^"]*\)"/\1/p' "$install_sh" | head -n1)"
|
|
if [ -z "$pywhispercpp" ]; then
|
|
echo "Could not read PYWHISPERCPP_VERSION from $install_sh" >&2
|
|
exit 1
|
|
fi
|
|
if [ ! -f "$tools" ]; then
|
|
echo "No AppImage build-tool pins at $tools" >&2
|
|
exit 1
|
|
fi
|
|
# Cache revision for the native flags. Hashing those lines, not all of
|
|
# build.sh, misses the cache when the compile changes and hits when a comment
|
|
# elsewhere in the script changes.
|
|
flags="$(awk '/GGML_VULKAN=1/ || /CMAKE_ARGS=/ { print }' "$build_sh")"
|
|
if ! printf '%s\n' "$flags" | grep -q 'GGML_VULKAN=1'; then
|
|
echo "Could not read the Vulkan compile flags from $build_sh" >&2
|
|
exit 1
|
|
fi
|
|
if ! printf '%s\n' "$flags" | grep -q 'CMAKE_ARGS='; then
|
|
echo "Could not read CMAKE_ARGS from $build_sh" >&2
|
|
exit 1
|
|
fi
|
|
pins_hash="$(sha256sum "$pins" | awk '{print $1}')"
|
|
tools_hash="$(sha256sum "$tools" | awk '{print $1}')"
|
|
printf '%s\n%s\n%s\n%s\n%s\n' \
|
|
"$base" "$pins_hash" "$pywhispercpp" "$tools_hash" "$flags" \
|
|
| sha256sum | awk '{print $1}'
|