Install claude and pi through mise

Provisioning was still installing `claude` and `pi` through a separate
npm-global prefix even after the guest images had switched to `mise` for
Node and opencode. That left two competing install paths and made the
runtime layout harder to reason about.

Switch the Debian and Void image setup flows to install `claude` and `pi`
as `mise` npm tools, assert their shims exist after `mise reshim`, and
symlink `node`, `npm`, `opencode`, `claude`, and `pi` directly from the
mise shim directory into `/usr/local/bin`.

Update the imagebuild test expectations and bump the Void rootfs default
size to 4G so the larger default toolset still fits reliably.
This commit is contained in:
Thales Maciel 2026-04-13 18:29:02 -03:00
parent 5e26fd7544
commit 797a9de1ce
No known key found for this signature in database
GPG key ID: 33112E6833C34679
4 changed files with 60 additions and 55 deletions

View file

@ -13,7 +13,7 @@ Build an experimental Void Linux rootfs image plus a matching /root work-seed.
Defaults:
--out ./build/manual/rootfs-void.ext4
--size 2G
--size 4G
--mirror https://repo-default.voidlinux.org
--arch x86_64
@ -345,6 +345,8 @@ set -euo pipefail
curl -fsSL https://mise.run | MISE_INSTALL_PATH="$MISE_INSTALL_PATH" MISE_VERSION="$MISE_VERSION" sh
"$MISE_INSTALL_PATH" use -g "$NODE_TOOL"
"$MISE_INSTALL_PATH" use -g "$OPENCODE_TOOL"
"$MISE_INSTALL_PATH" use -g "$CLAUDE_CODE_TOOL"
"$MISE_INSTALL_PATH" use -g "$PI_TOOL"
"$MISE_INSTALL_PATH" reshim
if [[ ! -e /root/.local/share/mise/shims/node ]]; then
echo "node shim not found after mise install" >&2
@ -358,19 +360,19 @@ if [[ ! -e /root/.local/share/mise/shims/opencode ]]; then
echo "opencode shim not found after mise install" >&2
exit 1
fi
mkdir -p "$NPM_GLOBAL_PREFIX"
NPM_CONFIG_PREFIX="$NPM_GLOBAL_PREFIX" /root/.local/share/mise/shims/npm install -g "$CLAUDE_CODE_PACKAGE" "$PI_PACKAGE"
if [[ ! -e "$NPM_GLOBAL_PREFIX/bin/claude" ]]; then
echo "claude binary not found after npm install" >&2
if [[ ! -e /root/.local/share/mise/shims/claude ]]; then
echo "claude shim not found after mise install" >&2
exit 1
fi
if [[ ! -e "$NPM_GLOBAL_PREFIX/bin/pi" ]]; then
echo "pi binary not found after npm install" >&2
if [[ ! -e /root/.local/share/mise/shims/pi ]]; then
echo "pi shim not found after mise install" >&2
exit 1
fi
ln -snf /root/.local/share/mise/shims/node /usr/local/bin/node
ln -snf /root/.local/share/mise/shims/npm /usr/local/bin/npm
ln -snf /root/.local/share/mise/shims/opencode /usr/local/bin/opencode
ln -snf "$NPM_GLOBAL_PREFIX/bin/claude" /usr/local/bin/claude
ln -snf "$NPM_GLOBAL_PREFIX/bin/pi" /usr/local/bin/pi
ln -snf /root/.local/share/mise/shims/claude /usr/local/bin/claude
ln -snf /root/.local/share/mise/shims/pi /usr/local/bin/pi
EOF
cat <<'EOF' | sudo tee "$profile_mise" >/dev/null
@ -400,16 +402,15 @@ MANUAL_DIR="${BANGER_MANUAL_DIR:-$REPO_ROOT/build/manual}"
BANGER_BIN="$(resolve_banger_bin)"
SSH_KEY="$("$BANGER_BIN" internal ssh-key-path)"
OUT_ROOTFS="$MANUAL_DIR/rootfs-void.ext4"
SIZE_SPEC="2G"
SIZE_SPEC="4G"
MIRROR="https://repo-default.voidlinux.org"
ARCH="x86_64"
MISE_VERSION="v2025.12.0"
MISE_INSTALL_PATH="/usr/local/bin/mise"
NODE_TOOL="node@22"
OPENCODE_TOOL="github:anomalyco/opencode"
CLAUDE_CODE_PACKAGE="@anthropic-ai/claude-code"
PI_PACKAGE="@mariozechner/pi-coding-agent"
NPM_GLOBAL_PREFIX="/root/.local/share/banger/npm-global"
CLAUDE_CODE_TOOL="npm:@anthropic-ai/claude-code"
PI_TOOL="npm:@mariozechner/pi-coding-agent"
GUESTNET_BOOTSTRAP_SCRIPT="$REPO_ROOT/internal/guestnet/assets/bootstrap.sh"
GUESTNET_VOID_CORE_SERVICE="$REPO_ROOT/internal/guestnet/assets/void-core-service.sh"
MODULES_DIR=""