From c0512c1fb5a74a215c660a041eb6a2c94d48c7bc Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 3 May 2026 04:18:17 -0400 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20local=20batch=20gdextension=20rebuild=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- tools/autoplay-batch.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/autoplay-batch.sh b/tools/autoplay-batch.sh index c8746350..eb45ee2c 100755 --- a/tools/autoplay-batch.sh +++ b/tools/autoplay-batch.sh @@ -140,6 +140,19 @@ echo "Parallel: $PARALLEL concurrent seed(s)" echo "Safety timeout: ${SAFETY_TIMEOUT}s per game" echo "============================================================" +# p1-45: Rebuild GDExtension before every local batch so the .so is never stale. +# Remote mode delegates to run_ap3.sh on the remote host, which is expected to +# have a fresh build already (or the caller ran build-gdext.sh manually). +# Uses a timestamped CARGO_TARGET_DIR to avoid collisions on multi-tenant hosts. +if [ -z "$AUTOPLAY_HOST" ]; then + echo "--- p1-45: rebuilding GDExtension before batch (CARGO_TARGET_DIR isolation) ---" + MC_BUILD_STAMP="$(date +%s)" + export CARGO_TARGET_DIR="/tmp/mc-build-${MC_BUILD_STAMP}/target" + (cd "$PROJECT_DIR/src/simulator" && bash build-gdext.sh) + unset CARGO_TARGET_DIR + echo "--- GDExtension rebuild complete ---" +fi + # Start the MCTS service (idempotent — no-op if already running). # Runs only for local batches; remote batches rely on the remote host's # run-services.sh invocation (or service already running on apricot).