Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

file: add the compression-aware identification CLI - #69

Merged
brandonpayton merged 2 commits into
mainfrom
migrate/file-cli
Jul 12, 2026
Merged

file: add the compression-aware identification CLI#69
brandonpayton merged 2 commits into
mainfrom
migrate/file-cli

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 12, 2026

Copy link
Copy Markdown
Member

Purpose

Migrate the registry File package into Homebrew as the command-line consumer of the complete tap libmagic database. The CLI uses the standard file package name through a tap alias because File is a reserved Ruby class.

This removes the registry package's partial magic.lite workaround. Normal invocations load the full compiled database from libmagic's stable guest opt path.

Formula contract

  • Build the official file 5.45 CLI source for wasm32.
  • Consume the merged libmagic 5.45 static interface and declare bzip2, xz, and zlib explicitly.
  • Verify libmagic's pkg-config version and complete static compression link closure.
  • Build only upstream file(1), replacing its sibling libmagic.la dependency with the installed tap library contract.
  • Fork-instrument the final CLI for its retained process fallback path.
  • Install only bin/file and file(1); libmagic remains the sole owner of the library and complete database.
  • Test Wasm/PDF/stdin/symlink behavior and zlib, gzip, bzip2, and xz -z classification.

Source acceptance

The source formula may merge independently after a fresh source-only devil review. This PR contains no bottle block, sidecar, archive, receipt, provenance metadata, Wasm, or other binary artifact, and merging it does not claim that a bottle is published or installable.

Existing runtime evidence

Earlier ABI 18 source and browser runs passed literal brew test and equivalent Chromium classification with guest PATH=/no-such-path. The installed binary used only libmagic's stable opt database path, imported kernel_fork, exported all five wpk_fork_* functions, contained no Asyncify surface, and reported ABI 18.

Those runs and any local bottle are historical implementation evidence only and are rejected for publication.

Current restack validation

After libmagic merged, the File-owned semantic commit was transplanted directly onto tap main, followed by an installed-tap loader commit. It was then replayed onto exact current tap main at 580aca3a84d5f4de9ef8d8ca023e014cbfb5e386, preserving both the merged gawk entry and the File entry.

  • Every artifact-producing formula line after the support import is byte-identical to the functionally validated head; its SHA-256 is 222f40b516701eae99c24081276734b4d825f4c596b97c7f71a438c21029533b.
  • The semantic range differs only by the additive README catalog resolution; the alias and formula bodies are unchanged.
  • Homebrew Ruby syntax passed through Kandelo's dev shell.
  • Formula-support tests passed: 21 runs, 186 assertions.
  • brew style inspected the formula with no offenses.
  • 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 ee682777f816c43ecfebe743d3371bc35a1710b0.

Bottle gates

Publication is dependency-first: trusted bzip2, xz, zlib, and libmagic bottles must be published and poured before building File, and the File receipt/provenance must record those prior Homebrew bottles.

Trusted bottle publication remains gated on the applicable platform work in Automattic/kandelo#842, #873, #874, #881, #882, #885, #888, and #890; tap #22 if a branch dry run is needed; and a fresh exact merged-head ABI 18 build with reviewed sidecar and stock-guest Node/Chromium pour tests against published bytes.

Automattic/kandelo#867 is the merged ABI 18 baseline, not a pending gate. No main-repository or ABI change is included here.

This replaces the automatically closed stacked PR #30, which GitHub made non-reopenable after its libmagic base branch merged and the File head was moved to current main.

@brandonpayton

Copy link
Copy Markdown
Member Author

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

The substantive review verified the official file 5.45 source/license, reserved FileFormula plus real Aliases/file behavior, direct pkgconf/libmagic/bzip2/xz/zlib topology, complete static pkg-config closure, stable libmagic database path, required final fork instrumentation, CLI/manpage ownership, and Wasm/PDF/stdin/symlink plus four-compression tests. Fresh dev-shell syntax, style, literal alias/formula loading, support tests (21 runs / 186 assertions), and whitespace checks passed.

The only original rejection was a README collision after gawk merged. At the corrected exact head, the clean merge tree against 580aca3a84d5f4de9ef8d8ca023e014cbfb5e386 preserves the reviewed formula blob 7f2234e8ced66b4770799ea7dc9bc9a9f76839, alias blob bb915dc8fa4c36e089593e90484871670e02ecc0, and both catalog entries. The diff contains no bottle, sidecar, archive, receipt, provenance, JSON, Wasm, or other binary metadata. Historical ABI 18 runtime evidence remains non-publication evidence. No source-formula blocker remains.

@brandonpayton
brandonpayton merged commit f49db74 into main Jul 12, 2026
@brandonpayton
brandonpayton deleted the migrate/file-cli branch July 12, 2026 02:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant