From db186fe906a863d02416842133cf4a291d871fef Mon Sep 17 00:00:00 2001 From: vasilito Date: Fri, 24 Jul 2026 16:21:09 +0900 Subject: [PATCH] mesa: use host wayland-scanner for protocol codegen (fix exit 127) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit meson 26.1.4 resolves wayland-scanner from the target wayland-scanner.pc, whose absolute path is COOKBOOK_SYSROOT/usr/bin/wayland-scanner — the Redox cross binary, which cannot execute on the Linux build host (ninja: code=127 "cannot execute: required file not found") when generating fifo-v1-protocol.c etc. The $WAYLAND_SCANNER env / PATH symlink do not help (meson uses the .pc absolute path). Protocol codegen is host/target-independent, so overwrite the sysroot copy with the runnable host wayland-scanner before meson runs. Next Redox mesa port gap after alloca. --- local/recipes/libs/mesa/recipe.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/local/recipes/libs/mesa/recipe.toml b/local/recipes/libs/mesa/recipe.toml index fa098fad6e..d458fe19d7 100644 --- a/local/recipes/libs/mesa/recipe.toml +++ b/local/recipes/libs/mesa/recipe.toml @@ -53,6 +53,16 @@ ln -sf "$(command -v "${LLVM_CONFIG}")" .cookbook-tools/llvm-config if [ -x "/usr/bin/wayland-scanner" ]; then ln -sf "/usr/bin/wayland-scanner" .cookbook-tools/wayland-scanner fi +# meson 26.1.4 resolves wayland-scanner from the TARGET wayland-scanner.pc, which +# hardcodes ${COOKBOOK_SYSROOT}/usr/bin/wayland-scanner — but that is the Redox +# (cross) binary and CANNOT execute on the Linux build host (ninja fails with +# code=127 "cannot execute: required file not found"). The generated protocol C +# is host/target-independent, so replace the sysroot copy with the runnable host +# wayland-scanner. PATH/$WAYLAND_SCANNER overrides do not help because meson uses +# the .pc's absolute path. +if [ -x "/usr/bin/wayland-scanner" ] && [ -e "${COOKBOOK_SYSROOT}/usr/bin/wayland-scanner" ]; then + cp -f "/usr/bin/wayland-scanner" "${COOKBOOK_SYSROOT}/usr/bin/wayland-scanner" +fi for tool in gcc-ar gcc-ranlib g++ gcc cpp c++; do src="$(command -v "${TARGET}-${tool}" 2>/dev/null)" if [ -n "$src" ]; then