Skip to content

gateway-vm.sh fails on macOS stock Bash 3.2 — bad substitution #1485

@pixelsoccupied

Description

@pixelsoccupied

Agent Diagnostic

  • Explored tasks/scripts/gateway-vm.sh and tasks/scripts/gateway.sh
  • Found normalize_bool() on line 61 uses ${1,,} (Bash 4+ syntax)
  • macOS ships Bash 3.2.57 which doesn't support this
  • Confirmed gateway.sh line 50 already uses the portable pattern:
    printf '%s' "$1" | tr '[:upper:]' '[:lower:]'
  • Applied the same tr pattern to gateway-vm.sh and package-snap.sh
  • Verified fix: mise run gateway:vm starts successfully, microVM sandbox
    boots and responds to exec commands on macOS 15 Apple Silicon
  • Also found package-snap.sh:62 has the same issue (lower priority, Linux-only)

Description

mise run gateway:vm fails immediately on macOS with stock Bash 3.2:

tasks/scripts/gateway-vm.sh: line 61: ${1,,}: bad substitution

The normalize_bool() function uses ${1,,} for case-insensitive matching, which requires Bash 4+. macOS ships Bash 3.2. The same function in gateway.sh already uses the portable tr pattern.

This blocks all macOS VM driver usage. The VM driver's primary dev target is Apple Silicon via Hypervisor.framework, and mise run gateway:vm is the only entry point.

Expected: gateway starts normally.

Reproduction Steps

  1. On macOS with stock bash (3.2.x), clone the repo
  2. Run mise run gateway:vm
  3. Script exits immediately with: bad substitution

Environment

  • OS: macOS 15.5 (Apple Silicon)
  • Bash: GNU bash 3.2.57(1)-release (arm64-apple-darwin25)
  • OpenShell: 0.0.46-dev.1+g14c5329f (built from source, main branch)
  • Docker: Docker 27.x via Colima (not relevant — script fails before driver init)

Logs

[gateway:vm] $ bash tasks/scripts/gateway-vm.sh
tasks/scripts/gateway-vm.sh: line 61: ${1,,}: bad substitution
[gateway:vm] ERROR task failed

Fix

Replace ${1,,} with $(printf '%s' "$1" | tr '[:upper:]' '[:lower:]') in:

  • tasks/scripts/gateway-vm.sh:61
  • tasks/scripts/package-snap.sh:62

This matches the existing portable pattern in gateway.sh:50.

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions