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:
10
install.sh
10
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/<triple>/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}')"
|
||||
|
||||
Reference in New Issue
Block a user