You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
marketplace-check.sh: case pattern inside $( ) is a syntax error on macOS bash 3.2, so exec aborts silently #763
bash 3.2 treats the unbalanced ) of the pattern *"refusing to guess"*) as the end of the $( ). This is the same class of bug as #552 (script-owners), in a different file.
bash -n does not catch it, because bash 3.2 parses the command substitution only when it runs. At run time it prints command substitution: syntax error near unexpected token 'newline', and out holds the rest of the script text instead of the mpr / mx lines. In our project, every bin/exec.sh run on a domain-model script stopped there.
Minimal repro on macOS /bin/bash 3.2.57:
f() { out="$( m="x refusing to guess";false|| {case"$m"in*"refusing to guess"*) printf'A\n' ;; esac; }exit 0 )";echo"OUT=[$out]"; }
f # syntax error, then OUT=[ printf 'A\n' ;; esac; } ... ]
Steps to reproduce
On macOS, with the stock /bin/bash 3.2.57.
Run bin/exec.sh on any domain-model MDL script, or run the repro above.
You get the syntax error, and the marketplace check never sees the .mpr.
Expected
The marketplace check runs and the exec continues.
Fix (verified locally on bash 3.2 and bash 5)
Use the POSIX leading paren on the pattern:
case"$m"in (*"refusing to guess"*) printf'mpr\tAMBIGUOUS\n' ;; esac
Triage: FIX track. portability (macOS bash 3.2). Verified by inspection on master 6dad68f: the line is at bin/lib/marketplace-check.sh:115, as reported. The bash 3.2 runtime failure is UNVERIFIED here (no bash 3.2 on this runner), but it is the known #552 class. Root cause / Problem: _mkt_locate (bin/lib/marketplace-check.sh:115) runs case "$m" in *"refusing to guess"*) … esac inside $( … ). bash 3.2 reads the pattern's unmatched ) as the end of the command substitution. bash -n does not catch it, and bin/check-portability.sh has no rule for this pattern. Value: H. Per the report, every bin/exec.sh run on a domain-model script stops at the marketplace check on stock macOS /bin/bash. That is a hard stop on the main build path for every Mac user. Risk of fixing: L. (pattern) is POSIX and behaves the same on bash 3.2, bash 5 and Git Bash. There is no verdict, exit-code or output change apart from the check now working. 0 baseline words. Rigidity check: no process, architecture or performance change. Process cost (#687): per exec (domain-model scripts). Wall-clock is unchanged, and it removes a hard failure. Needs clarification: no Learning value: learned rule (portability): a case inside $( ) always uses the leading-paren pattern (pat). This is the second occurrence after #552, so a mechanical check is worth adding. Proposed fix:
Change the pattern at :115 to (*"refusing to guess"*).
Sweep the other case statements inside $( ) under bin/, bin/lib/ and project-bin/ for the same shape.
Add a check-portability.sh rule that flags a case pattern without a leading ( inside a command substitution, so a third one can't land.
Alternative: move the case out of the substitution into a helper function. That is a bigger change for no extra gain. Proof: bash -n can't catch this. Either run a small fixture under /bin/bash 3.2 in CI (macOS runner), or use a check-portability fixture with the reporter's minimal repro, which must be flagged on master. Effort: XS (the fix) / S (with the lint rule). Recommendation: FIX NOW. Credit thanarat. Labels: kind/bug, size/s
Reply go (FIX) or go option N (DISCUSS). Fix PRs still get independent review and your merge.
Fix PR opened: #774. The case pattern at marketplace-check.sh:115 now has a leading paren. check-portability.sh gets a new rule 3 so this bug class can't return; the sweep found no other occurrences. Thanks @thanarat for the report and the verified fix. Waiting for an independent review before merge, including the fixtures that couldn't be run here.
Activity
MendixMau commentedon Nov 16, 2026
Triage: FIX track. portability (macOS bash 3.2). Verified by inspection on master 6dad68f: the line is at
bin/lib/marketplace-check.sh:115, as reported. The bash 3.2 runtime failure is UNVERIFIED here (no bash 3.2 on this runner), but it is the known #552 class.Root cause / Problem:
_mkt_locate(bin/lib/marketplace-check.sh:115) runscase "$m" in *"refusing to guess"*) … esacinside$( … ). bash 3.2 reads the pattern's unmatched)as the end of the command substitution.bash -ndoes not catch it, andbin/check-portability.shhas no rule for this pattern.Value: H. Per the report, every
bin/exec.shrun on a domain-model script stops at the marketplace check on stock macOS/bin/bash. That is a hard stop on the main build path for every Mac user.Risk of fixing: L.
(pattern)is POSIX and behaves the same on bash 3.2, bash 5 and Git Bash. There is no verdict, exit-code or output change apart from the check now working. 0 baseline words.Rigidity check: no process, architecture or performance change.
Process cost (#687): per exec (domain-model scripts). Wall-clock is unchanged, and it removes a hard failure.
Needs clarification: no
Learning value: learned rule (portability): a
caseinside$( )always uses the leading-paren pattern(pat). This is the second occurrence after #552, so a mechanical check is worth adding.Proposed fix:
:115to(*"refusing to guess"*).casestatements inside$( )underbin/,bin/lib/andproject-bin/for the same shape.check-portability.shrule that flags acasepattern without a leading(inside a command substitution, so a third one can't land.Alternative: move the
caseout of the substitution into a helper function. That is a bigger change for no extra gain.Proof:
bash -ncan't catch this. Either run a small fixture under/bin/bash3.2 in CI (macOS runner), or use acheck-portabilityfixture with the reporter's minimal repro, which must be flagged on master.Effort: XS (the fix) / S (with the lint rule). Recommendation: FIX NOW. Credit thanarat.
Labels: kind/bug, size/s
Reply go (FIX) or go option N (DISCUSS). Fix PRs still get independent review and your merge.
Generated by Claude Code
MendixMau commentedon Nov 16, 2026
Fix PR opened: #774. The case pattern at
marketplace-check.sh:115now has a leading paren.check-portability.shgets a new rule 3 so this bug class can't return; the sweep found no other occurrences. Thanks @thanarat for the report and the verified fix. Waiting for an independent review before merge, including the fixtures that couldn't be run here.Generated by Claude Code
fix(marketplace-check): leading-paren case pattern inside $( ) for ba…