#!/usr/bin/env bash # Take 4: ensure batteries is complete at pinned rev (manual fetch w/ retries), # then cache get + build + axioms. Idempotent. export PATH="$HOME/.elan/bin:$PATH" export https_proxy=http://127.0.0.1:7897 http_proxy=http://127.0.0.1:7897 export GIT_HTTP_LOW_SPEED_LIMIT=1000 export GIT_HTTP_LOW_SPEED_TIME=60 REPO=/d/Code/WorkSpace_Claude/isitsolved-w-li/li-criterion-rh cd "$REPO" || exit 1 BATREV=b4b25a3886a16daacaf6615c2eea7170a6e8f458 B="$REPO/.lake/packages/batteries" echo "=== batteries materialize ===" if [ ! -d "$B/.git" ] || ! git -C "$B" rev-parse --verify "$BATREV^{commit}" >/dev/null 2>&1; then rm -rf "$B" git init "$B" || exit 1 git -C "$B" remote add origin https://github.com/leanprover-community/batteries.git OK=0 for i in 1 2 3 4 5 6 7 8; do echo "--- batteries fetch attempt $i ---" if git -C "$B" fetch --depth 1 --progress origin "$BATREV"; then OK=1; break; fi sleep 8 done [ "$OK" = 1 ] || { echo "BATTERIES_FETCH_FAILED"; exit 1; } git -C "$B" checkout --detach FETCH_HEAD || exit 1 else echo "batteries already at $BATREV" fi git -C "$B" rev-parse HEAD echo "=== step 1: lake exe cache get ===" lake exe cache get echo "CACHE_GET_EXIT=$?" echo "=== step 2: lake build ===" lake build echo "BUILD_EXIT=$?" echo "=== step 3: axioms check ===" lake env lean /d/Code/WorkSpace_Claude/isitsolved-w-li/axioms_check.lean echo "AXIOMS_EXIT=$?" echo "=== done ==="