fix(bench): support macos bash in benchmark script#371
Conversation
Greptile SummaryThis PR replaces the Confidence Score: 5/5Safe to merge — a mechanical, correct substitution with no logic changes. No functional or logic issues found. All scenario:tool pairs are correctly translated from the associative array to the No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(bench): support macos bash in benchm..." | Re-trigger Greptile |
## Summary - replace the benchmark script's Bash 4 associative-array command map with a Bash 3-compatible `case` helper - leave the benchmark task tool providers unchanged, including `aqua:pnpm/pnpm@latest` ## Why macOS still ships Bash 3.2 by default, so `benchmarks/bench.sh` failed on `declare -A` before it could run the hyperfine matrix. This keeps the same per-scenario commands while making the dispatch portable to the default macOS shell. ## Validation - `bash -n benchmarks/bench.sh` - `git diff --check` I also confirmed the earlier one-run smoke got past pnpm 11 provisioning when using `npm:pnpm@11`, but reverted that provider change per follow-up because `aqua:pnpm/pnpm@latest` is expected to work again later. *This PR was generated by Codex.* <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this is a refactor of benchmark command dispatch to avoid Bash 4-only associative arrays, with no production/runtime impact beyond the benchmarking harness. > > **Overview** > Makes `benchmarks/bench.sh` compatible with macOS’s default Bash (3.2) by **replacing the Bash 4 `declare -A` scenario/tool command map** with a `cmd_template` `case` helper. > > Updates `run_bench` and `run_bench_preinstall` to fetch per-scenario commands via `cmd_template`, keeping the underlying benchmark commands and hermetic env flags effectively the same while improving portability. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e51dc9a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Summary
casehelperaqua:pnpm/pnpm@latestWhy
macOS still ships Bash 3.2 by default, so
benchmarks/bench.shfailed ondeclare -Abefore it could run the hyperfine matrix. This keeps the same per-scenario commands while making the dispatch portable to the default macOS shell.Validation
bash -n benchmarks/bench.shgit diff --checkI also confirmed the earlier one-run smoke got past pnpm 11 provisioning when using
npm:pnpm@11, but reverted that provider change per follow-up becauseaqua:pnpm/pnpm@latestis expected to work again later.This PR was generated by Codex.
Note
Low Risk
Low risk: this is a refactor of benchmark command dispatch to avoid Bash 4-only associative arrays, with no production/runtime impact beyond the benchmarking harness.
Overview
Makes
benchmarks/bench.shcompatible with macOS’s default Bash (3.2) by replacing the Bash 4declare -Ascenario/tool command map with acmd_templatecasehelper.Updates
run_benchandrun_bench_preinstallto fetch per-scenario commands viacmd_template, keeping the underlying benchmark commands and hermetic env flags effectively the same while improving portability.Reviewed by Cursor Bugbot for commit e51dc9a. Bugbot is set up for automated code reviews on this repo. Configure here.