From aa31f04486c91cee29d7502864f4604904e7c395 Mon Sep 17 00:00:00 2001 From: sergio Date: Sun, 14 Jun 2026 18:15:35 -0400 Subject: [PATCH] =?UTF-8?q?selfhost-verify:=20python3=20tambi=C3=A9n=20con?= =?UTF-8?q?=20gcc=20(mismo=20segfault=20zig=20que=20cmake)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit El rebuild de python3 con zig cc pasó el date-time pero el intérprete `_bootstrap_python` (zig cc) SEGFAULTEÓ en el paso de "freeze modules" — mismo fallo que cmake: zig 0.16 miscompila binarios musl grandes (un hello-world dinámico zig sí corre). Fix idéntico: CC=gcc/CXX=g++ en las fases (gcc nativo del toolchain, como compila Alpine). Con gcc además -Wdate-time deja de molestar (gcc honra SOURCE_DATE_EPOCH). NOTA: rebuild gcc EN CURSO (fase compile, ya pasó configure) al commitear; aún no sellado. zlib (f3ddad6) validado. Co-Authored-By: Claude Opus 4.8 --- recipes/python3.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/recipes/python3.toml b/recipes/python3.toml index 2f6e1df7..f7204b81 100644 --- a/recipes/python3.toml +++ b/recipes/python3.toml @@ -12,11 +12,12 @@ # 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. +# CC=gcc/CXX=g++ (NO zig): igual que cmake, el intérprete `_bootstrap_python` compilado con `zig cc` +# SEGFAULTEA al correr (paso de "freeze modules" del build) — zig 0.16 miscompila binarios musl +# grandes (un hello-world dinámico zig sí corre; cmake y python no). Alpine compila python con gcc; el +# toolchain trae gcc/g++ nativos y funcionales en el sandbox. Es herramienta, no input del 4/4 ⇒ el +# compilador da igual mientras el intérprete corra. Con gcc, -Wdate-time ni siquiera molesta (gcc SÍ +# honra SOURCE_DATE_EPOCH para silenciarlo); se deja CFLAGS=-Wno-error=date-time por robustez. name = "python3" version = "3.12.10" @@ -34,6 +35,6 @@ link = "dynamic" build = ["zlib"] [build.phases] -configure = "./configure --prefix=/usr --without-ensurepip --disable-test-modules --with-ensurepip=no CFLAGS=\"-Wno-error=date-time\"" +configure = "CC=gcc CXX=g++ ./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"