From 11386c0a5903ebf291db89eadd45c301198eb04a Mon Sep 17 00:00:00 2001 From: sergio Date: Sat, 27 Jun 2026 03:45:48 -0400 Subject: [PATCH] =?UTF-8?q?Etapa=20G:=20mirada-greeter=20CONSTRUIDO=20?= =?UTF-8?q?=E2=80=94=20primera=20app=20gr=C3=A1fica=20tawasuyu=20sobre=20e?= =?UTF-8?q?l=20stack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mirada-greeter sellado (store/41fdd015…): el greeter/login de mirada (runtime Elm Llimphi sobre winit + wgpu) compila ENTERO para musl — 314 crates incl. wgpu/winit/naga/smithay/ llimphi-* — y enlaza dinámico. Valida la cadena completa: stack gráfico (wayland+mesa) → app GUI tawasuyu real. Binario: PIE dinámico, DT_NEEDED = sólo libpam.so.0 + musl; EGL/GLES/GBM/wayland/iris se dlopen-ean en runtime (wgpu/winit), así que el rootfs debe tenerlas (mesa+wayland ya selladas). Dos blockers resueltos en el camino: - atspi/accesskit (a11y, vía accesskit_winit): zbus-lockstep-macros #[validate] PANICA («File has no extension.») al escanear xml/ de atspi-common y hacer .extension().expect() sobre el SUBDIR xml/schemas/ (lib.rs:147). Fix: fase compile custom (réplica de la fase Cargo de hammer) que setea LOCKSTEP_XML_PATH a un dir con sólo los .xml. - PAM: auth-core → pam/pam-sys hace bindgen sobre security/pam_appl.h ⇒ nueva receta linux-pam 1.6.1 (libpam.so + headers; build limpio en musl con gcc de Alpine). Co-Authored-By: Claude Opus 4.8 (1M context) --- docs/14-mesa-stack.md | 18 +++++++++--- recipes/linux-pam.toml | 24 ++++++++++++++++ recipes/mirada-greeter.toml | 55 +++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 recipes/linux-pam.toml create mode 100644 recipes/mirada-greeter.toml diff --git a/docs/14-mesa-stack.md b/docs/14-mesa-stack.md index df503101..0ca61338 100644 --- a/docs/14-mesa-stack.md +++ b/docs/14-mesa-stack.md @@ -92,11 +92,21 @@ Modeladas sobre `recipes/arje-zero.toml` (fuente = monorepo tawasuyu a commit fi |---|---|---|---| | `arje-splash` | `/usr/lib/arje/arje-splash` | static-musl | sólo DRM dumb-buffer (sin Mesa) | | `net-bring-up` | `/usr/lib/arje/net-bring-up` | static-musl | ninguna | -| `mirada-greeter` | `/usr/lib/arje/mirada-greeter-llimphi` | **dynamic** | EGL/GLES/GBM (mesa) + wayland + libseat | +| `mirada-greeter` | `/usr/bin/mirada-greeter` | **dynamic** 🟢 **built** | dlopen: EGL/GLES/GBM (mesa) + wayland; link: libpam | -`mirada-greeter` es el único que enlaza Mesa dinámico ⇒ **ya DESBLOQUEADO** (Mesa 24.0.9 sellada). -Próximo paso: receta Cargo de `mirada-greeter` con deps gráficas EGL/GLES/GBM (mesa) + wayland + -libseat, link dinámico. Los otros dos (arje-splash, net-bring-up) no dependen de Mesa. +`mirada-greeter` 🟢 **CONSTRUIDO Y SELLADO** (Cargo, 314 crates incl. todo el stack wgpu/winit/llimphi +para musl; PIE dinámico). DT_NEEDED real = sólo `libpam.so.0` + musl; **EGL/GLES/GBM/wayland/iris se +dlopen-ean en runtime** (wgpu/winit) ⇒ el rootfs debe TENERLAS presentes pero no son NEEDED. Fixes de +la receta: +- **atspi/accesskit** (a11y, vía `accesskit_winit`): `zbus-lockstep-macros` `#[validate]` PANICA + («File has no extension.») porque escanea `xml/` de atspi-common y hace `.extension().expect()` en + el SUBDIR `xml/schemas/` (zbus-lockstep-macros/src/lib.rs:147). Fix = fase `compile` custom que + apunta `LOCKSTEP_XML_PATH` a un dir con sólo los `.xml`. (Más limpio a futuro: hacer accesskit + OPCIONAL en llimphi-ui — el greeter no necesita a11y.) +- **PAM**: auth-core → `pam`/`pam-sys` hace bindgen sobre `security/pam_appl.h` ⇒ nueva receta + `linux-pam` 1.6.1 (libpam.so + headers, build limpio en musl con gcc de Alpine). + +Los otros dos (arje-splash, net-bring-up) no dependen de Mesa. ## Hecho cuando diff --git a/recipes/linux-pam.toml b/recipes/linux-pam.toml new file mode 100644 index 00000000..84c7e456 --- /dev/null +++ b/recipes/linux-pam.toml @@ -0,0 +1,24 @@ +# Linux-PAM 1.6.1 — biblioteca de autenticación (libpam). La pide `mirada-greeter` vía auth-core → +# crate `pam` → `pam-sys` (bindgen sobre `security/pam_appl.h`, enlaza libpam). Provee los headers +# `security/pam_*.h` + libpam.so para el build, y libpam en runtime para el login. +# Build mínimo: sin docs (evita xmlto/docbook), sin NLS, sin examples. autotools split (como expat). +name = "linux-pam" +version = "1.6.1" + +[source] +tarball = "https://github.com/linux-pam/linux-pam/releases/download/v1.6.1/Linux-PAM-1.6.1.tar.xz" +sha256 = "f8923c740159052d719dbfc2a2f81942d68dd34fcaf61c706a02c9b80feeef8e" + +[build] +compiler = "gcc" +target = "x86_64-linux-musl" +link = "dynamic" +flags = [] + +[build.phases] +configure = './configure --build=$CBUILD --host=$CHOST --prefix=/usr --disable-doc --disable-nls --disable-examples --disable-Werror' +compile = 'make' +install = 'make DESTDIR=/out install' + +[deps] +build = ["flex", "pkgconf"] diff --git a/recipes/mirada-greeter.toml b/recipes/mirada-greeter.toml new file mode 100644 index 00000000..42e46ceb --- /dev/null +++ b/recipes/mirada-greeter.toml @@ -0,0 +1,55 @@ +# mirada-greeter — el greeter/login de mirada (ventana Llimphi: runtime Elm sobre winit + wgpu). +# Es el PRIMER consumidor del stack gráfico Mesa en el rootfs de producto tawasuyu: corre como +# cliente wayland/winit y usa EGL/GLES vía wgpu (backend GL, ya que Mesa 24.0.9 es iris GL-only, sin +# Vulkan). Ver docs/14-mesa-stack.md §«Lado tawasuyu». +# +# Receta Cargo (patrón arje-zero/mirada-ctl): fuente = monorepo tawasuyu al MISMO commit fijado +# 9967b02c ⇒ reusa el árbol fetcheado y vendoreado (cargo vendor vendorea TODO el Cargo.lock del +# workspace, así que wgpu/winit/naga ya están). `-p mirada-greeter`, bin == package. +# +# link = DYNAMIC (a diferencia de arje-zero estático): wgpu/winit hacen dlopen de libEGL/libGLESv2/ +# libwayland en runtime ⇒ el binario NO puede ser crt-static (necesita el loader musl + dlopen). +# `link=dynamic` apaga +crt-static. Deps gráficas (Mesa/wayland/libdrm + sus .pc) materializadas por +# si algún crate las enlaza/consulta en build-time; el resto se resuelve por dlopen en el rootfs. +name = "mirada-greeter" +version = "0.0.1" + +[source] +repo = "gitea@git.tawasuyu.net:tawasuyu/tawasuyu.git" +commit = "9967b02cf597df6d065edbad8d6669b5653d4928" + +[build] +compiler = "zig-cc" +target = "x86_64-linux-musl" +link = "dynamic" +flags = ["-p", "mirada-greeter"] + +# Fases Cargo EXPLÍCITAS (réplica de la auto-generada de hammer) porque hace falta inyectar +# LOCKSTEP_XML_PATH antes del build: `accesskit_winit` → atspi → `zbus-lockstep-macros`, cuyo +# `#[validate]` escanea el dir `xml/` de atspi-common llamando `.extension().expect("File has no +# extension.")` en CADA entrada (zbus-lockstep-macros/src/lib.rs:147) ⇒ PANICA en el SUBDIR +# `xml/schemas/` (DBus.xsd/Types.xml/XMLSchema.xsd). Apuntando LOCKSTEP_XML_PATH a un dir con sólo +# los `.xml` se evita el panic. (Fix alternativo más limpio, a futuro: hacer accesskit OPCIONAL en +# llimphi-ui — el greeter no necesita a11y.) El resto del comando = wrapper zig-cc + RUSTFLAGS +# idénticos a la fase Cargo de hammer (build NATIVO alpine-musl, link dinámico vía -crt-static). +[build.phases] +compile = ''' +set -e +XMLDIR="$PWD/.atspi-lockstep-xml" +mkdir -p "$XMLDIR" +cp vendor/atspi-common/xml/*.xml "$XMLDIR"/ +export LOCKSTEP_XML_PATH="$XMLDIR" +printf '%s\n' '#!/bin/sh' 'for a do' 'case "$a" in --target=*) a=--target=x86_64-linux-musl ;; esac' 'set -- "$@" "$a"' 'shift' 'done' 'exec zig cc -mcpu=baseline "$@"' > "$PWD/.hammer-zig-cc" +chmod +x "$PWD/.hammer-zig-cc" +RF="-C linker=$PWD/.hammer-zig-cc" +rustc -vV | grep -q 'host: .*-alpine-' || RF="$RF -C link-self-contained=no" +CC="$PWD/.hammer-zig-cc" RUSTFLAGS="$RF" cargo rustc --release --locked --offline -p mirada-greeter -- -C target-feature=-crt-static +''' +install = ''' +set -e +install -Dm755 target/release/mirada-greeter /out/usr/bin/mirada-greeter +''' + +[deps] +# linux-pam: auth-core → crate `pam` → `pam-sys` hace bindgen sobre `security/pam_appl.h` y enlaza libpam. +build = ["mesa", "wayland", "wayland-protocols", "libdrm", "expat", "zlib", "zstd", "libffi", "pkgconf", "linux-pam"]