From 5549330c943e7aef48e828118b32412e9d82c438 Mon Sep 17 00:00:00 2001 From: sergio Date: Wed, 17 Jun 2026 01:17:24 -0400 Subject: [PATCH] =?UTF-8?q?selfhost-verify:=20RUST=5FEXPECT=5FREF=3D7fa6cb?= =?UTF-8?q?4e=20+=20swap=20--restore=20deja=20el=20toolchain=20pr=C3=ADsti?= =?UTF-8?q?no?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auto-consistencia de hammer-rust VERIFICADA en host (2026-06-17): of_tree(stage1) construido con hammer-rust 1.91.1 = b3:7fa6cb4e… reproducido 2× (store-rust y store-rust2, builds frescos independientes). Es el nuevo EXPECT_REF para SWAP_RUST (criterio elegido: auto-consistencia, ≠ el 9adefb82 de Alpine). Cableado como default de RUST_EXPECT_REF. swap-rust-into-toolchain.sh --restore: ahora también elimina lo AÑADIDO por el swap (rustlib x86_64-unknown-linux-musl + librustc_driver de hammer), no sólo restaura rustc/cargo. Round-trip apply→restore deja el devfs prístino (verificado: sólo x86_64-alpine-linux-musl + driver de Alpine). Antes dejaba ~350 MB de cruft. Nota: los leftovers NO afectaban el of_tree (un build Alpine con/ sin ellos diverge igual del baseline Jun13 — ver hallazgo de drift abajo); la limpieza es higiene/reversibilidad. Co-Authored-By: Claude Opus 4.8 --- scripts/rust-frontier/swap-rust-into-toolchain.sh | 13 ++++++++++++- scripts/selfhost-verify.sh | 7 ++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/rust-frontier/swap-rust-into-toolchain.sh b/scripts/rust-frontier/swap-rust-into-toolchain.sh index d09a79ad..b76420b8 100755 --- a/scripts/rust-frontier/swap-rust-into-toolchain.sh +++ b/scripts/rust-frontier/swap-rust-into-toolchain.sh @@ -51,7 +51,18 @@ if [ "$RESTORE" = 1 ]; then echo " (sin backup de usr/bin/$b — ¿ya restaurado?)" fi done - echo " (los .so y el rustlib x86_64-unknown-linux-musl añadidos quedan; son inertes — el rustc de Alpine no los usa)" + # Quitar también lo AÑADIDO por el swap: el librustc_driver de hammer (hash propio, distinto del + # de Alpine) y el sysroot del triple x86_64-unknown-linux-musl (un devfs Alpine prístino NO los + # tiene). Inertes para el rustc de Alpine, pero dejarlos es ~350 MB de cruft y deja el toolchain + # no-prístino; lo limpiamos para que --restore sea reversibilidad total. + rm -rf "$TOOLCHAIN/usr/lib/rustlib/x86_64-unknown-linux-musl" + # Sólo los librustc_driver que NO son de Alpine (Alpine deja exactamente uno; el swap añadió otro). + if [ -d "$PREFIX/lib" ]; then + for so in "$PREFIX"/lib/librustc_driver-*.so; do + [ -e "$so" ] && rm -f "$TOOLCHAIN/usr/lib/$(basename "$so")" + done + fi + echo " limpiado usr/lib/rustlib/x86_64-unknown-linux-musl + librustc_driver de hammer" exit 0 fi diff --git a/scripts/selfhost-verify.sh b/scripts/selfhost-verify.sh index bcce2f99..688de86c 100755 --- a/scripts/selfhost-verify.sh +++ b/scripts/selfhost-verify.sh @@ -90,9 +90,10 @@ if [[ "${SWAP_RUST:-0}" == 1 ]]; then # para forzar el rebuild de los 4/4 con hammer-rust; así el of_tree refleja el compilador nuevo. STORE="${RUST_STORE:-store-rust}" say "SWAP_RUST: store dedicado $STORE (el ./store baseline no se toca; fuerza rebuild con hammer-rust)" - # Con hammer-rust el REF NO es el 9adefb82 de Alpine; comparamos contra RUST_EXPECT_REF (si se - # conoce de una corrida previa), no contra el baseline Alpine. - EXPECT_REF="${RUST_EXPECT_REF:-}" + # Con hammer-rust el REF NO es el 9adefb82 de Alpine; comparamos contra RUST_EXPECT_REF, el + # of_tree(stage1) auto-consistente de hammer-rust 1.91.1 (reproducido 2× en host, 2026-06-17, + # store-rust y store-rust2). Override con RUST_EXPECT_REF= para re-anclar. + EXPECT_REF="${RUST_EXPECT_REF:-b3:7fa6cb4e70a934d72206cf3d95cf46a13f0a6464ec73855b98d547195f4ed047}" fi # 1) Store baseline: stage1 (idempotente; rebuildea lo que falte con -mcpu=baseline ya en fuente).