Skip to content

[finding] check:objectui-changeset --self-test cannot run on macOS: bump-objectui.sh uses the bash-4 mapfile builtin #12071

Description

@os-zhuang

Found while running the derived gate families for #11770 (PR #12070). Out of that card's scope, filed rather than fixed.

pnpm check:objectui-changeset cannot run on macOS. Its --self-test shells out to scripts/bump-objectui.sh, which uses mapfile at lines 324 and 327:

 mapfile -t local_refs < <(
mapfile -t remote_refs < <(

mapfile is a bash 4 builtin. macOS ships GNU bash, version 3.2.57(1)-release as /bin/bash (Apple has not shipped bash 4+ for licensing reasons), so every self-test case that reaches that code path dies with:

scripts/bump-objectui.sh: line 324: mapfile: command not found

and the gate ends ⛔ objectui-changeset-digest --self-test: 7 failure(s), exit 1 — with status=127 (command-not-found) on two of them, i.e. the script never ran the logic those cases exist to pin.

Measured on a clean checkout of origin/main + a diff touching neitherscripts/bump-objectui.sh nor .objectui-sha, so it is not a regression from any card: it is a host-portability gap. CI runs on Linux, where bash 5 provides mapfile, so the gate is green there and this is invisible to every PR.

Why it is worth recording rather than shrugging at: the pin-bump procedure in docs/releases-maintenance.md is run by hand, locally, and bump-objectui.sh is the script that runs it. On a macOS seat the branch-reachability warnings that #10495 added — "the pin you are writing is not on main", "this commit was never pushed" — are exactly the code that cannot execute. The self-test failing is the visible symptom; the operator-facing consequence is that the guard those cases pin does not fire for a maintainer bumping the pin from a Mac. The failure is loud in the self-test but the real path degrades at line 324 the same way.

Two candidate remedies (implementer judges, and the second may be enough on its own):

  1. Replace mapfile -t x < <(cmd) with a bash-3.2-compatible read loop (while IFS= read -r line; do x+=("$line"); done < <(cmd)), which is what the rest of the script's idiom already allows.
  2. Or make the incompatibility loud rather than silent: have bump-objectui.sh refuse up front on BASH_VERSINFO[0] -lt 4 with the remedy in the message, so a macOS operator is told to use /opt/homebrew/bin/bash instead of getting a mid-run command not found and a partially-applied pin.

No other gate in the derived set for #11770 failed; the remaining 18 were exit 0 on the same host.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions