Skip to content

vim: add the ncurses-backed editor leaf formula#36

Open
brandonpayton wants to merge 11 commits into
mainfrom
migrate/vim-cli
Open

vim: add the ncurses-backed editor leaf formula#36
brandonpayton wants to merge 11 commits into
mainfrom
migrate/vim-cli

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Add Vim as a first-class Kandelo Homebrew leaf formula. It builds and installs
the real editor, its complete runtime tree, canonical vi entry point,
manpages, and the separately linked xxd executable.

Formula contract

  • builds Vim 9.2.0750 for wasm32 with normal features, multibyte, channel,
    terminal, terminfo, POSIX search timeouts, and functional +libcall
  • links the declared automattic/kandelo-homebrew/ncurses dependency through
    its exact installed keg while compiling stable guest opt identities
  • links Vim with the SDK's functional -ldl glue instead of musl's weak dlfcn
    stubs; a real Wasm side module is loaded and called by the Formula test
  • fails closed unless configure selects HAVE_TIMER_CREATE, HAVE_DLOPEN, and
    HAVE_DLSYM; the test executes Vim's SIGEV_THREAD timer creation path
  • installs the full Vim runtime and documentation, aliases, manpages, and xxd
  • stages the declared Dash test dependency as /bin/sh for shell escapes
  • fork-instruments and validates Vim with fork: :required
  • separately validates xxd with fork: :forbidden
  • rejects ABI mismatch, legacy Asyncify, incomplete fork exports, host paths,
    and guest Cellar identities

Exact-head audit

Exact tap head: cc7a063420cb3101b12ed6aced7533546f945f29

Exact tree: 88b2cd938afee927a02da0791256a6706c35c635

Tap base: c5705667a90b05754d2244a362f3f7fc95d2f9c3

Formula SHA-256: d804c229ed725225172e7d2870f88d2598d7743212ee28d4feff07bba2d95aa8

  • upstream v9.2.0750 archive re-fetched at the declared
    7d460830e12082b541c34b0b96942ebface1ad9fa0b77245930717c0ccf8b664
    SHA-256; the archive contains Vim's declared license
  • the prior exact source build established the runtime/install surface and
    byte reproducibility, but its ABI 18 Vim linked weak stub_dlopen and
    stub_dlsym; it is retained only as diagnostic/source evidence, not as a
    valid current artifact or bottle
  • the new no-libc test side module compiled through scripts/dev-shell.sh; its
    dylink.0 metadata, bounded imports, and intended export were inspected
  • Formula Ruby syntax and git diff --check passed
  • independent devil's-advocate review accepted this exact head and tree

No current-head source build, Node run, Chromium run, bottle build, or stock
Homebrew pour is claimed. Those gates intentionally wait for the ABI 39
platform and exact ncurses bottle below.

Gates

Do not merge or publish a bottle yet.

Source/platform gates:

Publication gates:

After those gates land, rebuild from source at ABI 39, run the exact Formula
test under Node, build and publish the bottle from the dependency bottle, then
pour it through stock Homebrew and validate the real Vim workflow in both Node
and Chromium. This tap PR makes no ABI or platform behavior change itself.

@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/vim-cli branch 2 times, most recently from b3d49f4 to 9c06150 Compare July 12, 2026 00:25
@brandonpayton brandonpayton changed the base branch from migrate/ncurses-dependency-root to main July 12, 2026 00:26
@brandonpayton brandonpayton force-pushed the migrate/vim-cli branch 2 times, most recently from 9cc9749 to 1552539 Compare July 12, 2026 08:55
@brandonpayton

Copy link
Copy Markdown
Member Author

Independent devil review at exact head 1cb47a846bc0480e865a8a515810a64ca2463b75: ACCEPT for source merge after #882.

The correction loads shared support from the installed tap and replaces the pre-#70 hand-written shell guard with kandelo_validate_wasm_artifact(..., fork: :required) on the exact src/vim bytes that upstream installation receives. The shared validator requires the real kernel_fork import and complete continuation exports, rejects legacy Asyncify and ABI ambiguity, and adds staging/host-path rejection. Binaryen and WABT remain explicit build dependencies.

Fresh evidence through scripts/dev-shell.sh: Ruby syntax passed; Homebrew style found no offenses; shared Formula support passed 30 runs / 221 assertions; git diff --check passed. Formula SHA-256 is c7616bd27891e600b8cb5c5f4953bd83b7588eaa17216e52d4259e83d7edce38 and the worktree is clean.

No exact-head source build, runtime suite, bottle, or pour is claimed. #882 and the documented platform/publication gates remain binding.

@brandonpayton

Copy link
Copy Markdown
Member Author

Independent corrected-head review: ACCEPT for 76b8c49cbcfdbf7b38da177e3ef50e5d345b5ec6.

The review verified current tap-main ancestry, generic-before-exact prefix-map ordering, separate fail-closed validation of xxd, ABI 18 and fork/Asyncify policy for both installed executables, two-build byte reproducibility, the complete 2,061-file runtime surface, raw rejection of host and guest Cellar paths, full installed-keg tests, strict audit, style, and tap-wide readall. No blocking findings remain in the source candidate. Bottle publication remains gated as described in the PR body.

@brandonpayton

Copy link
Copy Markdown
Member Author

Exact-head devil's-advocate review: ACCEPT

  • head: cc7a063420cb3101b12ed6aced7533546f945f29
  • tree: 88b2cd938afee927a02da0791256a6706c35c635
  • base: c5705667a90b05754d2244a362f3f7fc95d2f9c3
  • Formula SHA-256: d804c229ed725225172e7d2870f88d2598d7743212ee28d4feff07bba2d95aa8

The audit found and corrected two fail-open paths in the prior ABI 18 source
evidence. Vim advertised +libcall while resolving dlfcn calls to musl's weak
stub_dlopen/stub_dlsym; the Formula now links Vim-only EXTRA_LIBS=-ldl
and its test loads and calls a real Wasm side module. Vim's cross configure
probe also assumed SIGEV_THREAD timer creation; the Formula now binds that
cache fact to exact HAVE_TIMER_CREATE output and executes the nonmatching
search(..., timeout) path that creates and disarms the POSIX timer. Exact
guards also require HAVE_DLOPEN and HAVE_DLSYM, and Binaryen is declared
for the test-side compile closure.

Focused evidence run for this head:

  • git diff --check
  • scripts/dev-shell.sh /usr/bin/ruby -c Formula/vim.rb
  • test side-module compile through sdk/bin/wasm32posix-cc -shared -fPIC
  • wasm-objdump -x inspection of dylink.0, bounded imports, and the intended
    kandelo_vim_libcall export
  • source/archive/license and dependency/runtime-closure audit

The dedicated timer fixture in Automattic/kandelo#907 is present at ABI 39
commit bcb02e93817ba757cac3bb4a1666aa46e195193f and is byte-identical to the
standalone timer-fix fixture. Registry Vim staging is not evidence for this
Formula because the registry recipe disables timer_create.

This is not a merge or bottle approval. No current-head ABI 39 source build,
Node Formula run, Chromium run, bottle build, or stock Homebrew pour is
claimed. Keep the PR open until the body-listed platform/publisher gates and
exact ncurses bottle land, then rebuild and validate those paths.

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