gnome: SPIDERMONKEY (mozjs 128) SELLA en el hub — keystone caído

El motor JS de Mozilla, keystone del frente GNOME (gjs→gnome-shell cuelgan de él),
sella b3:c48dbd10: libmozjs-128.so + libjs_static.a + shell js128 + mozjs-128.pc +
550 headers. Compiló el C++ entero a -O3 -j8 sin OOM en el hub (31GB/0 swap, al filo).

Seis capas iteradas desde el borrador:
  1-2. FIX DE INFRA: el rootfs builder tenía clang pero NO el paquete  (Alpine
       separa los binutils LLVM del compilador). Sin llvm-ar/llvm-objdump/llvm-profdata
       configure aborta. bootstrap-devfs.sh: +llvm22 en NEEDED + paso 3a-ter que
       symlinkea la suite llvm-* a /usr/bin (Alpine la deja en /usr/lib/llvm22/bin sin
       exponerla). Aplicado ya al rootfs real (.dev-fs/alpine).
  3. triple: mozjs no traduce vendor ; 4. debe COINCIDIR con el host de rustc
     (); fijado ese exacto.
  5. venv de mach: cada fase es un bwrap con /tmp fresco ⇒ el venv no sobrevivía de
     configure a compile. Anclado a /src/.mozbuild (persiste, es scratch).
