From f54683b44b7f1b6039672c778da38cd596d0ae73 Mon Sep 17 00:00:00 2001 From: sergio Date: Sun, 14 Jun 2026 18:04:27 -0400 Subject: [PATCH] =?UTF-8?q?selfhost-verify:=20corrige=20recipes=20cmake=20?= =?UTF-8?q?+=20python3=20(diagn=C3=B3stico=20de=20fallos=20zig)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Primer intento de ambas falló; correcciones tras diagnóstico con probes aislados: - cmake: el cmake mínimo que `./bootstrap` compila con `zig c++` SEGFAULTEA al correr ("Problem while running initial CMake") — interacción libc++/musl de zig. Fix: forzar CC=gcc/CXX=g++ en las fases (Alpine compila cmake con gcc; el toolchain ya trae gcc/g++, nativos y funcionales en el sandbox). - python3: Modules/getbuildinfo.c usa __DATE__/__TIME__ y la build habilita -Wdate-time; zig (clang) lo promueve a ERROR. Probé que SOURCE_DATE_EPOCH=1 (que el sandbox ya exporta) fija el VALOR a 1970-01-01 (determinista) pero clang NO silencia -Wdate-time vía SDE (eso es sólo-GCC). Fix: CFLAGS="-Wno-error=date-time" — degrada a warning, valor sigue determinista. NOTA: ambos rebuilds estaban EN CURSO al commitear (aún no sellados en store); si fallan otra vez, commit de seguimiento. zlib (f3ddad6) sí validado. Co-Authored-By: Claude Opus 4.8 --- recipes/cmake.toml | 15 ++++++++++----- recipes/python3.toml | 8 +++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/recipes/cmake.toml b/recipes/cmake.toml index 231d35ae..aa523d21 100644 --- a/recipes/cmake.toml +++ b/recipes/cmake.toml @@ -8,9 +8,14 @@ # casar byte-a-byte con la de Alpine, sólo configurar/generar igual. Build vainilla, sin patches. # # CMake trae su propio `bootstrap` (no autotools): compila un cmake mínimo con CC/CXX y luego se -# auto-configura. El sandbox exporta CC="zig cc -mcpu=baseline" / CXX="zig c++ -mcpu=baseline"; el -# bootstrap los respeta. Enlace dinámico (un cmake estático con libc++/libstdc++ es impráctico y no -# aporta nada a una herramienta de build-time; la VM ya tiene libstdc++ runtime). +# auto-configura. Enlace dinámico (un cmake estático con libc++/libstdc++ es impráctico y no aporta +# nada a una herramienta de build-time; la VM ya tiene libstdc++ runtime). +# +# CC=gcc/CXX=g++ (NO zig): el cmake mínimo que `bootstrap` compila con `zig c++` SEGFAULTEA al correr +# ("Problem while running initial CMake") — interacción libc++/musl de zig. Alpine mismo compila cmake +# con gcc; el toolchain trae gcc/g++ (añadidos para mrustc) y funcionan nativos dentro del sandbox +# (musl del devfs), así que se fuerzan por env en las fases. Es una herramienta del toolchain, no un +# input del 4/4 ⇒ el compilador da igual mientras el cmake resultante configure/genere bien. name = "cmake" version = "3.31.6" @@ -27,6 +32,6 @@ link = "dynamic" [build.phases] # bootstrap = configure de CMake. --parallel acelera el cmake mínimo. -- pasa flags al cmake final; # CMAKE_USE_OPENSSL=OFF evita depender de openssl-dev (el bootstrap de rust no usa el https de cmake). -configure = "./bootstrap --prefix=/usr --parallel=\"$(nproc)\" -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_USE_OPENSSL=OFF" -compile = "make -j\"$(nproc)\"" +configure = "CC=gcc CXX=g++ ./bootstrap --prefix=/usr --parallel=\"$(nproc)\" -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_USE_OPENSSL=OFF" +compile = "CC=gcc CXX=g++ make -j\"$(nproc)\"" install = "make install DESTDIR=/out" diff --git a/recipes/python3.toml b/recipes/python3.toml index 007286f1..2f6e1df7 100644 --- a/recipes/python3.toml +++ b/recipes/python3.toml @@ -11,6 +11,12 @@ # /usr); --without-ensurepip evita la red (pip), --disable-test-modules acorta el build (no se necesita # el test-suite). Enlace dinámico: el intérprete linkea libpython/libc; estático no aporta a una # herramienta de build-time y CPython estático es frágil. El sandbox exporta CC="zig cc -mcpu=baseline". +# +# CFLAGS="-Wno-error=date-time": Modules/getbuildinfo.c usa __DATE__/__TIME__ y la build de CPython +# habilita -Wdate-time; zig cc (clang) lo PROMUEVE a error. SOURCE_DATE_EPOCH=1 (que el sandbox ya +# exporta) fija el VALOR de esos macros a 1970-01-01 (determinista) pero clang NO silencia -Wdate-time +# vía SDE (eso es comportamiento sólo-GCC), así que hay que degradarlo a warning para no romper. El +# binario sigue siendo determinista (valor fijado por SDE); python3 es herramienta, no input del 4/4. name = "python3" version = "3.12.10" @@ -28,6 +34,6 @@ link = "dynamic" build = ["zlib"] [build.phases] -configure = "./configure --prefix=/usr --without-ensurepip --disable-test-modules --with-ensurepip=no" +configure = "./configure --prefix=/usr --without-ensurepip --disable-test-modules --with-ensurepip=no CFLAGS=\"-Wno-error=date-time\"" compile = "make -j\"$(nproc)\"" install = "make install DESTDIR=/out"