diff --git a/install.sh b/install.sh index 5302c68..0b6ab7b 100755 --- a/install.sh +++ b/install.sh @@ -40,10 +40,16 @@ if ! (cd "$SCRIPT_DIR" && cargo build --release); then exit 1 fi +# Find the binary — handles custom target triples (e.g., CARGO_BUILD_TARGET +# puts it in target//release/ instead of target/release/) 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/" + BINARY=$(find "$SCRIPT_DIR/target" -name "$BINARY_NAME" -type f -path "*/release/*" ! -name "*.d" 2>/dev/null | head -1) +fi +if [[ -z "${BINARY:-}" || ! -f "$BINARY" ]]; then + echo "ERROR: Build succeeded but binary not found." + echo " Searched: $SCRIPT_DIR/target/*/release/$BINARY_NAME" + echo " Contents: $(ls "$SCRIPT_DIR/target/release/" 2>/dev/null || echo '(no target/release/)')" exit 1 fi echo "[ok] Built: $(ls -lh "$BINARY" | awk '{print $5}')"