From b7ad3938588efa5167e1c9919e49fea69f4b8e6f Mon Sep 17 00:00:00 2001 From: argenis de la rosa Date: Wed, 18 Mar 2026 14:15:59 -0400 Subject: [PATCH] fix(install): clean stale build cache on upgrade When upgrading an existing installation, stale build artifacts in target/release/build/ can cause compilation failures (e.g. libsqlite3-sys bindgen.rs not found). Run cargo clean --release before building when an upgrade is detected. Co-Authored-By: Claude Opus 4.6 --- install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.sh b/install.sh index ed2656193..c32a3bf11 100755 --- a/install.sh +++ b/install.sh @@ -1359,6 +1359,12 @@ if [[ -n "$TARGET_VERSION" ]]; then step_dot "Installing ZeroClaw v${TARGET_VERSION}" fi if [[ "$SKIP_BUILD" == false ]]; then + # Clean stale build artifacts on upgrade to prevent bindgen/build-script + # cache mismatches (e.g. libsqlite3-sys bindgen.rs not found). + if [[ "$INSTALL_MODE" == "upgrade" && -d "$WORK_DIR/target/release/build" ]]; then + step_dot "Cleaning stale build cache (upgrade detected)" + cargo clean --release 2>/dev/null || true + fi step_dot "Building release binary" cargo build --release --locked step_ok "Release binary built"