From 61143203f96933cddb31bb3913d2431078c76216 Mon Sep 17 00:00:00 2001 From: Sergio Date: Fri, 4 Sep 2026 21:55:45 +0000 Subject: [PATCH] =?UTF-8?q?firefox:=20wrappers=20de=20ar/nm/ranlib=20?= =?UTF-8?q?=E2=80=94=20zig=20los=20trae=20como=20subcomandos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Segundo fallo de configure: «ERROR: Cannot find ar». moz.configure hace check_prog("AR", …) y en el sandbox no existe un ejecutable llamado `ar`: existe `zig ar`. Un AR="zig ar" con espacio tampoco sirve, se ejecutaría como un binario único llamado «zig ar» — el mismo gotcha que ya documentan la receta de ffmpeg y el de los crates cc en las recetas Rust. Wrapper de UN SOLO TOKEN por herramienta (ar, ranlib, nm, objcopy), que es el patrón ya establecido en el corpus, exportados en configure Y en compile porque las dos fases los necesitan. El linker ya pasó: este fallo es posterior, lo que confirma que quitar --enable-linker fue correcto. --- recipes/firefox.toml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/recipes/firefox.toml b/recipes/firefox.toml index 4863b47d..36aefdf4 100644 --- a/recipes/firefox.toml +++ b/recipes/firefox.toml @@ -106,6 +106,18 @@ strip_debug = true [build.phases] configure = ''' +# ── ar/nm/ranlib: zig los trae como SUBCOMANDOS, y Firefox busca BINARIOS ────────────────────── +# `moz.configure` hace `check_prog("AR", …)` y muere con «Cannot find ar»: no existe un ejecutable +# llamado `ar` en el sandbox, existe `zig ar`. Un `AR="zig ar"` con espacio tampoco sirve — se +# ejecutaría como un binario único llamado «zig ar» (el mismo gotcha que documentan la receta de +# ffmpeg y el de los crates `cc` en las recetas Rust). La salida es un wrapper de UN SOLO TOKEN por +# herramienta, que es el patrón ya establecido en este corpus. +ZW="$PWD/.zwrap"; mkdir -p "$ZW" +for t in ar ranlib nm objcopy; do + printf '#!/bin/sh\nexec zig %s "$@"\n' "$t" > "$ZW/$t" + chmod +x "$ZW/$t" +done +export AR="$ZW/ar" RANLIB="$ZW/ranlib" NM="$ZW/nm" OBJCOPY="$ZW/objcopy" export MOZBUILD_STATE_PATH="$PWD/.mozbuild" export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system export MOZ_NOSPAM=1 @@ -143,6 +155,8 @@ MOZ # del host (medido en el LXC: 186 GiB en vez de 16), así que en un contenedor esta cuenta se degrada # a `nproc`. Es un tope, no una garantía. compile = ''' +ZW="$PWD/.zwrap" +export AR="$ZW/ar" RANLIB="$ZW/ranlib" NM="$ZW/nm" OBJCOPY="$ZW/objcopy" export MOZBUILD_STATE_PATH="$PWD/.mozbuild" export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system export MOZ_NOSPAM=1