Skip to content

Commit 33c6a4e

Browse files
committed
fix: avoid sharp source builds during install
1 parent 5857f59 commit 33c6a4e

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

public/install-cli.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set -euo pipefail
77
PREFIX="${CLAWDBOT_PREFIX:-${HOME}/.clawdbot}"
88
CLAWDBOT_VERSION="${CLAWDBOT_VERSION:-latest}"
99
NODE_VERSION="${CLAWDBOT_NODE_VERSION:-22.12.0}"
10+
SHARP_IGNORE_GLOBAL_LIBVIPS="${SHARP_IGNORE_GLOBAL_LIBVIPS:-1}"
1011
JSON=0
1112
RUN_ONBOARD=0
1213
SET_NPM_PREFIX=0
@@ -21,6 +22,9 @@ Usage: install-cli.sh [options]
2122
--onboard Run "clawdbot onboard" after install
2223
--no-onboard Skip onboarding (default)
2324
--set-npm-prefix Force npm prefix to ~/.npm-global if current prefix is not writable (Linux)
25+
26+
Environment variables:
27+
SHARP_IGNORE_GLOBAL_LIBVIPS=0|1 Default: 1 (avoid sharp building against global libvips)
2428
EOF
2529
}
2630

@@ -202,7 +206,7 @@ install_clawdbot() {
202206
if [[ "$SET_NPM_PREFIX" -eq 1 ]]; then
203207
fix_npm_prefix_if_needed
204208
fi
205-
"$(npm_bin)" install -g --prefix "$PREFIX" "clawdbot@${CLAWDBOT_VERSION}"
209+
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" "$(npm_bin)" install -g --prefix "$PREFIX" "clawdbot@${CLAWDBOT_VERSION}"
206210
rm -f "${PREFIX}/bin/clawdbot"
207211
cat > "${PREFIX}/bin/clawdbot" <<EOF
208212
#!/usr/bin/env bash

public/install.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ INSTALL_METHOD=${CLAWDBOT_INSTALL_METHOD:-}
146146
GIT_DIR_DEFAULT="${HOME}/clawdbot"
147147
GIT_DIR=${CLAWDBOT_GIT_DIR:-$GIT_DIR_DEFAULT}
148148
GIT_UPDATE=${CLAWDBOT_GIT_UPDATE:-1}
149+
SHARP_IGNORE_GLOBAL_LIBVIPS="${SHARP_IGNORE_GLOBAL_LIBVIPS:-1}"
149150
HELP=0
150151

151152
print_usage() {
@@ -173,6 +174,7 @@ Environment variables:
173174
CLAWDBOT_NO_PROMPT=1
174175
CLAWDBOT_DRY_RUN=1
175176
CLAWDBOT_NO_ONBOARD=1
177+
SHARP_IGNORE_GLOBAL_LIBVIPS=0|1 Default: 1 (avoid sharp building against global libvips)
176178
177179
Examples:
178180
curl -fsSL https://clawd.bot/install.sh | bash
@@ -484,7 +486,7 @@ install_clawdbot_from_git() {
484486
fi
485487
fi
486488

487-
pnpm -C "$repo_dir" install
489+
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" pnpm -C "$repo_dir" install
488490

489491
if ! pnpm -C "$repo_dir" ui:build; then
490492
echo -e "${WARN}${NC} UI build failed; continuing (CLI may still work)"
@@ -505,7 +507,10 @@ EOF
505507
# Install Clawdbot
506508
install_clawdbot() {
507509
echo -e "${WARN}${NC} Installing Clawdbot..."
508-
npm install -g clawdbot@latest
510+
if [[ "$SHARP_IGNORE_GLOBAL_LIBVIPS" == "1" ]]; then
511+
echo -e "${INFO}i${NC} Using SHARP_IGNORE_GLOBAL_LIBVIPS=1 (avoids sharp source builds against global libvips)"
512+
fi
513+
SHARP_IGNORE_GLOBAL_LIBVIPS="$SHARP_IGNORE_GLOBAL_LIBVIPS" npm install -g clawdbot@latest
509514
echo -e "${SUCCESS}${NC} Clawdbot installed"
510515
}
511516

0 commit comments

Comments
 (0)