Skip to content

bash: add the first-class Kandelo shell formula#38

Merged
brandonpayton merged 3 commits into
mainfrom
migrate/bash-shell
Jul 12, 2026
Merged

bash: add the first-class Kandelo shell formula#38
brandonpayton merged 3 commits into
mainfrom
migrate/bash-shell

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Add GNU Bash 5.2.37 as an idiomatic staged-source Kandelo formula backed by the tap's ncurses dependency root.

Bash registers cleanup callbacks with several native C signatures, then dispatches them through a single void (*)(void *) unwind path. WebAssembly enforces indirect-call signatures, so passing Bash's remaining void (void) callbacks directly can trap during real source, timed-read, and fc unwinds. This formula normalizes the callback surface instead of masking those runtime paths.

Change

  • Normalize Bash cleanup callbacks to the dispatcher's void (void *) signature, including wrappers for maybe_pop_dollar_vars, reset_timeout, and set_verbose_flag; remove the unused bashline_reinitialize wrapper.
  • Keep only nine Bash-specific runtime/path configure results in the formula. Reusable libc availability facts are owned by sdk: centralize cross-compile function availability kandelo#874.
  • Assert the generated target configuration before building: descriptor aliases, fnmatch behavior, rlim_t, mbsnrtowcs, ulimit, absent non-target functions, and ncurses -ltinfo.
  • Optimize before fork instrumentation and reject stale ABI, legacy Asyncify, incomplete fork exports, and host/staging path leaks.
  • Install through upstream make install, including Bash, bashbug, manuals, Info, HTML, and upstream documentation.
  • Exercise sourced-argument unwind restoration, real timed-read timeout unwinding, interactive fc replay, language features, pipelines, command substitution, recursive exec/wait, process substitution, and signal delivery in test do.

Dependency ancestry

Ncurses source PR #8 is merged. This branch is based directly on tap main at f49db74 (File merged).

Current head: 42ae37e8f80ffd435f03f897d6ac1ae4eedc8d96.

Formula SHA-256: 34561219c4c309e268a91024f7433f5394b5999b0eca62f6c742ee2418086453.

The diff contains only Formula/bash.rb and its README row. It contains no bottle block, sidecar, or binary artifact.

Source/build validation

Run through Kandelo's scripts/dev-shell.sh:

  • Homebrew Ruby syntax: passed.
  • brew style: one file, no offenses.
  • Tap formula-support suite: 21 runs, 186 assertions, no failures.
  • git diff --check origin/main...HEAD: passed.
  • Checksum-verified pristine Bash 5.2.37 source was normalized by the formula.
  • Configure against the current #874 SDK facts and ABI 18 sysroot produced every asserted config.h value and TERMCAP_LIB = -ltinfo.
  • A serial Bash link completed with only the expected locale, kernel, dlopen, channel, and memory imports.
  • wasm-objdump reports all three new wrappers as (i32) -> nil; the obsolete wrapper and incompatible direct registrations are absent.
  • Focused host-Bash probes confirmed the exact timed-read test returns 142 and the exact interactive fc input replays the command twice.

Independent devil's-advocate review accepts this exact formula blob for source/build integration, contingent on #874 landing before bottle publication.

I did not build, optimize, fork-instrument, pour, or runtime-test a Homebrew Bash bottle. This is source acceptance, not a bottle claim.

Bottle gates

The authoritative ABI 18 Bash bottle must be rebuilt only after the following main-repo platform PRs land:

Tap PR #22 is additionally required only for a branch-based pre-merge bottle dry run.

The exact-head bottle build must consume final libcxx and ncurses bottles through Homebrew. Source-keg and poured-bottle tests must run in a stock Kandelo guest on Node and Chromium, with Homebrew receipts and provenance proving ncurses came from its prior bottle.

Automattic/kandelo#864 and #867 are merged platform baseline. No ABI change is made here. Firefox, WebKit, wasm64, and any historical local Bash bottle are not claimed.

@brandonpayton brandonpayton force-pushed the migrate/ncurses-dependency-root branch from a6e58d2 to 23f0533 Compare July 11, 2026 21:35
@brandonpayton brandonpayton force-pushed the migrate/ncurses-dependency-root branch from 23f0533 to 93567f2 Compare July 11, 2026 22:55
@brandonpayton brandonpayton force-pushed the migrate/bash-shell branch 2 times, most recently from c270843 to c4bedae Compare July 12, 2026 00:25
@brandonpayton brandonpayton changed the base branch from migrate/ncurses-dependency-root to main July 12, 2026 00:25
@brandonpayton brandonpayton force-pushed the migrate/bash-shell branch 3 times, most recently from 30d0823 to 6190502 Compare July 12, 2026 02:15
@brandonpayton

Copy link
Copy Markdown
Member Author

Exact-head devil review: ACCEPT for source/build integration at 42ae37e8f80ffd435f03f897d6ac1ae4eedc8d96.

  • Formula SHA-256 remains 34561219c4c309e268a91024f7433f5394b5999b0eca62f6c742ee2418086453 after the clean restack onto f49db74.
  • Pristine Bash 5.2.37 normalization, configure assertions, serial link, and the three (i32) -> nil unwind wrappers were verified.
  • Ruby syntax, style, support 21/186, and diff checks pass.
  • Diff is source-only: formula plus README row; no bottle metadata or artifacts.

This accepts source merge only. Bottle publication remains blocked on Automattic/kandelo#874 and the other gates listed in the PR body, followed by a stock-Kandelo build/pour using the ncurses Homebrew bottle.

@brandonpayton brandonpayton merged commit 86a9ae5 into main Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant