From 23d4d59c71e1621c9b4b10c47d2ce31ae1a20899 Mon Sep 17 00:00:00 2001 From: Taylor Eernisse Date: Mon, 9 Feb 2026 23:49:45 -0500 Subject: [PATCH] fix: install.sh shows build errors instead of failing silently cargo build --quiet swallowed compiler errors, and the subshell (...) didn't reliably propagate exit codes across bash versions. The script continued past a failed build, then ls/cp failed on the missing binary. Now: removed --quiet so errors are visible, explicit exit-code check with common-cause hints (build-essential, libc6-dev), and a secondary check that the binary actually exists before attempting to install it. Co-Authored-By: Claude Opus 4.6 --- install.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 5baf1db..5302c68 100755 --- a/install.sh +++ b/install.sh @@ -31,12 +31,26 @@ echo "[ok] jq found" # ── Build release binary ───────────────────────────────────────────── echo "" echo "Building release binary..." -(cd "$SCRIPT_DIR" && cargo build --release --quiet) -echo "[ok] Built: $(ls -lh "$SCRIPT_DIR/target/release/$BINARY_NAME" | awk '{print $5}')" +if ! (cd "$SCRIPT_DIR" && cargo build --release); then + echo "" + echo "ERROR: cargo build failed. Check the output above for details." + echo " Common causes:" + echo " - Missing C compiler: sudo apt install build-essential (Debian/Ubuntu)" + echo " - Missing libc headers: sudo apt install libc6-dev" + exit 1 +fi + +BINARY="$SCRIPT_DIR/target/release/$BINARY_NAME" +if [[ ! -f "$BINARY" ]]; then + echo "ERROR: Build succeeded but binary not found at $BINARY" + echo " Check: ls $SCRIPT_DIR/target/release/" + exit 1 +fi +echo "[ok] Built: $(ls -lh "$BINARY" | awk '{print $5}')" # ── Install binary ─────────────────────────────────────────────────── mkdir -p "$INSTALL_DIR" -cp "$SCRIPT_DIR/target/release/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" +cp "$BINARY" "$INSTALL_DIR/$BINARY_NAME" chmod +x "$INSTALL_DIR/$BINARY_NAME" echo "[ok] Installed to $INSTALL_DIR/$BINARY_NAME"