fix: install.sh finds binary under custom target triples

Nightly toolchains with CARGO_BUILD_TARGET set (or .cargo/config.toml
[build] target) put the binary in target/<triple>/release/ instead of
target/release/. The installer now falls back to a find search across
all target subdirectories when the standard path doesn't exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-09 23:51:36 -05:00
parent 23d4d59c71
commit f94a3170b1

View File

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