Agent Diagnostic
- Ran
mise run cluster on macOS (Apple Silicon, Darwin 25.2.0)
- Script failed at
tasks/scripts/cluster-deploy-fast.sh:91 with mapfile: command not found
- Confirmed
/bin/bash --version is GNU bash, version 3.2.57(1)-release (arm64-apple-darwin25) — macOS ships bash 3.2 which lacks the mapfile builtin (added in bash 4.0)
- Grepped for other
mapfile usages: this is the only occurrence in the codebase
- The same script already uses the portable
while IFS= read -r pattern at line 108, confirming the fix is consistent with existing code
- Searched OpenShell issues for
mapfile, bash, macos cluster — no existing report found
- Fix verified: replacing
mapfile -t with while read loop resolves the issue on bash 3.2 and remains compatible with bash 4+/5+ on Linux
Source: Bash FAQ #005, Bash Pitfalls #56
Description
mise run cluster fails on macOS because tasks/scripts/cluster-deploy-fast.sh line 91 uses mapfile -t, a bash 4.0+ builtin. macOS ships bash 3.2.57 (stuck at 3.2 since 2007 due to GPLv3 licensing). No homebrew bash is required for any other part of the project.
Expected: mise run cluster succeeds on macOS with the default system bash.
Actual: Fails with mapfile: command not found.
Reproduction Steps
- macOS with default
/bin/bash (3.2), no homebrew bash installed
- Clone repo, install mise tools
mise run cluster
- Observe:
tasks/scripts/cluster-deploy-fast.sh: line 91: mapfile: command not found
Environment
- OS: macOS 15.5 (Darwin 25.2.0), Apple Silicon (arm64)
- Docker: Docker Desktop
- OpenShell: built from main (commit b7779bd)
- Bash:
/bin/bash 3.2.57(1)-release
Logs
[cluster] $ tasks/scripts/cluster.sh
/Users/.../openshell/tasks/scripts/cluster-deploy-fast.sh: line 91: mapfile: command not found
[cluster] ERROR task failed
Proposed Fix
Replace the single mapfile call with the portable while read pattern already used elsewhere in the same script:
# Before (line 91, bash 4+ only):
mapfile -t changed_files < <(
{
git diff --name-only
git diff --name-only --cached
git ls-files --others --exclude-standard
} | sort -u
)
# After (bash 3.2+ compatible):
while IFS= read -r line; do
changed_files+=("$line")
done < <(
{
git diff --name-only
git diff --name-only --cached
git ls-files --others --exclude-standard
} | sort -u
)
This is a universal fix — works on both macOS bash 3.2 and Linux bash 5.x.
Agent-First Checklist
Agent Diagnostic
mise run clusteron macOS (Apple Silicon, Darwin 25.2.0)tasks/scripts/cluster-deploy-fast.sh:91withmapfile: command not found/bin/bash --versionisGNU bash, version 3.2.57(1)-release (arm64-apple-darwin25)— macOS ships bash 3.2 which lacks themapfilebuiltin (added in bash 4.0)mapfileusages: this is the only occurrence in the codebasewhile IFS= read -rpattern at line 108, confirming the fix is consistent with existing codemapfile,bash,macos cluster— no existing report foundmapfile -twithwhile readloop resolves the issue on bash 3.2 and remains compatible with bash 4+/5+ on LinuxSource: Bash FAQ #005, Bash Pitfalls #56
Description
mise run clusterfails on macOS becausetasks/scripts/cluster-deploy-fast.shline 91 usesmapfile -t, a bash 4.0+ builtin. macOS ships bash 3.2.57 (stuck at 3.2 since 2007 due to GPLv3 licensing). No homebrew bash is required for any other part of the project.Expected:
mise run clustersucceeds on macOS with the default system bash.Actual: Fails with
mapfile: command not found.Reproduction Steps
/bin/bash(3.2), no homebrew bash installedmise run clustertasks/scripts/cluster-deploy-fast.sh: line 91: mapfile: command not foundEnvironment
/bin/bash3.2.57(1)-releaseLogs
Proposed Fix
Replace the single
mapfilecall with the portablewhile readpattern already used elsewhere in the same script:This is a universal fix — works on both macOS bash 3.2 and Linux bash 5.x.
Agent-First Checklist
debug-openshell-cluster,debug-inference,openshell-cli)