Skip to content

test(dev): shorten Bash 3.2 feedback in sandboxed development #632

Open

Description

@mogul

Goal

Catch GNU Bash 3.2.57 incompatibilities during local, sandboxed development
before a pull request reaches the GitHub Actions Bash 3.2 compatibility gate
or a developer encounters a failure on macOS.

This complements, rather than replaces, the existing CI gate. That gate builds
and authenticates Bash 3.2.57 from source and remains the authoritative
independent check until local/CI parity is established.

Context

The repository supports the macOS system Bash version, 3.2.57. Important
compatibility failures are often runtime-semantic rather than syntax errors;
for example, empty-array expansion with set -u behaves differently in Bash
3.2 than in newer Bash releases. ShellCheck and syntax parsing are valuable but
cannot prove this class of behavior.

The current GitHub Actions workflow runs the offline Bats suite under Bash
3.2.57, but its feedback arrives only after a push. Faster local feedback is
especially valuable when development happens inside a Linux sandbox whose
default Bash is newer.

Proposed Developer Interface

Provide one repository-owned command, for example:

scripts/test-acq-bash32 [test/bats/file.bats ...]

It must:

  1. Resolve an explicit Bash 3.2.57 interpreter and fail closed if its version
    differs.
  2. Prepend that interpreter's directory to PATH so Bats and nested
    #!/usr/bin/env bash scripts also use Bash 3.2.
  3. Run the existing vendored Bats suite.
  4. Accept focused Bats-file arguments for rapid iteration.
  5. Offer a fast syntax-only mode, or a companion command, based on
    bash-3.2 -n over relevant host-side shell files.

Suggested usage:

devenv shell -- scripts/test-acq-bash32 test/bats/72-msb-agent-user.bats
devenv shell -- scripts/test-acq-bash32

Provisioning Options

Evaluate, rather than preselect:

  • Project-pinned devenv / Nix provisioning of Bash 3.2.57.
  • Mise as an optional launcher for the project-owned devenv command.
  • An explicit ACQ_BASH32=/path/to/bash override for CI and pre-provisioned
    environments.
  • Reuse of the existing source-build/signature-verification approach when Nix
    is unavailable.

The selected mechanism must pin its Nix input or equivalent package source and
verify the resolved interpreter version. It must not make ordinary acq run
depend on Nix, Mise, or Bash 3.2.

Validation Levels

Level Purpose
Syntax preflight Fast parser check with Bash 3.2 over relevant shell files
Focused Bats Runtime semantics for changed behavior and its dependencies
Full Bats suite Cross-module behavior under Bash 3.2
Existing CI gate Independent source-authenticated authoritative check

The feature must document that it validates Bash interpreter compatibility, not
BSD/macOS utility portability such as differences in sed, find, stat,
xargs, or filesystem behavior.

Acceptance Criteria

  • A documented sandbox-local command runs selected Bats files under verified
    Bash 3.2.57.
  • The command can run the full offline suite under the same interpreter.
  • Nested Bats and env bash invocations resolve to Bash 3.2.
  • Non-3.2 interpreters fail with an actionable message.
  • Interpreter provisioning is pinned and does not modify user-project runtime
    behavior.
  • The existing GitHub Actions Bash 3.2 gate remains unchanged until parity is
    demonstrated.

Non-Goals

  • Immediate replacement of the CI source-build/signature-verification flow.
  • A claim that Linux Bash 3.2 reproduces BSD/macOS external-command behavior.
  • Adding Bash 3.2, Nix, Mise, or devenv as a requirement for end-user
    workspaces.

AI-assisted research and drafting; human implementation and review required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions