* fix(packaging): build pywhispercpp at the portable x86-64 baseline Every packaged channel shipped a libggml-cpu compiled for AVX2+FMA: the manylinux PyPI wheel itself carries -mavx2 -mfma -mbmi2 code, so any package that bundles it dies with SIGILL when whisper.cpp loads a model on a pre-Haswell CPU (the reporter's i5-3337U). GGML_NATIVE=OFF alone is not the portable baseline either; while the native default is on, ggml turns every GGML_* SIMD option on, so each is pinned off. - Snap: force the sdist (PIP_NO_BINARY) with the flag floor via CMAKE_ARGS in the part's build-environment. - Flatpak: extend the module's CMAKE_ARGS with the same floor. - Native .deb/.rpm: the build still vendors the wheels, then rebuilds libggml-cpu alone from the same hash-pinned sdist and swaps it into the vendored copies, asserting no AVX/FMA survives; the container image gains cmake, g++, make and binutils. - AppImage: extract the pinned-sdist reinstall into a shared helper and route every CPU-only fallback of the Vulkan path through a new baseline rebuild at the same floor; the Vulkan compile keeps its own flags via the same helper. Keeping the wheel on those paths was the bug's exact binary. Fixes #957 * style(tests): apply black/isort to the new packaging guards * fix(native): keep the wheel's libggml providers, alias its base/gomp sonames Swapping the whole libggml set for the baseline build broke the import smoke: the wheel's auditwheel-mangled core lib doubles as the extension's __cxa_call_terminate provider, and its NEEDED entries are the mangled names. Swap only libggml-cpu, and satisfy the baseline library's own unmangled NEEDEDs (libggml-base.so.0, libgomp.so.1) with aliases of the vendored copies, which carry no generated SIMD and are the same upstream version. Fail closed when the vendored set has restructured instead of silently shipping the AVX2 wheel. * fix(packaging): fail builds that lose the speech engine, unblock the ISA assert Greptile findings on the baseline work: - A failed baseline rebuild in the AppImage returned success after remove_appdir_pywhispercpp, so the bundle would ship with no speech engine at all while logging that the wheel was kept. Propagate the failure through every CPU-only fallback so the build stops instead. - The native libggml-cpu assertion used grep -q under pipefail, where grep's early exit SIGPIPEs objdump and the pipeline reports a miss, letting an AVX2 library through. Read the full disassembly instead. * fix(installer): build pywhispercpp from sdist on the CPU path install_cpu_pywhispercpp let pip pick the manylinux wheel, whose libggml-cpu is compiled for AVX2+FMA and SIGILLs on pre-Haswell CPUs (#957). Pass --no-binary pywhispercpp like the Vulkan/CUDA paths so the sdist compiles against this machine's own instruction set. * fix(installer): install C++ toolchain on distros that ship without one Forcing the pywhispercpp sdist on the CPU path needs a compiler, and the fedora, mageia, alpine, void and solus package maps did not request one. Add gcc-c++/make (rpm), build-base (alpine), base-devel (void) and gcc/g++/make (solus) so source installs compile on minimal systems. --------- Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>
130 lines
6.6 KiB
Bash
130 lines
6.6 KiB
Bash
#!/bin/bash
|
|
# Generated by scripts/generate_distro_package_map.py -- do not edit.
|
|
# Regenerate with `just distro-packages` after editing
|
|
# scripts/distro-package-map.yaml.
|
|
|
|
DEBIAN_13_PLUS_PROBE_PACKAGE=libgirepository-2.0-dev
|
|
|
|
load_distro_package_map() {
|
|
local package_map_key="$1"
|
|
|
|
SYSTEM_PACKAGES=()
|
|
APPINDICATOR_PACKAGES=()
|
|
GI_DEVELOPMENT_PACKAGES=()
|
|
OPTIONAL_SYSTEM_PACKAGES=()
|
|
PYTHON_PIP_SUFFIX=""
|
|
PYTHON_GOBJECT_SUFFIX=""
|
|
PYTHON_GOBJECT_CAIRO_SUFFIX=""
|
|
PYTHON_DEVEL_SUFFIX=""
|
|
PYTHON_VIRTUALENV_SUFFIX=""
|
|
PYTHON_VENV_SUFFIX=""
|
|
SHADER_COMPILER_PACKAGES=()
|
|
VULKAN_PACKAGES=()
|
|
XDOTOOL_PACKAGES=()
|
|
WTYPE_PACKAGES=()
|
|
YDOTOOL_PACKAGES=()
|
|
|
|
case "$package_map_key" in
|
|
ubuntu)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-ibus-1.0 libcairo2-dev cmake python3-dev build-essential portaudio19-dev python3-venv pkg-config wget curl unzip vulkan-tools libvulkan-dev xclip xsel wl-clipboard libssl-dev autoconf automake libtool patchelf)
|
|
APPINDICATOR_PACKAGES=(gir1.2-appindicator3-0.1 gir1.2-ayatanaappindicator3-0.1)
|
|
GI_DEVELOPMENT_PACKAGES=(libgirepository-2.0-dev libgirepository1.0-dev)
|
|
OPTIONAL_SYSTEM_PACKAGES=(util-linux-extra)
|
|
SHADER_COMPILER_PACKAGES=(glslc glslang-tools)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
debian_12)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-ibus-1.0 libcairo2-dev cmake python3-dev build-essential portaudio19-dev python3-venv pkg-config wget curl unzip vulkan-tools libvulkan-dev xclip xsel wl-clipboard libssl-dev autoconf automake libtool patchelf libgirepository1.0-dev gir1.2-ayatanaappindicator3-0.1)
|
|
OPTIONAL_SYSTEM_PACKAGES=(util-linux-extra)
|
|
SHADER_COMPILER_PACKAGES=(glslc glslang-tools)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
debian_13_plus)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-ibus-1.0 libcairo2-dev cmake python3-dev build-essential portaudio19-dev python3-venv pkg-config wget curl unzip vulkan-tools libvulkan-dev xclip xsel wl-clipboard libssl-dev autoconf automake libtool patchelf libgirepository-2.0-dev gir1.2-ayatanaappindicator3-0.1)
|
|
OPTIONAL_SYSTEM_PACKAGES=(util-linux-extra)
|
|
SHADER_COMPILER_PACKAGES=(glslc glslang-tools)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
fedora)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gobject gtk3 ibus-devel gobject-introspection-devel python3-devel portaudio-devel cairo-devel python3-virtualenv pkg-config cmake gcc-c++ make wget curl unzip vulkan-tools vulkan-loader-devel glslc patchelf xclip xsel wl-clipboard)
|
|
APPINDICATOR_PACKAGES=(libayatana-appindicator-gtk3 libappindicator-gtk3)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
arch)
|
|
SYSTEM_PACKAGES=(python-pip python-gobject gtk3 ibus gobject-introspection python-cairo portaudio python-virtualenv pkg-config cmake wget curl unzip base-devel vulkan-tools vulkan-headers shaderc patchelf xclip xsel wl-clipboard)
|
|
APPINDICATOR_PACKAGES=(libayatana-appindicator libappindicator-gtk3)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
suse)
|
|
SYSTEM_PACKAGES=(gtk3 ibus typelib-1_0-IBus-1_0 gobject-introspection-devel portaudio-devel cairo-devel pkg-config cmake gcc gcc-c++ make wget curl unzip xclip xsel wl-clipboard typelib-1_0-Notify-0_7 libnotify4 patchelf)
|
|
APPINDICATOR_PACKAGES=(typelib-1_0-AyatanaAppIndicator3-0_1 typelib-1_0-AppIndicator3-0_1 typelib-1_0-AyatanaAppIndicator-0_1 libayatana-appindicator3-1 libappindicator3-1 libappindicator-gtk3)
|
|
SHADER_COMPILER_PACKAGES=(shaderc glslang-devel glslang)
|
|
VULKAN_PACKAGES=(vulkan-tools vulkan-devel)
|
|
PYTHON_DEVEL_SUFFIX=devel
|
|
PYTHON_GOBJECT_SUFFIX=gobject
|
|
PYTHON_GOBJECT_CAIRO_SUFFIX=gobject-cairo
|
|
PYTHON_PIP_SUFFIX=pip
|
|
PYTHON_VENV_SUFFIX=venv
|
|
PYTHON_VIRTUALENV_SUFFIX=virtualenv
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
gentoo)
|
|
SYSTEM_PACKAGES=(dev-python/pygobject:3 x11-libs/gtk+:3 dev-libs/libayatana-appindicator media-libs/portaudio dev-lang/python:3.11 pkgconf cmake media-libs/shaderc dev-util/patchelf x11-misc/xclip x11-misc/xsel gui-apps/wl-clipboard)
|
|
XDOTOOL_PACKAGES=(x11-misc/xdotool)
|
|
WTYPE_PACKAGES=(x11-misc/wtype)
|
|
YDOTOOL_PACKAGES=(app-misc/ydotool)
|
|
;;
|
|
|
|
alpine)
|
|
SYSTEM_PACKAGES=(py3-gobject3 py3-pip gtk+3.0 py3-cairo portaudio-dev cairo-dev py3-virtualenv pkgconf cmake build-base wget curl unzip shaderc patchelf vulkan-tools xclip xsel wl-clipboard)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
void)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gobject gtk+3 libappindicator-gtk3 gobject-introspection portaudio-devel cairo-devel python3-devel pkg-config cmake base-devel wget curl unzip shaderc patchelf Vulkan-Tools xclip xsel wl-clipboard)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
solus)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gobject gtk3 libappindicator gobject-introspection-devel portaudio-devel cairo-devel python3-virtualenv pkg-config cmake gcc g++ make wget curl unzip shaderc patchelf vulkan-tools xclip xsel wl-clipboard)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
mageia)
|
|
SYSTEM_PACKAGES=(python3-pip python3-gobject gtk3 ibus-devel gobject-introspection-devel python3-devel portaudio-devel cairo-devel python3-virtualenv pkg-config cmake gcc-c++ make wget curl unzip vulkan-tools vulkan-loader-devel glslc patchelf xclip xsel wl-clipboard)
|
|
XDOTOOL_PACKAGES=(xdotool)
|
|
WTYPE_PACKAGES=(wtype)
|
|
YDOTOOL_PACKAGES=(ydotool)
|
|
;;
|
|
|
|
*)
|
|
echo "Unknown distro package map key: $package_map_key" >&2
|
|
return 1
|
|
;;
|
|
esac
|
|
}
|