takana etapa 3a: los cargo build emiten los DOS binarios

Va solo y ANTES de cambiar ninguna invocación, a propósito. El worker compila
desde fuente (farm-worker-loop.sh) y la siembra excluye /target: si primero
cambiara las llamadas a `takana` y después el build, habría una ventana en la
que el worker sincroniza scripts nuevos y sigue teniendo sólo el binario viejo
— y eso no falla ruidosamente, deja de cosechar en silencio.

Con los dos emitidos, cualquier orden de sincronización queda sano.
This commit is contained in:
Sergio
2026-09-09 18:24:32 +00:00
parent 80319d9bab
commit 7b6da600d6
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ log "3/4 recompilando hammer en el worker (el binario debe traer el lab en hash_
# anterior, calcula la huella vieja y el paso 4 falla sin que se vea por qué (2026-08-12).
$SSH "root@$IP" "cd $REMOTE && . \$HOME/.cargo/env 2>/dev/null
find crates -name '*.rs' -exec touch {} +
cargo build --release --bin hammer 2>&1 | tail -2"
cargo build --release --bin takana --bin hammer 2>&1 | tail -2"
log "4/4 EVIDENCIA: ¿el worker sella en la misma dirección que el hub?"
h_hub=$("$ROOT/target/release/hammer" --store "$ROOT/store" hash "$TESTIGO" | tail -1)
+3 -3
View File
@@ -170,7 +170,7 @@ QUEUES="${QUEUES:-recipes/incoming recipes/incoming-go recipes/incoming-gnome re
# no cambió nada, minutos en frío. Si cargo falla, seguimos con el binario que haya (mejor que abortar).
if command -v cargo >/dev/null 2>&1; then
echo "$(date -u +%FT%TZ) rebuild hammer desde el source rsync-eado (evita el fósil de la golden)…"
cargo build --release --bin hammer -j"$JOBS" 2>&1 | tail -2 || echo " ⚠ rebuild falló — uso el binario existente"
cargo build --release --bin takana --bin hammer -j"$JOBS" 2>&1 | tail -2 || echo " ⚠ rebuild falló — uso el binario existente"
fi
# EL MISMO REBUILD, PERO POR CICLO Y NO SÓLO AL ARRANCAR (2026-09-06). El bloque de arriba corre
@@ -192,11 +192,11 @@ fi
rebuild_si_hace_falta() {
command -v cargo >/dev/null 2>&1 || return 0
bin=target/release/hammer
[ -x "$bin" ] || { echo "$(date -u +%FT%TZ) no hay binario: compilando"; cargo build --release --bin hammer -j"$JOBS" 2>&1 | tail -2; return 0; }
[ -x "$bin" ] || { echo "$(date -u +%FT%TZ) no hay binario: compilando"; cargo build --release --bin takana --bin hammer -j"$JOBS" 2>&1 | tail -2; return 0; }
# ¿Algún fuente más nuevo que el binario? (Cargo.lock incluido: un bump de dep también cuenta.)
if [ -n "$(find crates Cargo.toml Cargo.lock -newer "$bin" -type f -print -quit 2>/dev/null)" ]; then
echo "$(date -u +%FT%TZ) el source es más nuevo que el binario ⇒ recompilo hammer"
cargo build --release --bin hammer -j"$JOBS" 2>&1 | tail -2 || echo " ⚠ rebuild falló — sigo con el binario existente"
cargo build --release --bin takana --bin hammer -j"$JOBS" 2>&1 | tail -2 || echo " ⚠ rebuild falló — sigo con el binario existente"
fi
}
+1 -1
View File
@@ -138,7 +138,7 @@ fi
. "$HOME/.cargo/env"
echo "==> 5. build hammer (target/release/hammer)"
cargo build --release --bin hammer
cargo build --release --bin takana --bin hammer
echo "==> 6. rootfs Alpine edge + zig (bootstrap reproducible; varios min la 1ra vez)"
./scripts/bootstrap-devfs.sh
+1 -1
View File
@@ -74,7 +74,7 @@ def solo_metadatos(d):
def main():
if not HAMMER.exists():
sys.exit(f"falta {HAMMER} (cargo build --release --bin hammer)")
sys.exit(f"falta {HAMMER} (cargo build --release --bin takana --bin hammer)")
grupos = sellados_por_nombre()
nombres = sorted(grupos)