No re-hashea artefactos (el rootfs no entra al hash). OJO: el worker golden también
necesita llvm22 (ya cubierto por bootstrap-devfs.sh para la próxima provisión).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-24 14:17:13 -04:00
co-authored by Claude Opus 4.8
parent ebac490f39
commit 9a028ba04f
3 changed files with 46 additions and 19 deletions
+13 -14
View File
@@ -3,8 +3,8 @@
"totals": {
"recipes": 773,
"nodes": 782,
"sealed": 768,
"never": 3,
"sealed": 769,
"never": 2,
"debt": 2,
"wanted": 9
},
@@ -17,7 +17,7 @@
"wanted": 9
},
"debt_by_class": {
"c": 3,
"c": 2,
"gui": 1,
"rust": 1
},
@@ -28,8 +28,7 @@
"debt": 2
},
"incoming-gnome": {
"sealed": 3,
"never": 1,
"sealed": 4,
"wanted": 9
}
},
@@ -1862,7 +1861,7 @@
"hash": "b3:e59e41932a98d1b2e81e31bb8637e41a44b678d4fc694caf2a11cff98afae4b6",
"state": "sealed",
"blocked_by": [],
"unblocks": 1,
"unblocks": 0,
"perfiles": [],
"dependientes_total": 1
},
@@ -8344,7 +8343,7 @@
"hash": "b3:fbad44acdc76df4b081cccd3cc02666664b6d1a03cd6fa482f85791fa533a602",
"state": "sealed",
"blocked_by": [],
"unblocks": 2,
"unblocks": 1,
"perfiles": [
"base",
"cli",
@@ -9137,7 +9136,7 @@
"hash": "b3:33383070e28a0e75d4f6ddaa9e93a13968e8ad1932c6c149ad04defac660f9f0",
"state": "sealed",
"blocked_by": [],
"unblocks": 1,
"unblocks": 0,
"perfiles": [],
"dependientes_total": 1
},
@@ -9403,7 +9402,7 @@
"hash": "b3:d7b71315b334e4bb7b34670a070a37f273611c87b7c1b2d59c6576dec0b4baaa",
"state": "sealed",
"blocked_by": [],
"unblocks": 1,
"unblocks": 0,
"perfiles": [],
"dependientes_total": 1
},
@@ -10108,7 +10107,7 @@
"hash": "b3:f0b5d0b1cb4321b3c61f24a871b9a58da3ebb7eb903af4015e35bd41a6465437",
"state": "sealed",
"blocked_by": [],
"unblocks": 3,
"unblocks": 2,
"perfiles": [
"base",
"cli",
@@ -10401,7 +10400,7 @@
"hash": "b3:27889026076514935b53d486951792d08ed7fd5210b44e7f92979c03c96be665",
"state": "sealed",
"blocked_by": [],
"unblocks": 1,
"unblocks": 0,
"perfiles": [
"base",
"cli",
@@ -11468,8 +11467,8 @@
],
"cls": "c",
"queue": "incoming-gnome",
"hash": "b3:016d512a3f5aa51cde553f65ed0b8b09e95ee57e62de2d60305a1479b4058071",
"state": "never",
"hash": "b3:c48dbd1016a3ff2da124fcc98eacd135e5b2d3acae66f9553ef8d41bc1c0905d",
"state": "sealed",
"blocked_by": [],
"unblocks": 0,
"perfiles": [],
@@ -13637,7 +13636,7 @@
"hash": "b3:28522f99f433496dbaacfa309f8e937d6526ac3c8db34b4a94b18e22656dcd33",
"state": "sealed",
"blocked_by": [],
"unblocks": 4,
"unblocks": 3,
"perfiles": [
"base",
"cli",
+14 -4
View File
@@ -27,11 +27,21 @@ target = "x86_64-linux-musl"
link = "dynamic"
[build.phases]
# MOZBUILD_STATE_PATH/MOZ_NOSPAM: mach escribe estado y telemetría; los fijamos a /tmp y los callamos.
# MOZBUILD_STATE_PATH: mach crea ahí su virtualenv de build. CADA fase es un bwrap aparte con
# `--tmpfs /tmp`, así que un venv en /tmp NO sobrevive de configure a compile ("bin/python: No such
# file or directory"). Lo anclamos a /src/.mozbuild (bind RW, persiste entre fases; es scratch, no
# entra a /out ⇒ no afecta el artefacto). MOZ_NOSPAM calla la telemetría. Va en las tres fases.
# Se construye en un obj-dir separado dentro de js/src (idioma de mozjs). CC/CXX=clang explícitos.
configure = "export MOZBUILD_STATE_PATH=/tmp/.mozbuild MOZ_NOSPAM=1 SHELL=/bin/sh PYTHON=python3 && cd js/src && mkdir -p obj && cd obj && CC=clang CXX=clang++ AR=llvm-ar ../configure --prefix=/usr --host=$CHOST --target=$CHOST --disable-debug --enable-optimize --enable-release --enable-hardening --disable-jemalloc --enable-shared-js --disable-tests --without-system-icu --with-system-nspr --with-system-zlib"
compile = "cd js/src/obj && make -j\"$(nproc)\""
install = "cd js/src/obj && make DESTDIR=/out install"
# AR=llvm-ar: mozjs con clang quiere la suite binutils de LLVM (llvm-ar/llvm-objdump/llvm-profdata).
# El rootfs las provee vía el paquete `llvm22` con symlinks en /usr/bin (bootstrap-devfs.sh); antes
# faltaban (sólo estaba `clang`) y configure abortaba "Cannot find ar/llvm-objdump".
# TRIPLE: mozjs exige que el --host de configure COINCIDA con el host que reporta rustc. El rustc del
# rootfs (Alpine) es `x86_64-alpine-linux-musl` (vendor `alpine`, no `pc` ni `unknown`); con cualquier
# otro, mozjs aborta ("rust compiler host ... not suitable for the configure host"). Fijamos ese triple
# exacto — clang lo acepta (vendor genérico) y así C-host == rust-host, que es lo que mozjs valida.
configure = "export MOZBUILD_STATE_PATH=/src/.mozbuild MOZ_NOSPAM=1 SHELL=/bin/sh PYTHON=python3 && cd js/src && mkdir -p obj && cd obj && CC=clang CXX=clang++ AR=llvm-ar ../configure --prefix=/usr --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --disable-debug --enable-optimize --enable-release --enable-hardening --disable-jemalloc --enable-shared-js --disable-tests --without-system-icu --with-system-nspr --with-system-zlib"
compile = "export MOZBUILD_STATE_PATH=/src/.mozbuild MOZ_NOSPAM=1 && cd js/src/obj && make -j\"$(nproc)\""
install = "export MOZBUILD_STATE_PATH=/src/.mozbuild MOZ_NOSPAM=1 && cd js/src/obj && make DESTDIR=/out install"
[deps]
build = ["nspr", "nasm", "cbindgen", "python3", "make", "zlib", "pkgconf"]
+19 -1
View File
@@ -187,7 +187,12 @@ else
# El runtime libcrypto3/libssl3 (que curl/git necesitan) lo trae Alpine aparte, no es openssl-dev.
# `clang-dev clang-libs`: aportan libclang.so — `bindgen` (que usan varios *-sys: libbzip3-sys,
# etc.) lo carga en build para generar bindings de los headers C. No lo trae el base.
NEEDED="make autoconf automake m4 patch coreutils libtool pkgconf bash binutils g++ zlib-dev rust cargo clang-dev clang-libs linux-headers bubblewrap git curl kmod"
# `llvm22`: la SUITE binutils de LLVM (llvm-ar/llvm-objdump/llvm-profdata/llvm-nm/llvm-readobj).
# `clang`/`clang-libs` NO la arrastran (sólo libLLVM.so + los binarios clang), y mozjs/spidermonkey
# con clang exige llvm-ar y llvm-objdump ⇒ sin esto configure aborta "Cannot find ar/llvm-objdump".
# Alpine deja los binarios en /usr/lib/llvm22/bin SIN symlinkear a /usr/bin (multi-versión); el paso
# 3a-ter de abajo los expone en el PATH estándar, igual que Alpine ya hace con `clang`.
NEEDED="make autoconf automake m4 patch coreutils libtool pkgconf bash binutils g++ zlib-dev rust cargo clang-dev clang-libs llvm22 linux-headers bubblewrap git curl kmod"
missing=""
for pkg in $NEEDED; do
# apk info -e devuelve el paquete si está instalado, vacío si no.
@@ -209,6 +214,19 @@ else
ok "build tools presentes en el rootfs ($NEEDED)"
fi
# --- 3a-ter. Exponer la suite llvm-* en /usr/bin -----------------------------
# Alpine instala los binutils de LLVM en /usr/lib/llvm22/bin (versionado) sin symlink a /usr/bin,
# para permitir varias versiones. El PATH del sandbox es fijo (/opt/zig:/usr/local/bin:/usr/bin:...)
# y NO incluye ese dir, así que sin symlinks `llvm-ar`/`llvm-objdump` son invisibles y mozjs no
# configura. Los symlinkeamos relativos (idéntico a como el propio Alpine expone `clang`). Idempotente.
if [[ -d "$ROOTFS/usr/lib/llvm22/bin" ]]; then
for f in "$ROOTFS"/usr/lib/llvm22/bin/llvm-*; do
t="$(basename "$f")"
[[ -e "$ROOTFS/usr/bin/$t" ]] || ln -s "../lib/llvm22/bin/$t" "$ROOTFS/usr/bin/$t"
done
ok "suite llvm-* expuesta en /usr/bin"
fi
# --- 3a-bis. Neutralizar scudo-malloc (frente edge rust) ----------------------
# edge empaqueta rust/cargo con `scudo-malloc` como DEPENDENCIA DURA: los shims rustc/cargo lo
# linkean como PRIMER NEEDED ⇒ el allocator endurecido scudo interpone malloc en todo el proceso