Skip to content

less: use the real terminal capability stack#24

Merged
brandonpayton merged 4 commits into
mainfrom
migrate/less-cli
Jul 12, 2026
Merged

less: use the real terminal capability stack#24
brandonpayton merged 4 commits into
mainfrom
migrate/less-cli

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Build Less 668 as a normal ncurses consumer instead of linking the registry recipe's fake termcap archive. The formula installs the complete upstream command surface, uses the tap ncurses keg, and fork-instruments less so LESSOPEN and shell commands exercise Kandelo process semantics.

Dependency topology

The ncurses dependency-root PR #8 is merged into main. This PR targets main and keeps automattic/kandelo-homebrew/ncurses as Less's explicit direct dependency.

Formula contract

  • Build directly from the verified upstream source.
  • Link the real wide-character ncurses terminfo/termcap implementation.
  • Install less, lesskey, lessecho, and their manpages.
  • Compile system lesskey lookup paths against stable Homebrew opt prefixes rather than a build Cellar.
  • Fork-instrument less after the final link.
  • Test terminal initialization, ordinary paging, helper commands, a LESSOPEN fork/exec filter, and absence of Cellar paths in installed Wasm.

Source acceptance

The source formula may merge independently after a fresh source-only devil review. This PR contains no bottle block or Less sidecar, and merging it does not claim that a bottle is published or installable.

Existing runtime evidence

Pre-final ABI 18 source builds passed literal brew test, a Node PTY paging probe, and Chromium version, paging, LESSOPEN, and helper probes. The tested less executable exported all five wpk_fork_* hooks, had no Asyncify marker, and used stable opt/less and opt/ncurses paths.

Those runs are historical functional evidence only. Any earlier local bottle is rejected for publication; final bottle bytes and sidecars must be rebuilt from the merged platform and final source head, then proved in a stock guest.

Current restack validation

The three Less semantic commits and installed-tap loader commit were replayed unchanged onto tap main at aa99c67c632c4f5f0f6ac56850c2b325151e0b78. Before merge, the same exact head merged cleanly against current tap main at c1d51833ab33537b9a14d4d12705e44e5464d0d1; the formula blob was unchanged and the README merge added only the Less catalog line.

  • git range-diff reports all four commits unchanged from the already validated c4ea26f restack.
  • Every artifact-producing line after the support import is unchanged from reviewed head 15d5f6e; the formula-tail SHA-256 is b311d728a3e06a98b81a166c749f4ade0c717d1c75bcbdf8606c23019c31c39c.
  • Homebrew Ruby syntax passed.
  • Formula-support tests passed: 21 runs, 186 assertions.
  • brew style inspected Less with no offenses.
  • Literal Homebrew loading through installed Tap.fetch returned Less; the installed and branch support files both had SHA-256 f5f13ecbee24d8d87e50a6f457c5acd23c3fdee7af1cca1fb9f428bf9d021766.
  • git diff --check passed and the worktree is clean.

No source build or runtime suite was rerun for this history/import-only restack. Current head is 9e96741c4378a2e91f11dd9f208651c3d3ff4a89.

Bottle gates

Bottle construction, publication, and installability claims remain gated on:

The pthread fork-continuation fix and ABI 18 transition from Automattic/kandelo#867 are merged baseline, not pending gates. No platform ABI changes are made here. Firefox, WebKit, and a final poured-bottle PTY run are not claimed.

@brandonpayton

Copy link
Copy Markdown
Member Author

Independent devil's-advocate review completed at 7b2fca8.

I found one release-blocking tap defect: the original Wasm embedded the source-build Cellar/less/668 path for Less's system lesskey files. That could leave a poured bottle looking in the build Cellar. Commits 112e0de and 7b2fca8 compile those runtime paths against stable opt/less, keep installation in the normal keg, and make the formula test reject any Less Cellar path in all three commands while checking the exact .sysless, sysless, and syslesskey locations.

Post-fix evidence:

  • isolated source rebuild with --build-bottle: 14s, success
  • literal Node brew test: success, including real ncurses fallback data and LESSOPEN fork/exec
  • real Node PTY (40x5, empty on-disk terminfo): Less entered/restored the xterm alternate screen, rendered a page and prompt, consumed q, exited 0, empty stderr
  • Chromium: version, fallback-backed paging, LESSOPEN, lesskey, and lessecho all exited 0 with exact output and empty stderr
  • strict online audit, style, Ruby syntax, and diff checks: success
  • all commands return ABI 18; less has all five fork hooks; no Asyncify markers
  • less: 86f2fb58cf5ad63f66c9116dea1719bd284de363ffd445e1043ac02bcdf75939, 470,121 bytes

Formula completeness and dependency review found no remaining tap-owned defect: the direct dependency is ncurses, configure selects real -ltinfow, all three upstream commands and manpages install, only the fork-capable pager is instrumented, and the branch remains a clean stack on #8.

Residual gates are unchanged: #8, main #842/#867/#873/#874, then the trusted ABI 18 bottle/sidecar/stock-pour path and interactive PTY validation from the poured bottle. Firefox/WebKit remain unrun. Do not merge before those gates.

@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/less-cli branch 2 times, most recently from 53556fe to 15d5f6e Compare July 12, 2026 00:27
@brandonpayton brandonpayton changed the base branch from migrate/ncurses-dependency-root to main July 12, 2026 00:28
@brandonpayton brandonpayton force-pushed the migrate/less-cli branch 2 times, most recently from b7396cb to c4ea26f Compare July 12, 2026 01:58
@brandonpayton

Copy link
Copy Markdown
Member Author

Independent devil's-advocate source-only review at 9e96741c4378a2e91f11dd9f208651c3d3ff4a89: ACCEPT.

The review verified the official Less 668 source and licensing, sole direct ncurses dependency, upstream -ltinfow interface, stable opt/less and opt/ncurses paths, complete executable/manpage outputs, final-link instrumentation of the process-using pager only, and test coverage for paging, helpers, LESSOPEN, and Cellar-path rejection. Fresh dev-shell Ruby syntax, style, literal formula loading, support tests (21 runs / 186 assertions), range-diff, and whitespace checks passed.

After libmagic advanced tap main, a final clean merge-tree check against c1d51833ab33537b9a14d4d12705e44e5464d0d1 preserved the reviewed formula blob exactly and added only the Less README entry. The diff contains no bottle, sidecar, archive, receipt, provenance, or binary metadata. Historical Node/PTY/Chromium evidence is implementation evidence only; trusted bottles must be rebuilt after source merge. No source-formula blocker remains.

@brandonpayton brandonpayton merged commit c49d4e3 into main Jul 12, 2026
@brandonpayton brandonpayton deleted the migrate/less-cli branch July 12, 2026 02:22
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